Hunspell affix file, specified as the comma-separated pair consisting of
'Affixes'
and a file path of a Hunspell affix file.
A Hunspell affix file is a .aff
file containing the number of
words in the dictionary followed by a list of the words in the following
format:
option1 values1
option2 values2
...
optionM valuesM
where M
is the number of options in the affix file,
option1
, option2
, …,
optionM
are the M
options, and
values1
, …, valuesN
specify the values
corresponding to the options option1
, option2
,
…, optionM
, respectively. Use these options to specify
affixes.
Prefixes
To define a prefix rule, use the PFX
option with the
format:
PFX flag crossProduct K
PFX flag stripping1 prefix1 condition1
...
PFX flag strippingK prefixK conditionK
where
the values:
flag
corresponds to the flags used in the Hunspell
dictionary file.
crossProduct
indicates whether prefixes and suffixes
can be mixed, specified as Y
or
N
.
K
is the number of prefixes defined for the specified
flag.
stripping1
, stripping2
, …,
strippingK
indicate characters to be stripped from the
word when applying prefix. If the stripping value is 0
,
then no stripping takes place.
prefix1
, prefix2
, …,
prefixK
specify the prefixes to use.
condition1
, condition2
, …,
conditionK
specify the optional conditions for which to
apply the prefixes prefix1
, prefix2
, …,
prefixK
, respectively. For the trivial condition, specify
"."
.
Suffixes
To define a suffix rule, use the SFX
option with the
format:
SFX flag crossProduct K
SFX flag stripping1 suffix1 condition1
...
SFX flag strippingK suffixK conditionK
where
suffix1
,
suffix2
, …,
suffixK
specify the prefixes to use, and the flag, cross
product,
K
, stripping, and condition values are the same as the
prefix format.
Example
Create a Hunspell affix file defining the following affix rules:
use the Hunspell affix
file:
PFX A Y 1
PFX A 0 re .
SFX B Y 1
SFX B 0 ed [^y]
SFX B y ied y
To use these flags in a Hunspell dictionary file, append the appropriate flags
to the words using the "/"
. For each word, you can specify
multiple flags. For example, to specify a dictionary file containing:
The words "ptest"
and "ptry"
.
For the word "ptest"
only, also include the prefix
"re"
using flag A
.
For both words, also include the suffixes "ed"
or
"ied"
where appropriate using flag
B
For more information about the options of Hunspell affix files, see https://manpages.ubuntu.com/manpages/trusty/en/man4/hunspell.4.html.
Data Types: char
| string