Home Explore Blog CI



neovim

20th chunk of `runtime/doc/spell.txt`
35eb9b06777efca13224c28010789ceae697e20cec653bf20000000100000faa
 must be there (for compatibility with Myspell).

Don't include simple one-character replacements or swaps.  Vim will try these
anyway.  You can include whole words if you want to, but you might want to use
the "file:" item in 'spellsuggest' instead.

You can include a space by using an underscore:

	REP the_the the ~


SIMILAR CHARACTERS					*spell-MAP* *E783*

In the affix file MAP items can be used to define letters that are very much
alike.  This is mostly used for a letter with different accents.  This is used
to prefer suggestions with these letters substituted.  Example:

	MAP 2 ~
	MAP eéëêè ~
	MAP uüùúû ~

The first line specifies the number of MAP lines following.  Vim ignores the
number, but the line must be there.

Each letter must appear in only one of the MAP items.  It's a bit more
efficient if the first letter is ASCII or at least one without accents.


.SUG FILE						*spell-NOSUGFILE*

When soundfolding is specified in the affix file then ":mkspell" will normally
produce a .sug file next to the .spl file.  This file is used to find
suggestions by their sound-a-like form quickly.  At the cost of a lot of
memory (the amount depends on the number of words, |:mkspell| will display an
estimate when it's done).

To avoid producing a .sug file use this item in the affix file:

	NOSUGFILE ~

Users can simply omit the .sug file if they don't want to use it.


SOUND-A-LIKE						*spell-SAL*

In the affix file SAL items can be used to define the sounds-a-like mechanism
to be used.  The main items define the "from" text and the "to" replacement.
Simplistic example:

	SAL CIA			 X ~
	SAL CH			 X ~
	SAL C			 K ~
	SAL K			 K ~

There are a few rules and this can become quite complicated.  An explanation
how it works can be found in the Aspell manual:
http://aspell.net/man-html/Phonetic-Code.html.

There are a few special items:

	SAL followup		true ~
	SAL collapse_result	true ~
	SAL remove_accents	true ~

"1" has the same meaning as "true".  Any other value means "false".


SIMPLE SOUNDFOLDING				*spell-SOFOFROM* *spell-SOFOTO*

The SAL mechanism is complex and slow.  A simpler mechanism is mapping all
characters to another character, mapping similar sounding characters to the
same character.  At the same time this does case folding.  You can not have
both SAL items and simple soundfolding.

There are two items required: one to specify the characters that are mapped
and one that specifies the characters they are mapped to.  They must have
exactly the same number of characters.  Example:

    SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ~
    SOFOTO   ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkes ~

In the example all vowels are mapped to the same character 'e'.  Another
method would be to leave out all vowels.  Some characters that sound nearly
the same and are often mixed up, such as 'm' and 'n', are mapped to the same
character.  Don't do this too much, all words will start looking alike.

Characters that do not appear in SOFOFROM will be left out, except that all
white space is replaced by one space.  Sequences of the same character in
SOFOFROM are replaced by one.

You can use the |soundfold()| function to try out the results.  Or set the
'verbose' option to see the score in the output of the |z=| command.


UNSUPPORTED ITEMS				*spell-affix-not-supported*

These items appear in the affix file of other spell checkers.  In Vim they are
ignored, not supported or defined in another way.

ACCENT		(Hunspell)				*spell-ACCENT*
		Use MAP instead. |spell-MAP|

BREAK		(Hunspell)				*spell-BREAK*
		Define break points.  Unclear how it works exactly.
		Not supported.

CHECKCOMPOUNDCASE  (Hunspell)			*spell-CHECKCOMPOUNDCASE*
		Disallow uppercase letters at compound word boundaries.
		Not supported.

CHECKCOMPOUNDDUP  (Hunspell)			*spell-CHECKCOMPOUNDDUP*
		Disallow using the same word twice in a compound.  Not
		supported.

CHECKCOMPOUNDREP  (Hunspell)			*spell-CHECKCOMPOUNDREP*
		Something about using REP items

Title: Sound-Alike Suggestions, Unsupported Affix Items and Replacements
Summary
This section covers the configuration of replacements and similar characters, as well as the creation and avoidance of .sug files for sound-alike suggestions. It describes the SAL items for defining sound-alike mechanisms, referencing the Aspell manual for detailed instructions. It also explains simple soundfolding using SOFOFROM and SOFOTO to map characters for improved sound-alike matching and details how the soundfold() function can be used. Finally, it lists unsupported affix file items from other spell checkers like ACCENT, BREAK, CHECKCOMPOUNDCASE, CHECKCOMPOUNDDUP, and CHECKCOMPOUNDREP, explaining why they are not supported or suggesting alternatives.