How to Alter a Hyphenation Dictionary
The hyphenation dictionaries are stored as XML files in the [CHEMISTRY_INSTALL_DIR]/config/hyph directory.
You can copy the dictionaries you need to change in another directory, then use the
-hyph-dir
parameter to refer them inside your transformation.
Each file is named with the language code and has the following structure:
<hyphenation-info>
<hyphen-min before="2" after="3"/>
<exceptions>
o-mni-bus
...
</exceptions>
<patterns>
préémi3nent.
proémi3nent.
surémi3nent.
....
</patterns>
</hyphenation-info>
To change the behavior of the hyphenation, you can modify either the patterns or the
exceptions sections:
- exceptions
- Contains the list of words that are not processed using the patterns, each on a single
line. Each of the words should indicate the hyphenation points using the hyphen ("-")
character. If a word does not contain this character, it will not be hyphenated.
For example,
o-mni-bus
will match theomnibus
word and will indicate two possible hyphenation points.Note: Compound words (i.e. e-mail) cannot be controlled by exception words. - patterns
- Contains the list of patterns, each on a single line. A pattern is a word fragment,
not a word. The numbers from the patterns indicate how desirable a hyphen is at that
position.
For example,
tran3s2act
indicates that the possible hyphenation points are "tran-s-act" and the preferable point is the first one, having the higher score of "3".