Home Explore Blog CI



neovim

11th chunk of `runtime/doc/spell.txt`
1d50070817b46e13261d07917273831e1cf122de0a58460c0000000100000fa4
		keep-case word

Note that when "/=" is used the same word with all upper-case letters is not
accepted.  This is different from a word with mixed case that is automatically
marked as keep-case, those words may appear in all upper-case letters.


FORMAT WITH .AFF AND .DIC FILES				*aff-dic-format*

There are two files: the basic word list and an affix file.  The affix file
specifies settings for the language and can contain affixes.  The affixes are
used to modify the basic words to get the full word list.  This significantly
reduces the number of words, especially for a language like Polish.  This is
called affix compression.

The basic word list and the affix file are combined with the ":mkspell"
command and results in a binary spell file.  All the preprocessing has been
done, thus this file loads fast.  The binary spell file format is described in
the source code (src/spell.c).  But only developers need to know about it.

The preprocessing also allows us to take the Myspell language files and modify
them before the Vim word list is made.  The tools for this can be found in the
"src/spell" directory.

The format for the affix and word list files is based on what Myspell uses
(the spell checker of Mozilla and OpenOffice.org).  A description can be found
here:
	https://lingucomponent.openoffice.org/affix.readme
Note that affixes are case sensitive, this isn't obvious from the description.

Vim supports quite a few extras.  They are described below |spell-affix-vim|.
Attempts have been made to keep this compatible with other spell checkers, so
that the same files can often be used.  One other project that offers more
than Myspell is Hunspell ( https://hunspell.github.io ).


WORD LIST FORMAT				*spell-dic-format*

A short example, with line numbers:

	1	1234 ~
	2	aan ~
	3	Als ~
	4	Etten-Leur ~
	5	et al. ~
	6	's-Gravenhage ~
	7	's-Gravenhaags ~
	8	# word that differs between regions ~
	9	kado/1 ~
	10	cadeau/2 ~
	11	TCP,IP ~
	12	/the S affix may add a 's' ~
	13	bedel/S ~

The first line contains the number of words.  Vim ignores it, but you do get
an error message if it's not there.  *E760*

What follows is one word per line.  White space at the end of the line is
ignored, all other white space matters.  The encoding is specified in the
affix file |spell-SET|.

Comment lines start with '#' or '/'.  See the example lines 8 and 12.  Note
that putting a comment after a word is NOT allowed:

		someword   # comment that causes an error! ~

After the word there is an optional slash and flags.  Most of these flags are
letters that indicate the affixes that can be used with this word.  These are
specified with SFX and PFX lines in the .aff file, see |spell-SFX| and
|spell-PFX|.  Vim allows using other flag types with the FLAG item in the
affix file |spell-FLAG|.

When the word only has lower-case letters it will also match with the word
starting with an upper-case letter.

When the word includes an upper-case letter, this means the upper-case letter
is required at this position.  The same word with a lower-case letter at this
position will not match. When some of the other letters are upper-case it will
not match either.

The word with all upper-case characters will always be OK,

	word list	matches			does not match ~
	als		als Als ALS		ALs AlS aLs aLS
	Als		Als  ALS		als ALs AlS aLs aLS
	ALS		ALS			als Als ALs AlS aLs aLS
	AlS		AlS ALS			als Als ALs aLs aLS

The KEEPCASE affix ID can be used to specifically match a word with identical
case only, see below |spell-KEEPCASE|.

Note: in line 5 to 7 non-word characters are used.  You can include any
character in a word.  When checking the text a word still only matches when it
appears with a non-word character before and after it.  For Myspell a word
starting with a non-word character probably won't work.

In line 12 the word "TCP/IP" is defined.  Since the slash has a special
meaning the comma is used instead.  This is defined with the SLASH item in the
affix file, see |spell-SLASH|.  Note that

Title: Affix/Dictionary Files Format, Word List and Case Matching Rules
Summary
This section elaborates on the format and structure of affix (`.aff`) and dictionary (`.dic`) files, used for spell checking and affix compression. It details how to combine these files with the `:mkspell` command to create a binary spell file. The explanation extends to the word list format, including the initial word count, comments, and optional flags after each word, which indicate affixes applicable to the word. It highlights case-matching rules, where words with only lowercase letters match regardless of capitalization, while those with uppercase letters require the same capitalization. Special handling for non-word characters and the use of a comma as a separator are also covered. Links to external resources, compatibility with other spell checkers like Hunspell, and the availability of tools for modifying language files are mentioned.