The <dictionary/> command

The <dictionary/> command loads a run-time hyphenation exception dictionary. Exception dictionaries can be used to declare your own hyphenation break points, or to stop TopLeaf from hyphenating a word altogether.

The command format is:

<dictionary file="NAME" lang="LA" append="AP" if-exists="IE" />

where :

  • NAME specifies is the full pathname of the exception dictionary file. You may use either forward or backslashes to delineate the path folders.

  • LA specifies a recognised ISO 639 language code that defines the language scope in which the exception dictionary will be referenced. If not specified, defaults to EN.

  • AP specifies if the contents of the exception dictionary file are appended to the run-time hyphenation exception dictionary, or replace those definitions. If YES, the contents of the exception list are appended to the run-time hyphenation dictionary. If NO, then the run-time exception list is reset before loading the specified exception dictionary. If not specified, defaults to YES. Note that a reset only affects the exception list associated with the specified language code.

  • IE specifies if TopLeaf generates an error when an attempt is made to load an undefined exception dictionary file. By default, TopLeaf will report an error if the dictionary referenced by this command does not exist. In some circumstances, you may want to attempt to load an exception list file, but not report an error if it does not exist. If YES, and the exception list file exists, it will be loaded. If the file does not exist, no further action will be taken by this command.

Examples

The following example shows how to load a set of language specific hyphenation exception dictionaries:

<dictionary file="C:\users\Dictionaries\enHyphens.txt" lang="en" />
<dictionary file="C:\users\Dictionaries\deHyphens.txt" lang="de" />
<dictionary file="C:\users\Dictionaries\frHyphens.txt" lang="fr" />

The following example shows how to load a locale specific hyphenation exception dictionary:

<switch>
<case var="{locale}" target="en-US" >
   <dictionary file="C:\users\Dictionaries\enUS-Hyphens.txt" lang="en" />
</case>
<case>
   <dictionary file="C:\users\Dictionaries\enHyphens.txt" lang="en" />
</case>
</switch>

The following example shows how to load a generic and content specific hyphenation exception dictionaries:

<dictionary file="C:\users\Dictionaries\enHyphens.txt" lang="en" />
<dictionary file="C:\users\Dictionaries\enMedical.txt" lang="en" append="yes" />