The text output module restores a processed document from the internal format to its textual form.  It re-imposes capitalization on words and restores punctuation, format markers, white space, and line breaks.  Also, orthography changes can be made, and the delimiter that marks ambiguities and failures can be changed.  This chapter describes the control file given to the text output module. (This chapter is adapted from chapter 8 of Weber (1990).)

Text output ambiguity delimiter: \ambig
=======================================

The text output module flags words that either produced no results or multiple results when processed.  These are flagged with percent signs (%) by default, but this can be changed by declaring the desired character with the \ambig field code.  For example, the following would change the ambiguity delimiter to @:

     \ambig @

Text output orthographic changes: \ch
=====================================

The text output module allows orthographic changes to be made to the processed words. These are given in the text output control file.
     [file changes.txi not included]

Decomposition Separation Character: \dsc
========================================

The \dsc field defines the character used to separate the morphemes in the decomposition field of the input analysis file.  For example, to use the equal sign (=), the text input control file would include:

     \dsc  =

This would handle a decomposition field like the following:

     \d %3%kay%ka=y%ka=y%

It makes sense to use the \dsc field only once in the text output control file.  If multiple \dsc fields do occur in the file, the value given in the first one is used.  If the text output control file does not have an \dsc field, a dash (-) is used.

The first printing character following the \dsc field code is used as the morpheme decomposition separator character.  The same character cannot be used both for separating decomposed morphemes in the analysis output file and for marking comments in the output control files.  Thus, one normally cannot use the semicolon (;) as the decomposition separation character.

This field is provided for use by the INTERGEN program.  It is of little use to UNKNOWN_PROGRAM.

Primary format marker character: \format
========================================

The \format field designates a single character to flag the beginning of a primary format marker.  For example, if the format markers in the text files begin with the at sign (@), the following would be placed in the text input control file:

     \format  @

This would be used, for example, if the text contained format markers like the following:

     @
     @p
     @sp
     @make(Article)
     @very-long.and;muddled/format*marker,to#be$sure

If a \format field occurs in the text input control file without a following character to serve for flagging format markers, then the program will not recognize any format markers and will try to parse everything other than punctuation characters.

It makes sense to use the \format field only once in the text input control file.  If multiple \format fields do occur in the file, the value given in the first one is used.

The first printing character following the \format field code is used to flag format markers.  The character currently used to mark comments cannot be assigned to also flag format markers.  Thus, the semicolon (;) cannot normally be used to flag format markers.

This field is provided for use by the INTERGEN program.  It is of little use to UNKNOWN_PROGRAM.

Lowercase/uppercase character pairs: \luwfc
===========================================

To break a text into words, the program needs to know which characters are used to form words.  It always assumes that the letters A through Z and a through z are used as word formation characters.  If the orthography of the language the user is working in uses any other characters that have lowercase and uppercase forms, these must given in a \luwfc field in the text input control file.

The \luwfc field defines pairs of characters; the first member of each pair is a lowercase character and the second is the corresponding uppercase character.  Several such pairs may be placed in the field or they may be placed on separate fields.  Whitespace may be interspersed freely.  For example, the following three examples are equivalent:

     \luwfc  éÉ ñÑ

or

     \luwfc  éÉ      ; e with acute accent
     \luwfc  ñÑ      ; enyee

or

     \luwfc  é É  ñ Ñ

Note that comments can be used as well (just as they can in any UNKNOWN_PROGRAM control file).  This means that the comment character cannot be designated as a word formation character.  If the orthography includes the semicolon (;), then a different comment character must be defined with the -c command line option when UNKNOWN_PROGRAM is initiated; see

The \luwfc field can be entered anywhere in the text input control file, although a natural place would be before the \wfc (word formation character) field.

Any standard alphabetic character (that is a through z or A through Z) in the \luwfc field will override the standard lower- upper case pairing.  For example, the following will treat X as the upper case equivalent of z:

     \luwfc z X

Note that Z will still have z as its lower-case equivalent in this case.

The \luwfc field is allowed to map multiple lower case characters to the same upper case character, and vice versa.  This is needed for languages that do not mark tone on upper case letters.

Multibyte lowercase/uppercase character pairs: \luwfcs
======================================================

The \luwfcs field extends the character pair definitions of the \luwfc field to multibyte character sequences.  Like the \luwfc field, the \luwfcs field defines pairs of characters; the first member of each pair is a multibyte lowercase character and the second is the corresponding multibyte uppercase character.  Several such pairs may be placed in the field or they may be placed on separate fields.  Whitespace separates the members of each pair, and the pairs from each other.  For example, the following three examples are equivalent:

     \luwfcs  e' E` n~ N^ ç C&

