HunspellXML Format (AffixFile) - TrnsltLife/HunspellXML GitHub Wiki
HunspellXML Format > AffixFile
A Hunspell dictionary is valid as long as it has a .dic file giving a list of correctly spelled words. But Hunspell is much more powerful with the addition of the .aff file, which allows you to create rules for adding prefixes and suffixes to words, control what words can form compounds with other words, influence the algorithm that suggests words to the user for incorrect spellings, and so on.
The <affixFile>
element in HunspellXML corresponds to the Hunspell .aff file. Although an .aff file is not required for Hunspell, HunspellXML requires it so that your assumptions about the character encoding, flag type, and language code are all recorded in the HunspellXML file. The <affixFile>
element contains sub-elements that allow you to specify information about:
-
<affixes>
optional - affix rules (e.g. for noun and verb morphology) -
<compounds>
optional - compound word formation rules -
<convert>
optional - data input and output conversions -
<settings>
required - general settings -
<suggestions>
optional - information to help the spell checker make suggestions for a misspelled word
<affixFile>
<affixes> ... </affixes>
<compounds> ... </compounds>
<convert> ... </convert>
<settings> ... </settings>
<suggestions> ... </suggestions>
</affixFile>