PATTN.* files are ASCII coded files that contain all the parameters used to build a CPATTN.* file describing the hyphenation rules for a certain language Using the program named CPATTN.EXE it is possible to compile a PATTN.* file to obtain the corresponding CPATTN.* one.
A PATTN.* file has 3 main sections. Generally all empty lines are ignored, and lines starting with the '%' char are treated as comments.
The file header is made up of lines in the form: <name>=<value> to define the irregular hyphenations table, the name of the (eventually) linked DLL and the uppercase letter set (letters that must be considered as uppercase). This entries are not case sensitive, spaces before or after the '=' char are skipped. The 'name' that could be specified in the header is also: dll=<DLL name> that defines the name of the external DLL to be called. The extension has to be specified, but no path. If this keyword is not specified in the header, the hyphenation takes place using the Liang algorithm so the file must contain patterns (see Patterns section). upper=<Upper Case letters> defines which letters have to be considered as upper case, <Upper case letters> is a string of non-delimited chars, a '#' or '#$' prefix can be used to specify decimal or hexadecimal codes (eg. 'upper=ABCDE#200#$FF' specifies that the upper case letters are 'A', 'B', 'C', 'D', 'E' , the char with decimal code 200 and the char with hexadecimal code FF). if this keyword is missed the standard ANSI set applies. special=<number>,<pre min>,<pre max>,<post min>,<post max> defines a special hyphenation that deletes <number> chars from the original word and inserts the strings <pre min> or <pre max> before the hyphenation point (i.e. at the end of the line) and inserts the strings <post min> or <post max> after the hyphenation point (i.e. at the beginning of the next line). <number> is an integer in the range -3 to +3, where less than 0 means the chars must be deleted before the hyphenation point and greater than 0 means the chars must be deleted after the hyphenation point. The four strings may contain chars or char codes with the '#' or '#$' prefix for decimal and hexadecimal coding. The <pre max> string must be the upper case version of the <pre min> one and the <post max> string must be the upper case version of the <post min> one. The <pre max> and <post max> strings are used when the word is upper case, i.e. when the char before the hyphenation point has been included in the 'upper=...' sequence. otherwise the <pre min> and <post min> strings are used. The sequence special=-1,-,-,, defines a special hyphenation rule that deletes the char before the hyphenation point and adds an '-' char. Each 'special' sequence has a corresponding code depending upon the declaration order. the first one has code 1, and so on. the maximum number of 'special' hyphenations is 32. |
A second section contains the lower casing table, made up of lines in the form: <original letter> <lower case equivalent> that must end with a line containing the 'end' keyword. |
The Patterns section contains the hyphenation patterns used by the Liang algorithm and has not to be specified if the hyphenation calls an external DLL. A pattern consists of chars and digits (control values), e.g.: 2a1r defines the pattern 'ar' having a control value of 2 before the 'a', control value of 1 between the 'a' and the 'r' and control value of 0 after the 'r'. Note: the odd control values enable a hyphenation point with specified desirability (1-9), while the even values disable the hyphenation point, again with specified desirability (0-8) The '.' char may be used to indicate a pattern applies as a word prefix or suffix. The line e4a4u4x. defines the pattern 'eaux' that must occur at the end of a word (suffix). The line .ach4 defines the pattern 'ach' that must occur at the beginning of a word (prefix). After a control value it is possible to specify which special hyphenation should apply in that point: the special hyphenation code must be preceeded by the '-' char. The line e1-3e defines the pattern 'ee' with a control value of 1 between the letters that uses the special hyphenation #3. All the chars included in a pattern are converted to lower case using the lower casing table specified in the section 2. |
See also
Loading hyphenation in database