or

     \luwfcs  e' E`      ; e with acute accent
     \luwfcs  n~ N^      ; enyee
     \luwfcs  ç  C&      ; c cedilla

or

     \luwfcs  e' E`
              n~ N^
              ç  C&

Note that comments can be used as well (just as they can in any UNKNOWN_PROGRAM control file).  This means that the comment character cannot be designated as a word formation character.  If the orthography includes the semicolon (;), then a different comment character must be defined with the -c command line option when UNKNOWN_PROGRAM is initiated; see

Also note that there is no requirement that the lowercase form be the same length (number of bytes) as the uppercase form.  The examples shown above are only one or two bytes (character codes) in length, but there is no limit placed on the length of a multibyte character.

The \luwfcs field can be entered anywhere in the text input control file.  \luwfcs fields may be mixed with \luwfc fields in the same file.

Any standard alphabetic character (that is a through z or A through Z) in the \luwfcs field will override the standard lower- upper case pairing.  For example, the following will treat X as the upper case equivalent of z:

     \luwfcs z X

Note that Z will still have z as its lowercase equivalent in this case.

The \luwfcs field is allowed to map multiple multibyte lowercase characters to the same multibyte uppercase character, and vice versa. This may be useful in some situations, but it introduces an element of ambiguity into the decapitalization and recapitalization processes.  If ambiguous capitalization is supported, then for the previous example, z will have both X and Z as uppercase equivalents, and X will have both x and Z as lowercase equivalents.

Text output string classes: \scl
================================

A string class is defined by the \scl field code followed by the class name, which is followed in turn by one or more contiguous character strings or (previously defined) string class names.  A string class name used as part of the class definition must be enclosed in square brackets. For example, the sample text output control file given below contains the following lines:

     a. \scl X t s c
     b. \ch "h"   "j"   / [X] ~_

Line a defines a string class including t, s, and c; change rule b makes use of this class to block the change of h to j when it occurs in the digraphs th, sh, and ch.

The class name must be a single, contiguous sequence of printing characters.  Characters and words which have special meanings in tests should not be used.  The actual character strings have no such restrictions.  The individual members of the class are separated by spaces, tabs, or newlines.

Each \scl field defines a single string class.  Any number of \scl fields may appear in the file.  The only restriction is that a string class must be defined before it is used.

Caseless word formation characters: \wfc
========================================

To break a text into words, the program needs to know which characters are used to form words.  It always assumes that the letters A through Z and a through z are used as word formation characters.  If the orthography of the language the user is working in uses any characters that do not have different lowercase and uppercase forms, these must given in a \wfc field in the text input control file.

For example, English uses an apostrophe character (') that could be considered a word formation character.  This information is provided by the following example:

     \wfc  '    ; needed for words like don't

Notice that the characters in the \wfc field may be separated by spaces, although it is not required to do so.  If more than one \wfc field occurs in the text input control file, the program uses the combination of all characters defined in all such fields as word formation characters.

The comment character cannot be designated as a word formation character. If the orthography includes the semicolon (;), then a different comment character must be defined with the -c command line option when UNKNOWN_PROGRAM is initiated; see

Multibyte caseless word formation characters: \wfcs
===================================================

The \wfcs field allows multibyte characters to be defined as ``caseless'' word formation characters.  It has the same relationship to \wfc that \luwfcs has to \luwfc.  The multibyte word formation characters are separated from each other by whitespace.

A sample text output control file
=================================

A complete text output control file used for adapting to Asheninca Campa is given below.

     \id AEouttx.ctl for Asheninca Campa
     \ch "N"   "m"  / _ p       ; assimilates before p
     \ch "N"   "n"              ; otherwise becomes n
     \ch "ny"  "n~"

     \ch "ts"  "th" / ~_ i      ; (N)tsi is unchanged
     \ch "tsy" "ch"
     \ch "sy"  "sh"
     \ch "t"   "tz" / n _ i

     \ch "k"   "qu" / _ i / _ e
     \ch "k"   "q"  / _ y
     \ch "k"   "c"

     \scl X t s c               ; define class of  t   s   c
     \ch "h"   "j"   / [X] ~_   ; change except in th, sh, ch

     \ch "#"   " "              ; remove fixed space
     \ch "@"   ""              ; remove blocking character