encountering the same
word as good.
The flag also applies to the word with affixes, thus this can be used to mark
a whole bunch of related words as bad.
*spell-FORBIDDENWORD*
FORBIDDENWORD can be used just like BAD. For compatibility with Hunspell.
*spell-NEEDAFFIX*
The NEEDAFFIX flag is used to require that a word is used with an affix. The
word itself is not a good word (unless there is an empty affix). Example:
NEEDAFFIX + ~
COMPOUND WORDS *spell-compound*
A compound word is a longer word made by concatenating words that appear in
the .dic file. To specify which words may be concatenated a character is
used. This character is put in the list of affixes after the word. We will
call this character a flag here. Obviously these flags must be different from
any affix IDs used.
*spell-COMPOUNDFLAG*
The Myspell compatible method uses one flag, specified with COMPOUNDFLAG. All
words with this flag combine in any order. This means there is no control
over which word comes first. Example:
COMPOUNDFLAG c ~
*spell-COMPOUNDRULE*
A more advanced method to specify how compound words can be formed uses
multiple items with multiple flags. This is not compatible with Myspell 3.0.
Let's start with an example:
COMPOUNDRULE c+ ~
COMPOUNDRULE se ~
The first line defines that words with the "c" flag can be concatenated in any
order. The second line defines compound words that are made of one word with
the "s" flag and one word with the "e" flag. With this dictionary:
bork/c ~
onion/s ~
soup/e ~
You can make these words:
bork
borkbork
borkborkbork
(etc.)
onion
soup
onionsoup
The COMPOUNDRULE item may appear multiple times. The argument is made out of
one or more groups, where each group can be:
one flag e.g., c
alternate flags inside [] e.g., [abc]
Optionally this may be followed by:
* the group appears zero or more times, e.g., sm*e
+ the group appears one or more times, e.g., c+
? the group appears zero times or once, e.g., x?
This is similar to the regexp pattern syntax (but not the same!). A few
examples with the sequence of word flags they require:
COMPOUNDRULE x+ x xx xxx etc.
COMPOUNDRULE yz yz
COMPOUNDRULE x+z xz xxz xxxz etc.
COMPOUNDRULE yx+ yx yxx yxxx etc.
COMPOUNDRULE xy?z xz xyz
COMPOUNDRULE [abc]z az bz cz
COMPOUNDRULE [abc]+z az aaz abaz bz baz bcbz cz caz cbaz etc.
COMPOUNDRULE a[xyz]+ ax axx axyz ay ayx ayzz az azy azxy etc.
COMPOUNDRULE sm*e se sme smme smmme etc.
COMPOUNDRULE s[xyz]*e se sxe sxye sxyxe sye syze sze szye szyxe etc.
A specific example: Allow a compound to be made of two words and a dash:
In the .aff file:
COMPOUNDRULE sde ~
NEEDAFFIX x ~
COMPOUNDWORDMAX 3 ~
COMPOUNDMIN 1 ~
In the .dic file:
start/s ~
end/e ~
-/xd ~
This allows for the word "start-end", but not "startend".
An additional implied rule is that, without further flags, a word with a
prefix cannot be compounded after another word, and a word with a suffix
cannot be compounded with a following word. Thus the affix cannot appear
on the inside of a compound word. This can be changed with the
|spell-COMPOUNDPERMITFLAG|.
*spell-NEEDCOMPOUND*
The NEEDCOMPOUND flag is used to require that a word is used as part of a
compound word. The word itself is not a good word. Example:
NEEDCOMPOUND & ~
*spell-ONLYINCOMPOUND*
The ONLYINCOMPOUND does exactly the same as NEEDCOMPOUND. Supported for
compatibility with Hunspell.
*spell-COMPOUNDMIN*
The minimal character length of a word used for compounding is specified with
COMPOUNDMIN. Example:
COMPOUNDMIN 5 ~
When omitted there is no minimal length. Obviously you could just leave out
the compound flag from short words instead, this feature is present for
compatibility with Myspell.
*spell-COMPOUNDWORDMAX*
The maximum number of words that can be concatenated into a compound word is
specified