Milly | 89872f5 | 2024-10-05 17:16:18 +0200 | [diff] [blame] | 1 | *spell.txt* For Vim version 9.1. Last change: 2024 Oct 05 |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 2 | |
| 3 | |
| 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
| 5 | |
| 6 | |
| 7 | Spell checking *spell* |
| 8 | |
| 9 | 1. Quick start |spell-quickstart| |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 10 | 2. Remarks on spell checking |spell-remarks| |
| 11 | 3. Generating a spell file |spell-mkspell| |
| 12 | 4. Spell file format |spell-file-format| |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 13 | |
Bram Moolenaar | 25c9c68 | 2019-05-05 18:13:34 +0200 | [diff] [blame] | 14 | {not available when the |+syntax| feature has been disabled at compile time} |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 15 | |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 16 | Note: There also is a vimspell plugin. If you have it you can do ":help |
| 17 | vimspell" to find about it. But you will probably want to get rid of the |
| 18 | plugin and use the 'spell' option instead, it works better. |
| 19 | |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 20 | ============================================================================== |
Bram Moolenaar | c1a11ed | 2008-06-24 22:09:24 +0000 | [diff] [blame] | 21 | 1. Quick start *spell-quickstart* *E756* |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 22 | |
| 23 | This command switches on spell checking: > |
| 24 | |
| 25 | :setlocal spell spelllang=en_us |
| 26 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 27 | This switches on the 'spell' option and specifies to check for US English. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 28 | |
| 29 | The words that are not recognized are highlighted with one of these: |
Bram Moolenaar | 520470a | 2005-06-16 21:59:56 +0000 | [diff] [blame] | 30 | SpellBad word not recognized |hl-SpellBad| |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 31 | SpellCap word not capitalised |hl-SpellCap| |
Bram Moolenaar | 520470a | 2005-06-16 21:59:56 +0000 | [diff] [blame] | 32 | SpellRare rare word |hl-SpellRare| |
| 33 | SpellLocal wrong spelling for selected region |hl-SpellLocal| |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 34 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 35 | Vim only checks words for spelling, there is no grammar check. |
| 36 | |
Bram Moolenaar | 4536002 | 2005-07-21 21:08:21 +0000 | [diff] [blame] | 37 | If the 'mousemodel' option is set to "popup" and the cursor is on a badly |
| 38 | spelled word or it is "popup_setpos" and the mouse pointer is on a badly |
Bram Moolenaar | 16d8f87 | 2005-11-26 23:46:11 +0000 | [diff] [blame] | 39 | spelled word, then the popup menu will contain a submenu to replace the bad |
Bram Moolenaar | f9393ef | 2006-04-24 19:47:27 +0000 | [diff] [blame] | 40 | word. Note: this slows down the appearance of the popup menu. Note for GTK: |
| 41 | don't release the right mouse button until the menu appears, otherwise it |
| 42 | won't work. |
Bram Moolenaar | 4536002 | 2005-07-21 21:08:21 +0000 | [diff] [blame] | 43 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 44 | To search for the next misspelled word: |
| 45 | |
Bram Moolenaar | c1a11ed | 2008-06-24 22:09:24 +0000 | [diff] [blame] | 46 | *]s* |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 47 | ]s Move to next misspelled word after the cursor. |
Bram Moolenaar | 9d0ec2e | 2005-04-20 19:45:58 +0000 | [diff] [blame] | 48 | A count before the command can be used to repeat. |
Bram Moolenaar | ac6e65f | 2005-08-29 22:25:38 +0000 | [diff] [blame] | 49 | 'wrapscan' applies. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 50 | |
| 51 | *[s* |
Bram Moolenaar | 9d0ec2e | 2005-04-20 19:45:58 +0000 | [diff] [blame] | 52 | [s Like "]s" but search backwards, find the misspelled |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 53 | word before the cursor. Doesn't recognize words |
| 54 | split over two lines, thus may stop at words that are |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 55 | not highlighted as bad. Does not stop at word with |
| 56 | missing capital at the start of a line. |
Bram Moolenaar | 9d0ec2e | 2005-04-20 19:45:58 +0000 | [diff] [blame] | 57 | |
| 58 | *]S* |
| 59 | ]S Like "]s" but only stop at bad words, not at rare |
| 60 | words or words for another region. |
| 61 | |
| 62 | *[S* |
| 63 | [S Like "]S" but search backwards. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 64 | |
Christ van Willegen - van Noort | 8e4c4c7 | 2024-05-17 18:49:27 +0200 | [diff] [blame] | 65 | *]r* |
| 66 | ]r Move to next "rare" word after the cursor. |
| 67 | A count before the command can be used to repeat. |
| 68 | 'wrapscan' applies. |
| 69 | |
| 70 | *[r* |
| 71 | [r Like "]r" but search backwards, find the "rare" |
| 72 | word before the cursor. Doesn't recognize words |
| 73 | split over two lines, thus may stop at words that are |
| 74 | not highlighted as rare. |
| 75 | |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 76 | |
Bram Moolenaar | f75a963 | 2005-09-13 21:20:47 +0000 | [diff] [blame] | 77 | To add words to your own word list: |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 78 | |
| 79 | *zg* |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 80 | zg Add word under the cursor as a good word to the first |
Bram Moolenaar | da2303d | 2005-08-30 21:55:26 +0000 | [diff] [blame] | 81 | name in 'spellfile'. A count may precede the command |
| 82 | to indicate the entry in 'spellfile' to be used. A |
| 83 | count of two uses the second entry. |
| 84 | |
| 85 | In Visual mode the selected characters are added as a |
| 86 | word (including white space!). |
| 87 | When the cursor is on text that is marked as badly |
| 88 | spelled then the marked text is used. |
| 89 | Otherwise the word under the cursor, separated by |
| 90 | non-word characters, is used. |
| 91 | |
| 92 | If the word is explicitly marked as bad word in |
| 93 | another spell file the result is unpredictable. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 94 | |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 95 | *zG* |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 96 | zG Like "zg" but add the word to the internal word list |
| 97 | |internal-wordlist|. |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 98 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 99 | *zw* |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 100 | zw Like "zg" but mark the word as a wrong (bad) word. |
Bram Moolenaar | 87b5ca5 | 2006-03-04 21:55:31 +0000 | [diff] [blame] | 101 | If the word already appears in 'spellfile' it is |
| 102 | turned into a comment line. See |spellfile-cleanup| |
| 103 | for getting rid of those. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 104 | |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 105 | *zW* |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 106 | zW Like "zw" but add the word to the internal word list |
| 107 | |internal-wordlist|. |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 108 | |
Bram Moolenaar | 87b5ca5 | 2006-03-04 21:55:31 +0000 | [diff] [blame] | 109 | zuw *zug* *zuw* |
| 110 | zug Undo |zw| and |zg|, remove the word from the entry in |
| 111 | 'spellfile'. Count used as with |zg|. |
| 112 | |
| 113 | zuW *zuG* *zuW* |
| 114 | zuG Undo |zW| and |zG|, remove the word from the internal |
| 115 | word list. Count used as with |zg|. |
| 116 | |
Bram Moolenaar | 2ecbe53 | 2022-07-29 21:36:21 +0100 | [diff] [blame] | 117 | *:spe* *:spellgood* *E1280* |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 118 | :[count]spe[llgood] {word} |
Bram Moolenaar | 53180ce | 2005-07-05 21:48:14 +0000 | [diff] [blame] | 119 | Add {word} as a good word to 'spellfile', like with |
Bram Moolenaar | 87b5ca5 | 2006-03-04 21:55:31 +0000 | [diff] [blame] | 120 | |zg|. Without count the first name is used, with a |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 121 | count of two the second entry, etc. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 122 | |
Bram Moolenaar | 53180ce | 2005-07-05 21:48:14 +0000 | [diff] [blame] | 123 | :spe[llgood]! {word} Add {word} as a good word to the internal word list, |
Bram Moolenaar | 87b5ca5 | 2006-03-04 21:55:31 +0000 | [diff] [blame] | 124 | like with |zG|. |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 125 | |
Bram Moolenaar | 520470a | 2005-06-16 21:59:56 +0000 | [diff] [blame] | 126 | *:spellw* *:spellwrong* |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 127 | :[count]spellw[rong] {word} |
Bram Moolenaar | 53180ce | 2005-07-05 21:48:14 +0000 | [diff] [blame] | 128 | Add {word} as a wrong (bad) word to 'spellfile', as |
Bram Moolenaar | 87b5ca5 | 2006-03-04 21:55:31 +0000 | [diff] [blame] | 129 | with |zw|. Without count the first name is used, with |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 130 | a count of two the second entry, etc. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 131 | |
Bram Moolenaar | 53180ce | 2005-07-05 21:48:14 +0000 | [diff] [blame] | 132 | :spellw[rong]! {word} Add {word} as a wrong (bad) word to the internal word |
Bram Moolenaar | 87b5ca5 | 2006-03-04 21:55:31 +0000 | [diff] [blame] | 133 | list, like with |zW|. |
| 134 | |
Bram Moolenaar | a389168 | 2019-08-16 22:42:13 +0200 | [diff] [blame] | 135 | *:spellra* *:spellrare* |
Bram Moolenaar | 10e8ff9 | 2023-06-10 21:40:39 +0100 | [diff] [blame] | 136 | :[count]spellra[re] {word} |
Bram Moolenaar | 08cc374 | 2019-08-11 22:51:14 +0200 | [diff] [blame] | 137 | Add {word} as a rare word to 'spellfile', similar to |
| 138 | |zw|. Without count the first name is used, with |
| 139 | a count of two the second entry, etc. |
| 140 | |
| 141 | There are no normal mode commands to mark words as |
| 142 | rare as this is a fairly uncommon command and all |
| 143 | intuitive commands for this are already taken. If you |
| 144 | want you can add mappings with e.g.: > |
Bram Moolenaar | c51cf03 | 2022-02-26 12:25:45 +0000 | [diff] [blame] | 145 | nnoremap z? :exe ':spellrare ' .. expand('<cWORD>')<CR> |
| 146 | nnoremap z/ :exe ':spellrare! ' .. expand('<cWORD>')<CR> |
Bram Moolenaar | 08cc374 | 2019-08-11 22:51:14 +0200 | [diff] [blame] | 147 | < |:spellundo|, |zuw|, or |zuW| can be used to undo this. |
| 148 | |
Bram Moolenaar | 10e8ff9 | 2023-06-10 21:40:39 +0100 | [diff] [blame] | 149 | :spellra[re]! {word} Add {word} as a rare word to the internal word |
Bram Moolenaar | 08cc374 | 2019-08-11 22:51:14 +0200 | [diff] [blame] | 150 | list, similar to |zW|. |
| 151 | |
Bram Moolenaar | 87b5ca5 | 2006-03-04 21:55:31 +0000 | [diff] [blame] | 152 | :[count]spellu[ndo] {word} *:spellu* *:spellundo* |
| 153 | Like |zuw|. [count] used as with |:spellgood|. |
| 154 | |
| 155 | :spellu[ndo]! {word} Like |zuW|. [count] used as with |:spellgood|. |
| 156 | |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 157 | |
Bram Moolenaar | f461c8e | 2005-06-25 23:04:51 +0000 | [diff] [blame] | 158 | After adding a word to 'spellfile' with the above commands its associated |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 159 | ".spl" file will automatically be updated and reloaded. If you change |
| 160 | 'spellfile' manually you need to use the |:mkspell| command. This sequence of |
| 161 | commands mostly works well: > |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 162 | :edit <file in 'spellfile'> |
Bram Moolenaar | f461c8e | 2005-06-25 23:04:51 +0000 | [diff] [blame] | 163 | < (make changes to the spell file) > |
| 164 | :mkspell! % |
| 165 | |
| 166 | More details about the 'spellfile' format below |spell-wordlist-format|. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 167 | |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 168 | *internal-wordlist* |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 169 | The internal word list is used for all buffers where 'spell' is set. It is |
| 170 | not stored, it is lost when you exit Vim. It is also cleared when 'encoding' |
| 171 | is set. |
| 172 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 173 | |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 174 | Finding suggestions for bad words: |
Bram Moolenaar | cc016f5 | 2005-12-10 20:23:46 +0000 | [diff] [blame] | 175 | *z=* |
| 176 | z= For the word under/after the cursor suggest correctly |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 177 | spelled words. This also works to find alternatives |
| 178 | for a word that is not highlighted as a bad word, |
| 179 | e.g., when the word after it is bad. |
Bram Moolenaar | 7df351e | 2006-01-23 22:30:28 +0000 | [diff] [blame] | 180 | In Visual mode the highlighted text is taken as the |
| 181 | word to be replaced. |
| 182 | The results are sorted on similarity to the word being |
| 183 | replaced. |
Bram Moolenaar | 90915b5 | 2005-08-21 22:17:52 +0000 | [diff] [blame] | 184 | This may take a long time. Hit CTRL-C when you get |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 185 | bored. |
Bram Moolenaar | 90915b5 | 2005-08-21 22:17:52 +0000 | [diff] [blame] | 186 | |
| 187 | If the command is used without a count the |
| 188 | alternatives are listed and you can enter the number |
| 189 | of your choice or press <Enter> if you don't want to |
| 190 | replace. You can also use the mouse to click on your |
| 191 | choice (only works if the mouse can be used in Normal |
| 192 | mode and when there are no line wraps). Click on the |
| 193 | first line (the header) to cancel. |
| 194 | |
Bram Moolenaar | fc1421e | 2006-04-20 22:17:20 +0000 | [diff] [blame] | 195 | The suggestions listed normally replace a highlighted |
| 196 | bad word. Sometimes they include other text, in that |
| 197 | case the replaced text is also listed after a "<". |
| 198 | |
Bram Moolenaar | 90915b5 | 2005-08-21 22:17:52 +0000 | [diff] [blame] | 199 | If a count is used that suggestion is used, without |
Bram Moolenaar | cc016f5 | 2005-12-10 20:23:46 +0000 | [diff] [blame] | 200 | prompting. For example, "1z=" always takes the first |
Bram Moolenaar | 90915b5 | 2005-08-21 22:17:52 +0000 | [diff] [blame] | 201 | suggestion. |
| 202 | |
| 203 | If 'verbose' is non-zero a score will be displayed |
| 204 | with the suggestions to indicate the likeliness to the |
| 205 | badly spelled word (the higher the score the more |
| 206 | different). |
Bram Moolenaar | d857f0e | 2005-06-21 22:37:39 +0000 | [diff] [blame] | 207 | When a word was replaced the redo command "." will |
| 208 | repeat the word replacement. This works like "ciw", |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 209 | the good word and <Esc>. This does NOT work for Thai |
| 210 | and other languages without spaces between words. |
Bram Moolenaar | d857f0e | 2005-06-21 22:37:39 +0000 | [diff] [blame] | 211 | |
Bram Moolenaar | 24bbcfe | 2005-06-28 23:32:02 +0000 | [diff] [blame] | 212 | *:spellr* *:spellrepall* *E752* *E753* |
Bram Moolenaar | cc016f5 | 2005-12-10 20:23:46 +0000 | [diff] [blame] | 213 | :spellr[epall] Repeat the replacement done by |z=| for all matches |
Bram Moolenaar | 24bbcfe | 2005-06-28 23:32:02 +0000 | [diff] [blame] | 214 | with the replaced word in the current window. |
| 215 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 216 | In Insert mode, when the cursor is after a badly spelled word, you can use |
| 217 | CTRL-X s to find suggestions. This works like Insert mode completion. Use |
| 218 | CTRL-N to use the next suggestion, CTRL-P to go back. |i_CTRL-X_s| |
| 219 | |
Bram Moolenaar | d857f0e | 2005-06-21 22:37:39 +0000 | [diff] [blame] | 220 | The 'spellsuggest' option influences how the list of suggestions is generated |
| 221 | and sorted. See |'spellsuggest'|. |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 222 | |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 223 | The 'spellcapcheck' option is used to check the first word of a sentence |
| 224 | starts with a capital. This doesn't work for the first word in the file. |
| 225 | When there is a line break right after a sentence the highlighting of the next |
Bram Moolenaar | 90cfdbe | 2005-08-12 19:59:19 +0000 | [diff] [blame] | 226 | line may be postponed. Use |CTRL-L| when needed. Also see |set-spc-auto| for |
| 227 | how it can be set automatically when 'spelllang' is set. |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 228 | |
Bram Moolenaar | 362b44b | 2020-06-10 21:47:00 +0200 | [diff] [blame] | 229 | The 'spelloptions' option has a few more flags that influence the way spell |
Bram Moolenaar | 71badf9 | 2023-04-22 22:40:14 +0100 | [diff] [blame] | 230 | checking works. For example, "camel" splits CamelCased words so that each |
| 231 | part of the word is spell-checked separately. |
Bram Moolenaar | 362b44b | 2020-06-10 21:47:00 +0200 | [diff] [blame] | 232 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 233 | Vim counts the number of times a good word is encountered. This is used to |
| 234 | sort the suggestions: words that have been seen before get a small bonus, |
| 235 | words that have been seen often get a bigger bonus. The COMMON item in the |
| 236 | affix file can be used to define common words, so that this mechanism also |
| 237 | works in a new or short file |spell-COMMON|. |
| 238 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 239 | ============================================================================== |
| 240 | 2. Remarks on spell checking *spell-remarks* |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 241 | |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 242 | PERFORMANCE |
| 243 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 244 | Vim does on-the-fly spell checking. To make this work fast the word list is |
| 245 | loaded in memory. Thus this uses a lot of memory (1 Mbyte or more). There |
| 246 | might also be a noticeable delay when the word list is loaded, which happens |
| 247 | when 'spell' is set and when 'spelllang' is set while 'spell' was already set. |
| 248 | To minimize the delay each word list is only loaded once, it is not deleted |
| 249 | when 'spelllang' is made empty or 'spell' is reset. When 'encoding' is set |
| 250 | all the word lists are reloaded, thus you may notice a delay then too. |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 251 | |
| 252 | |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 253 | REGIONS |
| 254 | |
| 255 | A word may be spelled differently in various regions. For example, English |
| 256 | comes in (at least) these variants: |
| 257 | |
| 258 | en all regions |
Bram Moolenaar | 5c5474b | 2005-04-19 21:40:26 +0000 | [diff] [blame] | 259 | en_au Australia |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 260 | en_ca Canada |
Bram Moolenaar | 5c5474b | 2005-04-19 21:40:26 +0000 | [diff] [blame] | 261 | en_gb Great Britain |
| 262 | en_nz New Zealand |
| 263 | en_us USA |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 264 | |
| 265 | Words that are not used in one region but are used in another region are |
Bram Moolenaar | 520470a | 2005-06-16 21:59:56 +0000 | [diff] [blame] | 266 | highlighted with SpellLocal |hl-SpellLocal|. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 267 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 268 | Always use lowercase letters for the language and region names. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 269 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 270 | When adding a word with |zg| or another command it's always added for all |
| 271 | regions. You can change that by manually editing the 'spellfile'. See |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 272 | |spell-wordlist-format|. Note that the regions as specified in the files in |
Bram Moolenaar | 16d8f87 | 2005-11-26 23:46:11 +0000 | [diff] [blame] | 273 | 'spellfile' are only used when all entries in 'spelllang' specify the same |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 274 | region (not counting files specified by their .spl name). |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 275 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 276 | *spell-german* |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 277 | Specific exception: For German these special regions are used: |
| 278 | de all German words accepted |
| 279 | de_de old and new spelling |
| 280 | de_19 old spelling |
| 281 | de_20 new spelling |
| 282 | de_at Austria |
| 283 | de_ch Switzerland |
| 284 | |
Bram Moolenaar | 92d640f | 2005-09-05 22:11:52 +0000 | [diff] [blame] | 285 | *spell-russian* |
| 286 | Specific exception: For Russian these special regions are used: |
| 287 | ru all Russian words accepted |
| 288 | ru_ru "IE" letter spelling |
| 289 | ru_yo "YO" letter spelling |
| 290 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 291 | *spell-yiddish* |
| 292 | Yiddish requires using "utf-8" encoding, because of the special characters |
| 293 | used. If you are using latin1 Vim will use transliterated (romanized) Yiddish |
| 294 | instead. If you want to use transliterated Yiddish with utf-8 use "yi-tr". |
| 295 | In a table: |
| 296 | 'encoding' 'spelllang' |
| 297 | utf-8 yi Yiddish |
| 298 | latin1 yi transliterated Yiddish |
| 299 | utf-8 yi-tr transliterated Yiddish |
| 300 | |
Bram Moolenaar | cc63c64 | 2013-11-12 04:44:01 +0100 | [diff] [blame] | 301 | *spell-cjk* |
| 302 | Chinese, Japanese and other East Asian characters are normally marked as |
| 303 | errors, because spell checking of these characters is not supported. If |
| 304 | 'spelllang' includes "cjk", these characters are not marked as errors. This |
| 305 | is useful when editing text with spell checking while some Asian words are |
| 306 | present. |
| 307 | |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 308 | |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 309 | SPELL FILES *spell-load* |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 310 | |
| 311 | Vim searches for spell files in the "spell" subdirectory of the directories in |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 312 | 'runtimepath'. The name is: LL.EEE.spl, where: |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 313 | LL the language name |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 314 | EEE the value of 'encoding' |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 315 | |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 316 | The value for "LL" comes from 'spelllang', but excludes the region name. |
| 317 | Examples: |
| 318 | 'spelllang' LL ~ |
| 319 | en_us en |
| 320 | en-rare en-rare |
| 321 | medical_ca medical |
| 322 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 323 | Only the first file is loaded, the one that is first in 'runtimepath'. If |
| 324 | this succeeds then additionally files with the name LL.EEE.add.spl are loaded. |
| 325 | All the ones that are found are used. |
| 326 | |
Bram Moolenaar | 1ef15e3 | 2006-02-01 21:56:25 +0000 | [diff] [blame] | 327 | If no spell file is found the |SpellFileMissing| autocommand event is |
| 328 | triggered. This may trigger the |spellfile.vim| plugin to offer you |
| 329 | downloading the spell file. |
| 330 | |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 331 | Additionally, the files related to the names in 'spellfile' are loaded. These |
| 332 | are the files that |zg| and |zw| add good and wrong words to. |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 333 | |
Bram Moolenaar | 0e21a3f | 2005-04-17 20:28:32 +0000 | [diff] [blame] | 334 | Exceptions: |
| 335 | - Vim uses "latin1" when 'encoding' is "iso-8859-15". The euro sign doesn't |
| 336 | matter for spelling. |
| 337 | - When no spell file for 'encoding' is found "ascii" is tried. This only |
| 338 | works for languages where nearly all words are ASCII, such as English. It |
| 339 | helps when 'encoding' is not "latin1", such as iso-8859-2, and English text |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 340 | is being edited. For the ".add" files the same name as the found main |
| 341 | spell file is used. |
| 342 | |
| 343 | For example, with these values: |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 344 | 'runtimepath' is "~/.vim,/usr/share/vim82,~/.vim/after" |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 345 | 'encoding' is "iso-8859-2" |
| 346 | 'spelllang' is "pl" |
| 347 | |
| 348 | Vim will look for: |
| 349 | 1. ~/.vim/spell/pl.iso-8859-2.spl |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 350 | 2. /usr/share/vim82/spell/pl.iso-8859-2.spl |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 351 | 3. ~/.vim/spell/pl.iso-8859-2.add.spl |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 352 | 4. /usr/share/vim82/spell/pl.iso-8859-2.add.spl |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 353 | 5. ~/.vim/after/spell/pl.iso-8859-2.add.spl |
| 354 | |
| 355 | This assumes 1. is not found and 2. is found. |
| 356 | |
| 357 | If 'encoding' is "latin1" Vim will look for: |
| 358 | 1. ~/.vim/spell/pl.latin1.spl |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 359 | 2. /usr/share/vim82/spell/pl.latin1.spl |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 360 | 3. ~/.vim/after/spell/pl.latin1.spl |
| 361 | 4. ~/.vim/spell/pl.ascii.spl |
Bram Moolenaar | 8024f93 | 2020-01-14 19:29:13 +0100 | [diff] [blame] | 362 | 5. /usr/share/vim82/spell/pl.ascii.spl |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 363 | 6. ~/.vim/after/spell/pl.ascii.spl |
| 364 | |
| 365 | This assumes none of them are found (Polish doesn't make sense when leaving |
| 366 | out the non-ASCII characters). |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 367 | |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 368 | Spelling for EBCDIC is currently not supported. |
| 369 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 370 | A spell file might not be available in the current 'encoding'. See |
| 371 | |spell-mkspell| about how to create a spell file. Converting a spell file |
Bram Moolenaar | 0e21a3f | 2005-04-17 20:28:32 +0000 | [diff] [blame] | 372 | with "iconv" will NOT work! |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 373 | |
Bram Moolenaar | 81af925 | 2010-12-10 20:35:50 +0100 | [diff] [blame] | 374 | Note: on VMS ".{enc}.spl" is changed to "_{enc}.spl" to avoid trouble with |
| 375 | filenames. |
| 376 | |
Bram Moolenaar | a40ceaf | 2006-01-13 22:35:40 +0000 | [diff] [blame] | 377 | *spell-sug-file* *E781* |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 378 | If there is a file with exactly the same name as the ".spl" file but ending in |
| 379 | ".sug", that file will be used for giving better suggestions. It isn't loaded |
| 380 | before suggestions are made to reduce memory use. |
| 381 | |
Bram Moolenaar | a40ceaf | 2006-01-13 22:35:40 +0000 | [diff] [blame] | 382 | *E758* *E759* *E778* *E779* *E780* *E782* |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 383 | When loading a spell file Vim checks that it is properly formatted. If you |
Bram Moolenaar | 0e21a3f | 2005-04-17 20:28:32 +0000 | [diff] [blame] | 384 | get an error the file may be truncated, modified or intended for another Vim |
| 385 | version. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 386 | |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 387 | |
Bram Moolenaar | 87b5ca5 | 2006-03-04 21:55:31 +0000 | [diff] [blame] | 388 | SPELLFILE CLEANUP *spellfile-cleanup* |
| 389 | |
| 390 | The |zw| command turns existing entries in 'spellfile' into comment lines. |
| 391 | This avoids having to write a new file every time, but results in the file |
| 392 | only getting longer, never shorter. To clean up the comment lines in all |
| 393 | ".add" spell files do this: > |
| 394 | :runtime spell/cleanadd.vim |
| 395 | |
| 396 | This deletes all comment lines, except the ones that start with "##". Use |
| 397 | "##" lines to add comments that you want to keep. |
| 398 | |
| 399 | You can invoke this script as often as you like. A variable is provided to |
| 400 | skip updating files that have been changed recently. Set it to the number of |
| 401 | seconds that has passed since a file was changed before it will be cleaned. |
| 402 | For example, to clean only files that were not changed in the last hour: > |
| 403 | let g:spell_clean_limit = 60 * 60 |
| 404 | The default is one second. |
| 405 | |
| 406 | |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 407 | WORDS |
| 408 | |
| 409 | Vim uses a fixed method to recognize a word. This is independent of |
| 410 | 'iskeyword', so that it also works in help files and for languages that |
| 411 | include characters like '-' in 'iskeyword'. The word characters do depend on |
| 412 | 'encoding'. |
| 413 | |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 414 | The table with word characters is stored in the main .spl file. Therefore it |
| 415 | matters what the current locale is when generating it! A .add.spl file does |
Bram Moolenaar | f461c8e | 2005-06-25 23:04:51 +0000 | [diff] [blame] | 416 | not contain a word table though. |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 417 | |
Bram Moolenaar | f9393ef | 2006-04-24 19:47:27 +0000 | [diff] [blame] | 418 | For a word that starts with a digit the digit is ignored, unless the word as a |
| 419 | whole is recognized. Thus if "3D" is a word and "D" is not then "3D" is |
| 420 | recognized as a word, but if "3D" is not a word then only the "D" is marked as |
| 421 | bad. Hex numbers in the form 0x12ab and 0X12AB are recognized. |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 422 | |
| 423 | |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 424 | WORD COMBINATIONS |
| 425 | |
| 426 | It is possible to spell-check words that include a space. This is used to |
| 427 | recognize words that are invalid when used by themselves, e.g. for "et al.". |
| 428 | It can also be used to recognize "the the" and highlight it. |
| 429 | |
| 430 | The number of spaces is irrelevant. In most cases a line break may also |
| 431 | appear. However, this makes it difficult to find out where to start checking |
| 432 | for spelling mistakes. When you make a change to one line and only that line |
| 433 | is redrawn Vim won't look in the previous line, thus when "et" is at the end |
| 434 | of the previous line "al." will be flagged as an error. And when you type |
| 435 | "the<CR>the" the highlighting doesn't appear until the first line is redrawn. |
| 436 | Use |CTRL-L| to redraw right away. "[s" will also stop at a word combination |
| 437 | with a line break. |
| 438 | |
| 439 | When encountering a line break Vim skips characters such as '*', '>' and '"', |
| 440 | so that comments in C, shell and Vim code can be spell checked. |
| 441 | |
| 442 | |
Bram Moolenaar | 9d0ec2e | 2005-04-20 19:45:58 +0000 | [diff] [blame] | 443 | SYNTAX HIGHLIGHTING *spell-syntax* |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 444 | |
| 445 | Files that use syntax highlighting can specify where spell checking should be |
| 446 | done: |
| 447 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 448 | 1. everywhere default |
| 449 | 2. in specific items use "contains=@Spell" |
| 450 | 3. everywhere but specific items use "contains=@NoSpell" |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 451 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 452 | For the second method adding the @NoSpell cluster will disable spell checking |
| 453 | again. This can be used, for example, to add @Spell to the comments of a |
| 454 | program, and add @NoSpell for items that shouldn't be checked. |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 455 | Also see |:syn-spell| for text that is not in a syntax item. |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 456 | |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 457 | |
| 458 | VIM SCRIPTS |
| 459 | |
| 460 | If you want to write a Vim script that does something with spelling, you may |
| 461 | find these functions useful: |
| 462 | |
| 463 | spellbadword() find badly spelled word at the cursor |
| 464 | spellsuggest() get list of spelling suggestions |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 465 | soundfold() get the sound-a-like version of a word |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 466 | |
Bram Moolenaar | 90cfdbe | 2005-08-12 19:59:19 +0000 | [diff] [blame] | 467 | |
| 468 | SETTING 'spellcapcheck' AUTOMATICALLY *set-spc-auto* |
| 469 | |
| 470 | After the 'spelllang' option has been set successfully, Vim will source the |
| 471 | files "spell/LANG.vim" in 'runtimepath'. "LANG" is the value of 'spelllang' |
| 472 | up to the first comma, dot or underscore. This can be used to set options |
| 473 | specifically for the language, especially 'spellcapcheck'. |
| 474 | |
| 475 | The distribution includes a few of these files. Use this command to see what |
| 476 | they do: > |
| 477 | :next $VIMRUNTIME/spell/*.vim |
| 478 | |
| 479 | Note that the default scripts don't set 'spellcapcheck' if it was changed from |
| 480 | the default value. This assumes the user prefers another value then. |
| 481 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 482 | |
| 483 | DOUBLE SCORING *spell-double-scoring* |
| 484 | |
| 485 | The 'spellsuggest' option can be used to select "double" scoring. This |
| 486 | mechanism is based on the principle that there are two kinds of spelling |
| 487 | mistakes: |
| 488 | |
| 489 | 1. You know how to spell the word, but mistype something. This results in a |
| 490 | small editing distance (character swapped/omitted/inserted) and possibly a |
| 491 | word that sounds completely different. |
| 492 | |
| 493 | 2. You don't know how to spell the word and type something that sounds right. |
| 494 | The edit distance can be big but the word is similar after sound-folding. |
| 495 | |
| 496 | Since scores for these two mistakes will be very different we use a list |
| 497 | for each and mix them. |
| 498 | |
| 499 | The sound-folding is slow and people that know the language won't make the |
| 500 | second kind of mistakes. Therefore 'spellsuggest' can be set to select the |
| 501 | preferred method for scoring the suggestions. |
| 502 | |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 503 | ============================================================================== |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 504 | 3. Generating a spell file *spell-mkspell* |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 505 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 506 | Vim uses a binary file format for spelling. This greatly speeds up loading |
| 507 | the word list and keeps it small. |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 508 | *.aff* *.dic* *Myspell* |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 509 | You can create a Vim spell file from the .aff and .dic files that Myspell |
Bram Moolenaar | 6aa8cea | 2017-06-05 14:44:35 +0200 | [diff] [blame] | 510 | uses. Myspell is used by OpenOffice.org and Mozilla. The OpenOffice .oxt |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 511 | files are zip files which contain the .aff and .dic files. You should be able |
| 512 | to find them here: |
| 513 | http://extensions.services.openoffice.org/dictionary |
| 514 | The older, OpenOffice 2 files may be used if this doesn't work: |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 515 | http://wiki.services.openoffice.org/wiki/Dictionaries |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 516 | You can also use a plain word list. The results are the same, the choice |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 517 | depends on what word lists you can find. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 518 | |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 519 | If you install Aap (from www.a-a-p.org) you can use the recipes in the |
| 520 | runtime/spell/??/ directories. Aap will take care of downloading the files, |
| 521 | apply patches needed for Vim and build the .spl file. |
| 522 | |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 523 | Make sure your current locale is set properly, otherwise Vim doesn't know what |
| 524 | characters are upper/lower case letters. If the locale isn't available (e.g., |
| 525 | when using an MS-Windows codepage on Unix) add tables to the .aff file |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 526 | |spell-affix-chars|. If the .aff file doesn't define a table then the word |
| 527 | table of the currently active spelling is used. If spelling is not active |
| 528 | then Vim will try to guess. |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 529 | |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 530 | *:mksp* *:mkspell* |
| 531 | :mksp[ell][!] [-ascii] {outname} {inname} ... |
Bram Moolenaar | 16d8f87 | 2005-11-26 23:46:11 +0000 | [diff] [blame] | 532 | Generate a Vim spell file from word lists. Example: > |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 533 | :mkspell /tmp/nl nl_NL.words |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 534 | < *E751* |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 535 | When {outname} ends in ".spl" it is used as the output |
| 536 | file name. Otherwise it should be a language name, |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 537 | such as "en", without the region name. The file |
| 538 | written will be "{outname}.{encoding}.spl", where |
| 539 | {encoding} is the value of the 'encoding' option. |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 540 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 541 | When the output file already exists [!] must be used |
Bram Moolenaar | 520470a | 2005-06-16 21:59:56 +0000 | [diff] [blame] | 542 | to overwrite it. |
| 543 | |
Bram Moolenaar | 0e21a3f | 2005-04-17 20:28:32 +0000 | [diff] [blame] | 544 | When the [-ascii] argument is present, words with |
| 545 | non-ascii characters are skipped. The resulting file |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 546 | ends in "ascii.spl". |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 547 | |
| 548 | The input can be the Myspell format files {inname}.aff |
| 549 | and {inname}.dic. If {inname}.aff does not exist then |
| 550 | {inname} is used as the file name of a plain word |
| 551 | list. |
| 552 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 553 | Multiple {inname} arguments can be given to combine |
| 554 | regions into one Vim spell file. Example: > |
| 555 | :mkspell ~/.vim/spell/en /tmp/en_US /tmp/en_CA /tmp/en_AU |
| 556 | < This combines the English word lists for US, CA and AU |
| 557 | into one en.spl file. |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 558 | Up to eight regions can be combined. *E754* *E755* |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 559 | The REP and SAL items of the first .aff file where |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 560 | they appear are used. |spell-REP| |spell-SAL| |
Bram Moolenaar | d58e929 | 2011-02-09 17:07:58 +0100 | [diff] [blame] | 561 | *E845* |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 562 | This command uses a lot of memory, required to find |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 563 | the optimal word tree (Polish, Italian and Hungarian |
| 564 | require several hundred Mbyte). The final result will |
| 565 | be much smaller, because compression is used. To |
| 566 | avoid running out of memory compression will be done |
| 567 | now and then. This can be tuned with the 'mkspellmem' |
| 568 | option. |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 569 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 570 | After the spell file was written and it was being used |
| 571 | in a buffer it will be reloaded automatically. |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 572 | |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 573 | :mksp[ell] [-ascii] {name}.{enc}.add |
| 574 | Like ":mkspell" above, using {name}.{enc}.add as the |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 575 | input file and producing an output file in the same |
| 576 | directory that has ".spl" appended. |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 577 | |
| 578 | :mksp[ell] [-ascii] {name} |
| 579 | Like ":mkspell" above, using {name} as the input file |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 580 | and producing an output file in the same directory |
| 581 | that has ".{enc}.spl" appended. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 582 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 583 | Vim will report the number of duplicate words. This might be a mistake in the |
| 584 | list of words. But sometimes it is used to have different prefixes and |
| 585 | suffixes for the same basic word to avoid them combining (e.g. Czech uses |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 586 | this). If you want Vim to report all duplicate words set the 'verbose' |
| 587 | option. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 588 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 589 | Since you might want to change a Myspell word list for use with Vim the |
| 590 | following procedure is recommended: |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 591 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 592 | 1. Obtain the xx_YY.aff and xx_YY.dic files from Myspell. |
| 593 | 2. Make a copy of these files to xx_YY.orig.aff and xx_YY.orig.dic. |
| 594 | 3. Change the xx_YY.aff and xx_YY.dic files to remove bad words, add missing |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 595 | words, define word characters with FOL/LOW/UPP, etc. The distributed |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 596 | "*.diff" files can be used. |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 597 | 4. Start Vim with the right locale and use |:mkspell| to generate the Vim |
| 598 | spell file. |
| 599 | 5. Try out the spell file with ":set spell spelllang=xx" if you wrote it in |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 600 | a spell directory in 'runtimepath', or ":set spelllang=xx.enc.spl" if you |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 601 | wrote it somewhere else. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 602 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 603 | When the Myspell files are updated you can merge the differences: |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 604 | 1. Obtain the new Myspell files as xx_YY.new.aff and xx_UU.new.dic. |
| 605 | 2. Use Vimdiff to see what changed: > |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 606 | vimdiff xx_YY.orig.dic xx_YY.new.dic |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 607 | 3. Take over the changes you like in xx_YY.dic. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 608 | You may also need to change xx_YY.aff. |
Bram Moolenaar | d09091d | 2019-01-17 16:07:22 +0100 | [diff] [blame] | 609 | 4. Rename xx_YY.new.dic to xx_YY.orig.dic and xx_YY.new.aff to xx_YY.orig.aff. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 610 | |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 611 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 612 | SPELL FILE VERSIONS *E770* *E771* *E772* |
| 613 | |
| 614 | Spell checking is a relatively new feature in Vim, thus it's possible that the |
| 615 | .spl file format will be changed to support more languages. Vim will check |
| 616 | the validity of the spell file and report anything wrong. |
| 617 | |
| 618 | E771: Old spell file, needs to be updated ~ |
| 619 | This spell file is older than your Vim. You need to update the .spl file. |
| 620 | |
| 621 | E772: Spell file is for newer version of Vim ~ |
| 622 | This means the spell file was made for a later version of Vim. You need to |
| 623 | update Vim. |
| 624 | |
| 625 | E770: Unsupported section in spell file ~ |
| 626 | This means the spell file was made for a later version of Vim and contains a |
| 627 | section that is required for the spell file to work. In this case it's |
| 628 | probably a good idea to upgrade your Vim. |
| 629 | |
| 630 | |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 631 | SPELL FILE DUMP |
| 632 | |
| 633 | If for some reason you want to check what words are supported by the currently |
| 634 | used spelling files, use this command: |
| 635 | |
| 636 | *:spelldump* *:spelld* |
| 637 | :spelld[ump] Open a new window and fill it with all currently valid |
Bram Moolenaar | ac6e65f | 2005-08-29 22:25:38 +0000 | [diff] [blame] | 638 | words. Compound words are not included. |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 639 | Note: For some languages the result may be enormous, |
| 640 | causing Vim to run out of memory. |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 641 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 642 | :spelld[ump]! Like ":spelldump" and include the word count. This is |
| 643 | the number of times the word was found while |
| 644 | updating the screen. Words that are in COMMON items |
| 645 | get a starting count of 10. |
| 646 | |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 647 | The format of the word list is used |spell-wordlist-format|. You should be |
| 648 | able to read it with ":mkspell" to generate one .spl file that includes all |
| 649 | the words. |
| 650 | |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 651 | When all entries to 'spelllang' use the same regions or no regions at all then |
| 652 | the region information is included in the dumped words. Otherwise only words |
| 653 | for the current region are included and no "/regions" line is generated. |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 654 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 655 | Comment lines with the name of the .spl file are used as a header above the |
| 656 | words that were generated from that .spl file. |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 657 | |
Bram Moolenaar | 1ef15e3 | 2006-02-01 21:56:25 +0000 | [diff] [blame] | 658 | |
| 659 | SPELL FILE MISSING *spell-SpellFileMissing* *spellfile.vim* |
| 660 | |
| 661 | If the spell file for the language you are using is not available, you will |
| 662 | get an error message. But if the "spellfile.vim" plugin is active it will |
| 663 | offer you to download the spell file. Just follow the instructions, it will |
Bram Moolenaar | c1a11ed | 2008-06-24 22:09:24 +0000 | [diff] [blame] | 664 | ask you where to write the file (there must be a writable directory in |
| 665 | 'runtimepath' for this). |
Bram Moolenaar | 1ef15e3 | 2006-02-01 21:56:25 +0000 | [diff] [blame] | 666 | |
| 667 | The plugin has a default place where to look for spell files, on the Vim ftp |
Bram Moolenaar | 7ff7846 | 2020-07-10 22:00:53 +0200 | [diff] [blame] | 668 | server. The protocol used is SSL (https://) for security. If you want to use |
| 669 | another location or another protocol, set the g:spellfile_URL variable to the |
| 670 | directory that holds the spell files. You can use http:// or ftp://, but you |
| 671 | are taking a security risk then. The |netrw| plugin is used for getting the |
| 672 | file, look there for the specific syntax of the URL. Example: > |
| 673 | let g:spellfile_URL = 'https://ftp.nluug.nl/vim/runtime/spell' |
Bram Moolenaar | 1ef15e3 | 2006-02-01 21:56:25 +0000 | [diff] [blame] | 674 | You may need to escape special characters. |
| 675 | |
| 676 | The plugin will only ask about downloading a language once. If you want to |
| 677 | try again anyway restart Vim, or set g:spellfile_URL to another value (e.g., |
| 678 | prepend a space). |
| 679 | |
| 680 | To avoid using the "spellfile.vim" plugin do this in your vimrc file: > |
| 681 | |
| 682 | let loaded_spellfile_plugin = 1 |
| 683 | |
| 684 | Instead of using the plugin you can define a |SpellFileMissing| autocommand to |
| 685 | handle the missing file yourself. You can use it like this: > |
| 686 | |
| 687 | :au SpellFileMissing * call Download_spell_file(expand('<amatch>')) |
| 688 | |
| 689 | Thus the <amatch> item contains the name of the language. Another important |
| 690 | value is 'encoding', since every encoding has its own spell file. With two |
| 691 | exceptions: |
| 692 | - For ISO-8859-15 (latin9) the name "latin1" is used (the encodings only |
| 693 | differ in characters not used in dictionary words). |
| 694 | - The name "ascii" may also be used for some languages where the words use |
| 695 | only ASCII letters for most of the words. |
| 696 | |
| 697 | The default "spellfile.vim" plugin uses this autocommand, if you define your |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 698 | autocommand afterwards you may want to use ":au! SpellFileMissing" to overrule |
Bram Moolenaar | 1ef15e3 | 2006-02-01 21:56:25 +0000 | [diff] [blame] | 699 | it. If you define your autocommand before the plugin is loaded it will notice |
| 700 | this and not do anything. |
Bram Moolenaar | 34e0bfa | 2007-05-10 18:44:18 +0000 | [diff] [blame] | 701 | *E797* |
| 702 | Note that the SpellFileMissing autocommand must not change or destroy the |
| 703 | buffer the user was editing. |
Bram Moolenaar | 1ef15e3 | 2006-02-01 21:56:25 +0000 | [diff] [blame] | 704 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 705 | ============================================================================== |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 706 | 4. Spell file format *spell-file-format* |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 707 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 708 | This is the format of the files that are used by the person who creates and |
| 709 | maintains a word list. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 710 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 711 | Note that we avoid the word "dictionary" here. That is because the goal of |
| 712 | spell checking differs from writing a dictionary (as in the book). For |
Bram Moolenaar | 16d8f87 | 2005-11-26 23:46:11 +0000 | [diff] [blame] | 713 | spelling we need a list of words that are OK, thus should not be highlighted. |
| 714 | Person and company names will not appear in a dictionary, but do appear in a |
| 715 | word list. And some old words are rarely used while they are common |
| 716 | misspellings. These do appear in a dictionary but not in a word list. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 717 | |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 718 | There are two formats: A straight list of words and a list using affix |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 719 | compression. The files with affix compression are used by Myspell (Mozilla |
| 720 | and OpenOffice.org). This requires two files, one with .aff and one with .dic |
| 721 | extension. |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 722 | |
| 723 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 724 | FORMAT OF STRAIGHT WORD LIST *spell-wordlist-format* |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 725 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 726 | The words must appear one per line. That is all that is required. |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 727 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 728 | Additionally the following items are recognized: |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 729 | |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 730 | - Empty and blank lines are ignored. |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 731 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 732 | # comment ~ |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 733 | - Lines starting with a # are ignored (comment lines). |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 734 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 735 | /encoding=utf-8 ~ |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 736 | - A line starting with "/encoding=", before any word, specifies the encoding |
| 737 | of the file. After the second '=' comes an encoding name. This tells Vim |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 738 | to setup conversion from the specified encoding to 'encoding'. Thus you can |
| 739 | use one word list for several target encodings. |
| 740 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 741 | /regions=usca ~ |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 742 | - A line starting with "/regions=" specifies the region names that are |
| 743 | supported. Each region name must be two ASCII letters. The first one is |
| 744 | region 1. Thus "/regions=usca" has region 1 "us" and region 2 "ca". |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 745 | In an addition word list the region names should be equal to the main word |
| 746 | list! |
| 747 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 748 | - Other lines starting with '/' are reserved for future use. The ones that |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 749 | are not recognized are ignored. You do get a warning message, so that you |
| 750 | know something won't work. |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 751 | |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 752 | - A "/" may follow the word with the following items: |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 753 | = Case must match exactly. |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 754 | ? Rare word. |
| 755 | ! Bad (wrong) word. |
Bram Moolenaar | 01164a6 | 2017-11-02 22:58:42 +0100 | [diff] [blame] | 756 | 1 to 9 A region in which the word is valid. If no regions are |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 757 | specified the word is valid in all regions. |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 758 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 759 | Example: |
| 760 | |
| 761 | # This is an example word list comment |
| 762 | /encoding=latin1 encoding of the file |
| 763 | /regions=uscagb regions "us", "ca" and "gb" |
| 764 | example word for all regions |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 765 | blah/12 word for regions "us" and "ca" |
| 766 | vim/! bad word |
| 767 | Campbell/?3 rare word in region 3 "gb" |
| 768 | 's mornings/= keep-case word |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 769 | |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 770 | Note that when "/=" is used the same word with all upper-case letters is not |
| 771 | accepted. This is different from a word with mixed case that is automatically |
| 772 | marked as keep-case, those words may appear in all upper-case letters. |
| 773 | |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 774 | |
Bram Moolenaar | 8dff818 | 2006-04-06 20:18:50 +0000 | [diff] [blame] | 775 | FORMAT WITH .AFF AND .DIC FILES *aff-dic-format* |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 776 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 777 | There are two files: the basic word list and an affix file. The affix file |
| 778 | specifies settings for the language and can contain affixes. The affixes are |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 779 | used to modify the basic words to get the full word list. This significantly |
| 780 | reduces the number of words, especially for a language like Polish. This is |
| 781 | called affix compression. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 782 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 783 | The basic word list and the affix file are combined with the ":mkspell" |
| 784 | command and results in a binary spell file. All the preprocessing has been |
| 785 | done, thus this file loads fast. The binary spell file format is described in |
| 786 | the source code (src/spell.c). But only developers need to know about it. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 787 | |
| 788 | The preprocessing also allows us to take the Myspell language files and modify |
| 789 | them before the Vim word list is made. The tools for this can be found in the |
| 790 | "src/spell" directory. |
| 791 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 792 | The format for the affix and word list files is based on what Myspell uses |
| 793 | (the spell checker of Mozilla and OpenOffice.org). A description can be found |
| 794 | here: |
Milly | 89872f5 | 2024-10-05 17:16:18 +0200 | [diff] [blame] | 795 | http://lingucomponent.openoffice.org/affix.readme |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 796 | Note that affixes are case sensitive, this isn't obvious from the description. |
| 797 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 798 | Vim supports quite a few extras. They are described below |spell-affix-vim|. |
| 799 | Attempts have been made to keep this compatible with other spell checkers, so |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 800 | that the same files can often be used. One other project that offers more |
| 801 | than Myspell is Hunspell ( http://hunspell.sf.net ). |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 802 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 803 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 804 | WORD LIST FORMAT *spell-dic-format* |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 805 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 806 | A short example, with line numbers: |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 807 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 808 | 1 1234 ~ |
| 809 | 2 aan ~ |
| 810 | 3 Als ~ |
| 811 | 4 Etten-Leur ~ |
| 812 | 5 et al. ~ |
| 813 | 6 's-Gravenhage ~ |
| 814 | 7 's-Gravenhaags ~ |
| 815 | 8 # word that differs between regions ~ |
| 816 | 9 kado/1 ~ |
| 817 | 10 cadeau/2 ~ |
| 818 | 11 TCP,IP ~ |
| 819 | 12 /the S affix may add a 's' ~ |
| 820 | 13 bedel/S ~ |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 821 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 822 | The first line contains the number of words. Vim ignores it, but you do get |
| 823 | an error message if it's not there. *E760* |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 824 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 825 | What follows is one word per line. White space at the end of the line is |
| 826 | ignored, all other white space matters. The encoding is specified in the |
| 827 | affix file |spell-SET|. |
| 828 | |
| 829 | Comment lines start with '#' or '/'. See the example lines 8 and 12. Note |
| 830 | that putting a comment after a word is NOT allowed: |
| 831 | |
| 832 | someword # comment that causes an error! ~ |
| 833 | |
| 834 | After the word there is an optional slash and flags. Most of these flags are |
| 835 | letters that indicate the affixes that can be used with this word. These are |
| 836 | specified with SFX and PFX lines in the .aff file, see |spell-SFX| and |
| 837 | |spell-PFX|. Vim allows using other flag types with the FLAG item in the |
| 838 | affix file |spell-FLAG|. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 839 | |
| 840 | When the word only has lower-case letters it will also match with the word |
| 841 | starting with an upper-case letter. |
| 842 | |
| 843 | When the word includes an upper-case letter, this means the upper-case letter |
| 844 | is required at this position. The same word with a lower-case letter at this |
| 845 | position will not match. When some of the other letters are upper-case it will |
| 846 | not match either. |
| 847 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 848 | The word with all upper-case characters will always be OK, |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 849 | |
| 850 | word list matches does not match ~ |
| 851 | als als Als ALS ALs AlS aLs aLS |
| 852 | Als Als ALS als ALs AlS aLs aLS |
| 853 | ALS ALS als Als ALs AlS aLs aLS |
| 854 | AlS AlS ALS als Als ALs aLs aLS |
| 855 | |
Bram Moolenaar | 1cbe5f7 | 2005-12-29 22:51:09 +0000 | [diff] [blame] | 856 | The KEEPCASE affix ID can be used to specifically match a word with identical |
| 857 | case only, see below |spell-KEEPCASE|. |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 858 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 859 | Note: in line 5 to 7 non-word characters are used. You can include any |
| 860 | character in a word. When checking the text a word still only matches when it |
| 861 | appears with a non-word character before and after it. For Myspell a word |
| 862 | starting with a non-word character probably won't work. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 863 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 864 | In line 12 the word "TCP/IP" is defined. Since the slash has a special |
| 865 | meaning the comma is used instead. This is defined with the SLASH item in the |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 866 | affix file, see |spell-SLASH|. Note that without this SLASH item the word |
| 867 | will be "TCP,IP". |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 868 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 869 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 870 | AFFIX FILE FORMAT *spell-aff-format* *spell-affix-vim* |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 871 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 872 | *spell-affix-comment* |
| 873 | Comment lines in the .aff file start with a '#': |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 874 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 875 | # comment line ~ |
| 876 | |
Bram Moolenaar | 9f94b05 | 2008-11-30 20:12:46 +0000 | [diff] [blame] | 877 | Items with a fixed number of arguments can be followed by a comment. But only |
| 878 | if none of the arguments can contain white space. The comment must start with |
| 879 | a "#" character. Example: |
| 880 | |
| 881 | KEEPCASE = # fix case for words with this flag ~ |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 882 | |
| 883 | |
| 884 | ENCODING *spell-SET* |
| 885 | |
| 886 | The affix file can be in any encoding that is supported by "iconv". However, |
| 887 | in some cases the current locale should also be set properly at the time |
| 888 | |:mkspell| is invoked. Adding FOL/LOW/UPP lines removes this requirement |
| 889 | |spell-FOL|. |
| 890 | |
| 891 | The encoding should be specified before anything where the encoding matters. |
| 892 | The encoding applies both to the affix file and the dictionary file. It is |
| 893 | done with a SET line: |
| 894 | |
| 895 | SET utf-8 ~ |
| 896 | |
| 897 | The encoding can be different from the value of the 'encoding' option at the |
| 898 | time ":mkspell" is used. Vim will then convert everything to 'encoding' and |
| 899 | generate a spell file for 'encoding'. If some of the used characters to not |
| 900 | fit in 'encoding' you will get an error message. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 901 | *spell-affix-mbyte* |
Bram Moolenaar | 207f009 | 2020-08-30 17:20:20 +0200 | [diff] [blame] | 902 | When using a multibyte encoding it's possible to use more different affix |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 903 | flags. But Myspell doesn't support that, thus you may not want to use it |
| 904 | anyway. For compatibility use an 8-bit encoding. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 905 | |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 906 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 907 | INFORMATION |
| 908 | |
| 909 | These entries in the affix file can be used to add information to the spell |
| 910 | file. There are no restrictions on the format, but they should be in the |
| 911 | right encoding. |
| 912 | |
| 913 | *spell-NAME* *spell-VERSION* *spell-HOME* |
| 914 | *spell-AUTHOR* *spell-EMAIL* *spell-COPYRIGHT* |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 915 | NAME Name of the language |
| 916 | VERSION 1.0.1 with fixes |
Christian Brabandt | 1c5728e | 2024-05-11 11:12:40 +0200 | [diff] [blame] | 917 | HOME <URL> |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 918 | AUTHOR John Doe |
| 919 | EMAIL john AT Doe DOT net |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 920 | COPYRIGHT LGPL |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 921 | |
| 922 | These fields are put in the .spl file as-is. The |:spellinfo| command can be |
| 923 | used to view the info. |
| 924 | |
| 925 | *:spellinfo* *:spelli* |
| 926 | :spelli[nfo] Display the information for the spell file(s) used for |
| 927 | the current buffer. |
| 928 | |
| 929 | |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 930 | CHARACTER TABLES |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 931 | *spell-affix-chars* |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 932 | When using an 8-bit encoding the affix file should define what characters are |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 933 | word characters. This is because the system where ":mkspell" is used may not |
| 934 | support a locale with this encoding and isalpha() won't work. For example |
| 935 | when using "cp1250" on Unix. |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 936 | *E761* *E762* *spell-FOL* |
| 937 | *spell-LOW* *spell-UPP* |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 938 | Three lines in the affix file are needed. Simplistic example: |
| 939 | |
Bram Moolenaar | ab94343 | 2018-03-29 18:27:07 +0200 | [diff] [blame] | 940 | FOL áëñ ~ |
| 941 | LOW áëñ ~ |
| 942 | UPP ÁËÑ ~ |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 943 | |
| 944 | All three lines must have exactly the same number of characters. |
| 945 | |
| 946 | The "FOL" line specifies the case-folded characters. These are used to |
| 947 | compare words while ignoring case. For most encodings this is identical to |
| 948 | the lower case line. |
| 949 | |
| 950 | The "LOW" line specifies the characters in lower-case. Mostly it's equal to |
| 951 | the "FOL" line. |
| 952 | |
| 953 | The "UPP" line specifies the characters with upper-case. That is, a character |
| 954 | is upper-case where it's different from the character at the same position in |
| 955 | "FOL". |
| 956 | |
Bram Moolenaar | ab94343 | 2018-03-29 18:27:07 +0200 | [diff] [blame] | 957 | An exception is made for the German sharp s ß. The upper-case version is |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 958 | "SS". In the FOL/LOW/UPP lines it should be included, so that it's recognized |
Bram Moolenaar | ab94343 | 2018-03-29 18:27:07 +0200 | [diff] [blame] | 959 | as a word character, but use the ß character in all three. |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 960 | |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 961 | ASCII characters should be omitted, Vim always handles these in the same way. |
| 962 | When the encoding is UTF-8 no word characters need to be specified. |
| 963 | |
| 964 | *E763* |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 965 | Vim allows you to use spell checking for several languages in the same file. |
| 966 | You can list them in the 'spelllang' option. As a consequence all spell files |
| 967 | for the same encoding must use the same word characters, otherwise they can't |
Bram Moolenaar | 22dbc77 | 2013-06-28 18:44:48 +0200 | [diff] [blame] | 968 | be combined without errors. |
| 969 | |
| 970 | If you get an E763 warning that the word tables differ you need to update your |
| 971 | ".spl" spell files. If you downloaded the files, get the latest version of |
Bram Moolenaar | 8bb1c3e | 2014-07-04 16:43:17 +0200 | [diff] [blame] | 972 | all spell files you use. If you are only using one, e.g., German, then also |
| 973 | download the recent English spell files. Otherwise generate the .spl file |
| 974 | again with |:mkspell|. If you still get errors check the FOL, LOW and UPP |
| 975 | lines in the used .aff files. |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 976 | |
| 977 | The XX.ascii.spl spell file generated with the "-ascii" argument will not |
| 978 | contain the table with characters, so that it can be combine with spell files |
| 979 | for any encoding. The .add.spl files also do not contain the table. |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 980 | |
Bram Moolenaar | e756604 | 2005-06-17 22:00:15 +0000 | [diff] [blame] | 981 | |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 982 | MID-WORD CHARACTERS |
| 983 | *spell-midword* |
| 984 | Some characters are only to be considered word characters if they are used in |
| 985 | between two ordinary word characters. An example is the single quote: It is |
| 986 | often used to put text in quotes, thus it can't be recognized as a word |
| 987 | character, but when it appears in between word characters it must be part of |
| 988 | the word. This is needed to detect a spelling error such as they'are. That |
| 989 | should be they're, but since "they" and "are" are words themselves that would |
| 990 | go unnoticed. |
| 991 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 992 | These characters are defined with MIDWORD in the .aff file. Example: |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 993 | |
| 994 | MIDWORD '- ~ |
| 995 | |
| 996 | |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 997 | FLAG TYPES *spell-FLAG* |
| 998 | |
| 999 | Flags are used to specify the affixes that can be used with a word and for |
| 1000 | other properties of the word. Normally single-character flags are used. This |
| 1001 | limits the number of possible flags, especially for 8-bit encodings. The FLAG |
| 1002 | item can be used if more affixes are to be used. Possible values: |
| 1003 | |
| 1004 | FLAG long use two-character flags |
| 1005 | FLAG num use numbers, from 1 up to 65000 |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 1006 | FLAG caplong use one-character flags without A-Z and two-character |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 1007 | flags that start with A-Z |
| 1008 | |
| 1009 | With "FLAG num" the numbers in a list of affixes need to be separated with a |
| 1010 | comma: "234,2143,1435". This method is inefficient, but useful if the file is |
| 1011 | generated with a program. |
| 1012 | |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 1013 | When using "caplong" the two-character flags all start with a capital: "Aa", |
| 1014 | "B1", "BB", etc. This is useful to use one-character flags for the most |
| 1015 | common items and two-character flags for uncommon items. |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 1016 | |
| 1017 | Note: When using utf-8 only characters up to 65000 may be used for flags. |
| 1018 | |
Bram Moolenaar | 9f94b05 | 2008-11-30 20:12:46 +0000 | [diff] [blame] | 1019 | Note: even when using "num" or "long" the number of flags available to |
| 1020 | compounding and prefixes is limited to about 250. |
| 1021 | |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 1022 | |
Bram Moolenaar | 76db9e0 | 2022-11-09 21:21:04 +0000 | [diff] [blame] | 1023 | AFFIXES *spell-PFX* *spell-SFX* |
| 1024 | |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 1025 | The usual PFX (prefix) and SFX (suffix) lines are supported (see the Myspell |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 1026 | documentation or the Aspell manual: |
| 1027 | http://aspell.net/man-html/Affix-Compression.html). |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 1028 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1029 | Summary: |
| 1030 | SFX L Y 2 ~ |
| 1031 | SFX L 0 re [^x] ~ |
| 1032 | SFX L 0 ro x ~ |
| 1033 | |
| 1034 | The first line is a header and has four fields: |
| 1035 | SFX {flag} {combine} {count} |
| 1036 | |
| 1037 | {flag} The name used for the suffix. Mostly it's a single letter, |
| 1038 | but other characters can be used, see |spell-FLAG|. |
| 1039 | |
| 1040 | {combine} Can be 'Y' or 'N'. When 'Y' then the word plus suffix can |
| 1041 | also have a prefix. When 'N' then a prefix is not allowed. |
| 1042 | |
| 1043 | {count} The number of lines following. If this is wrong you will get |
| 1044 | an error message. |
| 1045 | |
| 1046 | For PFX the fields are exactly the same. |
| 1047 | |
| 1048 | The basic format for the following lines is: |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1049 | SFX {flag} {strip} {add} {condition} {extra} |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1050 | |
| 1051 | {flag} Must be the same as the {flag} used in the first line. |
| 1052 | |
| 1053 | {strip} Characters removed from the basic word. There is no check if |
| 1054 | the characters are actually there, only the length is used (in |
| 1055 | bytes). This better match the {condition}, otherwise strange |
| 1056 | things may happen. If the {strip} length is equal to or |
| 1057 | longer than the basic word the suffix won't be used. |
| 1058 | When {strip} is 0 (zero) then nothing is stripped. |
| 1059 | |
| 1060 | {add} Characters added to the basic word, after removing {strip}. |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1061 | Optionally there is a '/' followed by flags. The flags apply |
| 1062 | to the word plus affix. See |spell-affix-flags| |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1063 | |
| 1064 | {condition} A simplistic pattern. Only when this matches with a basic |
| 1065 | word will the suffix be used for that word. This is normally |
| 1066 | for using one suffix letter with different {add} and {strip} |
| 1067 | fields for words with different endings. |
| 1068 | When {condition} is a . (dot) there is no condition. |
| 1069 | The pattern may contain: |
| 1070 | - Literal characters. |
| 1071 | - A set of characters in []. [abc] matches a, b and c. |
| 1072 | A dash is allowed for a range [a-c], but this is |
| 1073 | Vim-specific. |
| 1074 | - A set of characters that starts with a ^, meaning the |
| 1075 | complement of the specified characters. [^abc] matches any |
| 1076 | character but a, b and c. |
| 1077 | |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1078 | {extra} Optional extra text: |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1079 | # comment Comment is ignored |
| 1080 | - Hunspell uses this, ignored |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1081 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1082 | For PFX the fields are the same, but the {strip}, {add} and {condition} apply |
| 1083 | to the start of the word. |
| 1084 | |
| 1085 | Note: Myspell ignores any extra text after the relevant info. Vim requires |
| 1086 | this text to start with a "#" so that mistakes don't go unnoticed. Example: |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 1087 | |
| 1088 | SFX F 0 in [^i]n # Spion > Spionin ~ |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 1089 | SFX F 0 nen in # Bauerin > Bauerinnen ~ |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 1090 | |
Bram Moolenaar | b4b43bb | 2014-09-19 16:04:11 +0200 | [diff] [blame] | 1091 | However, to avoid lots of errors in affix files written for Myspell, you can |
| 1092 | add the IGNOREEXTRA flag. |
| 1093 | |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame] | 1094 | Apparently Myspell allows an affix name to appear more than once. Since this |
| 1095 | might also be a mistake, Vim checks for an extra "S". The affix files for |
| 1096 | Myspell that use this feature apparently have this flag. Example: |
| 1097 | |
| 1098 | SFX a Y 1 S ~ |
| 1099 | SFX a 0 an . ~ |
| 1100 | |
| 1101 | SFX a Y 2 S ~ |
| 1102 | SFX a 0 en . ~ |
| 1103 | SFX a 0 on . ~ |
| 1104 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1105 | |
| 1106 | AFFIX FLAGS *spell-affix-flags* |
| 1107 | |
| 1108 | This is a feature that comes from Hunspell: The affix may specify flags. This |
| 1109 | works similar to flags specified on a basic word. The flags apply to the |
Bram Moolenaar | 8dff818 | 2006-04-06 20:18:50 +0000 | [diff] [blame] | 1110 | basic word plus the affix (but there are restrictions). Example: |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1111 | |
| 1112 | SFX S Y 1 ~ |
| 1113 | SFX S 0 s . ~ |
| 1114 | |
| 1115 | SFX A Y 1 ~ |
| 1116 | SFX A 0 able/S . ~ |
| 1117 | |
| 1118 | When the dictionary file contains "drink/AS" then these words are possible: |
| 1119 | |
| 1120 | drink |
| 1121 | drinks uses S suffix |
| 1122 | drinkable uses A suffix |
| 1123 | drinkables uses A suffix and then S suffix |
| 1124 | |
| 1125 | Generally the flags of the suffix are added to the flags of the basic word, |
| 1126 | both are used for the word plus suffix. But the flags of the basic word are |
| 1127 | only used once for affixes, except that both one prefix and one suffix can be |
| 1128 | used when both support combining. |
| 1129 | |
| 1130 | Specifically, the affix flags can be used for: |
Bram Moolenaar | 8dff818 | 2006-04-06 20:18:50 +0000 | [diff] [blame] | 1131 | - Suffixes on suffixes, as in the example above. This works once, thus you |
| 1132 | can have two suffixes on a word (plus one prefix). |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1133 | - Making the word with the affix rare, by using the |spell-RARE| flag. |
| 1134 | - Exclude the word with the affix from compounding, by using the |
| 1135 | |spell-COMPOUNDFORBIDFLAG| flag. |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 1136 | - Allow the word with the affix to be part of a compound word on the side of |
| 1137 | the affix with the |spell-COMPOUNDPERMITFLAG|. |
Bram Moolenaar | 8dff818 | 2006-04-06 20:18:50 +0000 | [diff] [blame] | 1138 | - Use the NEEDCOMPOUND flag: word plus affix can only be used as part of a |
| 1139 | compound word. |spell-NEEDCOMPOUND| |
| 1140 | - Compound flags: word plus affix can be part of a compound word at the end, |
| 1141 | middle, start, etc. The flags are combined with the flags of the basic |
| 1142 | word. |spell-compound| |
| 1143 | - NEEDAFFIX: another affix is needed to make a valid word. |
| 1144 | - CIRCUMFIX, as explained just below. |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1145 | |
Bram Moolenaar | 8dff818 | 2006-04-06 20:18:50 +0000 | [diff] [blame] | 1146 | |
Bram Moolenaar | b4b43bb | 2014-09-19 16:04:11 +0200 | [diff] [blame] | 1147 | IGNOREEXTRA *spell-IGNOREEXTRA* |
| 1148 | |
| 1149 | Normally Vim gives an error for an extra field that does not start with '#'. |
| 1150 | This avoids errors going unnoticed. However, some files created for Myspell |
| 1151 | or Hunspell may contain many entries with an extra field. Use the IGNOREEXTRA |
| 1152 | flag to avoid lots of errors. |
| 1153 | |
| 1154 | |
Bram Moolenaar | 8dff818 | 2006-04-06 20:18:50 +0000 | [diff] [blame] | 1155 | CIRCUMFIX *spell-CIRCUMFIX* |
| 1156 | |
| 1157 | The CIRCUMFIX flag means a prefix and suffix must be added at the same time. |
Bram Moolenaar | d2ea7cf | 2021-05-30 20:54:13 +0200 | [diff] [blame] | 1158 | If a prefix has the CIRCUMFIX flag then only suffixes with the CIRCUMFIX flag |
Bram Moolenaar | 8dff818 | 2006-04-06 20:18:50 +0000 | [diff] [blame] | 1159 | can be added, and the other way around. |
Bram Moolenaar | d2ea7cf | 2021-05-30 20:54:13 +0200 | [diff] [blame] | 1160 | An alternative is to only specify the suffix, and give that suffix two flags: |
| 1161 | the required prefix and the NEEDAFFIX flag. |spell-NEEDAFFIX| |
Bram Moolenaar | 8dff818 | 2006-04-06 20:18:50 +0000 | [diff] [blame] | 1162 | |
| 1163 | |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 1164 | PFXPOSTPONE *spell-PFXPOSTPONE* |
Bram Moolenaar | 8dff818 | 2006-04-06 20:18:50 +0000 | [diff] [blame] | 1165 | |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 1166 | When an affix file has very many prefixes that apply to many words it's not |
| 1167 | possible to build the whole word list in memory. This applies to Hebrew (a |
| 1168 | list with all words is over a Gbyte). In that case applying prefixes must be |
| 1169 | postponed. This makes spell checking slower. It is indicated by this keyword |
| 1170 | in the .aff file: |
| 1171 | |
| 1172 | PFXPOSTPONE ~ |
| 1173 | |
Bram Moolenaar | 8dff818 | 2006-04-06 20:18:50 +0000 | [diff] [blame] | 1174 | Only prefixes without a chop string and without flags can be postponed. |
| 1175 | Prefixes with a chop string or with flags will still be included in the word |
| 1176 | list. An exception if the chop string is one character and equal to the last |
| 1177 | character of the added string, but in lower case. Thus when the chop string |
| 1178 | is used to allow the following word to start with an upper case letter. |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 1179 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1180 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1181 | WORDS WITH A SLASH *spell-SLASH* |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1182 | |
| 1183 | The slash is used in the .dic file to separate the basic word from the affix |
Bram Moolenaar | 33aec76 | 2006-01-22 23:30:12 +0000 | [diff] [blame] | 1184 | letters and other flags. Unfortunately, this means you cannot use a slash in |
Bram Moolenaar | 9ba7e17 | 2013-07-17 22:37:26 +0200 | [diff] [blame] | 1185 | a word. Thus "TCP/IP" is not a word but "TCP" with the flags "IP". To include |
Bram Moolenaar | 33aec76 | 2006-01-22 23:30:12 +0000 | [diff] [blame] | 1186 | a slash in the word put a backslash before it: "TCP\/IP". In the rare case |
| 1187 | you want to use a backslash inside a word you need to use two backslashes. |
| 1188 | Any other use of the backslash is reserved for future expansion. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1189 | |
| 1190 | |
Bram Moolenaar | 1cbe5f7 | 2005-12-29 22:51:09 +0000 | [diff] [blame] | 1191 | KEEP-CASE WORDS *spell-KEEPCASE* |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1192 | |
Bram Moolenaar | 1cbe5f7 | 2005-12-29 22:51:09 +0000 | [diff] [blame] | 1193 | In the affix file a KEEPCASE line can be used to define the affix name used |
| 1194 | for keep-case words. Example: |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 1195 | |
Bram Moolenaar | 1cbe5f7 | 2005-12-29 22:51:09 +0000 | [diff] [blame] | 1196 | KEEPCASE = ~ |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 1197 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1198 | This flag is not supported by Myspell. It has the meaning that case matters. |
| 1199 | This can be used if the word does not have the first letter in upper case at |
| 1200 | the start of a sentence. Example: |
| 1201 | |
| 1202 | word list matches does not match ~ |
| 1203 | 's morgens/= 's morgens 'S morgens 's Morgens 'S MORGENS |
| 1204 | 's Morgens 's Morgens 'S MORGENS 'S morgens 's morgens |
| 1205 | |
| 1206 | The flag can also be used to avoid that the word matches when it is in all |
| 1207 | upper-case letters. |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 1208 | |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 1209 | |
Bram Moolenaar | 1cbe5f7 | 2005-12-29 22:51:09 +0000 | [diff] [blame] | 1210 | RARE WORDS *spell-RARE* |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1211 | |
Bram Moolenaar | 1cbe5f7 | 2005-12-29 22:51:09 +0000 | [diff] [blame] | 1212 | In the affix file a RARE line can be used to define the affix name used for |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 1213 | rare words. Example: |
| 1214 | |
Bram Moolenaar | 1cbe5f7 | 2005-12-29 22:51:09 +0000 | [diff] [blame] | 1215 | RARE ? ~ |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 1216 | |
| 1217 | Rare words are highlighted differently from bad words. This is to be used for |
| 1218 | words that are correct for the language, but are hardly ever used and could be |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 1219 | a typing mistake anyway. When the same word is found as good it won't be |
| 1220 | highlighted as rare. |
| 1221 | |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 1222 | This flag can also be used on an affix, so that a basic word is not rare but |
| 1223 | the basic word plus affix is rare |spell-affix-flags|. However, if the word |
| 1224 | also appears as a good word in another way (e.g., in another region) it won't |
| 1225 | be marked as rare. |
| 1226 | |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 1227 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1228 | BAD WORDS *spell-BAD* |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1229 | |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 1230 | In the affix file a BAD line can be used to define the affix name used for |
| 1231 | bad words. Example: |
| 1232 | |
| 1233 | BAD ! ~ |
| 1234 | |
| 1235 | This can be used to exclude words that would otherwise be good. For example |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 1236 | "the the" in the .dic file: |
| 1237 | |
| 1238 | the the/! ~ |
| 1239 | |
| 1240 | Once a word has been marked as bad it won't be undone by encountering the same |
| 1241 | word as good. |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 1242 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1243 | The flag also applies to the word with affixes, thus this can be used to mark |
| 1244 | a whole bunch of related words as bad. |
| 1245 | |
Bram Moolenaar | 9f94b05 | 2008-11-30 20:12:46 +0000 | [diff] [blame] | 1246 | *spell-FORBIDDENWORD* |
| 1247 | FORBIDDENWORD can be used just like BAD. For compatibility with Hunspell. |
| 1248 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1249 | *spell-NEEDAFFIX* |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1250 | The NEEDAFFIX flag is used to require that a word is used with an affix. The |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1251 | word itself is not a good word (unless there is an empty affix). Example: |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1252 | |
| 1253 | NEEDAFFIX + ~ |
| 1254 | |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 1255 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1256 | COMPOUND WORDS *spell-compound* |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1257 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1258 | A compound word is a longer word made by concatenating words that appear in |
| 1259 | the .dic file. To specify which words may be concatenated a character is |
| 1260 | used. This character is put in the list of affixes after the word. We will |
| 1261 | call this character a flag here. Obviously these flags must be different from |
| 1262 | any affix IDs used. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1263 | |
| 1264 | *spell-COMPOUNDFLAG* |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1265 | The Myspell compatible method uses one flag, specified with COMPOUNDFLAG. All |
| 1266 | words with this flag combine in any order. This means there is no control |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1267 | over which word comes first. Example: |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1268 | COMPOUNDFLAG c ~ |
| 1269 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1270 | *spell-COMPOUNDRULE* |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1271 | A more advanced method to specify how compound words can be formed uses |
| 1272 | multiple items with multiple flags. This is not compatible with Myspell 3.0. |
| 1273 | Let's start with an example: |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1274 | COMPOUNDRULE c+ ~ |
| 1275 | COMPOUNDRULE se ~ |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1276 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1277 | The first line defines that words with the "c" flag can be concatenated in any |
| 1278 | order. The second line defines compound words that are made of one word with |
| 1279 | the "s" flag and one word with the "e" flag. With this dictionary: |
| 1280 | bork/c ~ |
| 1281 | onion/s ~ |
| 1282 | soup/e ~ |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1283 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1284 | You can make these words: |
| 1285 | bork |
| 1286 | borkbork |
| 1287 | borkborkbork |
| 1288 | (etc.) |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1289 | onion |
| 1290 | soup |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1291 | onionsoup |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1292 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1293 | The COMPOUNDRULE item may appear multiple times. The argument is made out of |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1294 | one or more groups, where each group can be: |
| 1295 | one flag e.g., c |
| 1296 | alternate flags inside [] e.g., [abc] |
| 1297 | Optionally this may be followed by: |
| 1298 | * the group appears zero or more times, e.g., sm*e |
| 1299 | + the group appears one or more times, e.g., c+ |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 1300 | ? the group appears zero times or once, e.g., x? |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1301 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1302 | This is similar to the regexp pattern syntax (but not the same!). A few |
| 1303 | examples with the sequence of word flags they require: |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1304 | COMPOUNDRULE x+ x xx xxx etc. |
| 1305 | COMPOUNDRULE yz yz |
| 1306 | COMPOUNDRULE x+z xz xxz xxxz etc. |
| 1307 | COMPOUNDRULE yx+ yx yxx yxxx etc. |
Bram Moolenaar | 251e191 | 2011-06-19 05:09:16 +0200 | [diff] [blame] | 1308 | COMPOUNDRULE xy?z xz xyz |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1309 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1310 | COMPOUNDRULE [abc]z az bz cz |
| 1311 | COMPOUNDRULE [abc]+z az aaz abaz bz baz bcbz cz caz cbaz etc. |
| 1312 | COMPOUNDRULE a[xyz]+ ax axx axyz ay ayx ayzz az azy azxy etc. |
| 1313 | COMPOUNDRULE sm*e se sme smme smmme etc. |
| 1314 | COMPOUNDRULE s[xyz]*e se sxe sxye sxyxe sye syze sze szye szyxe etc. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1315 | |
Bram Moolenaar | a6c840d | 2005-08-22 22:59:46 +0000 | [diff] [blame] | 1316 | A specific example: Allow a compound to be made of two words and a dash: |
| 1317 | In the .aff file: |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1318 | COMPOUNDRULE sde ~ |
Bram Moolenaar | a6c840d | 2005-08-22 22:59:46 +0000 | [diff] [blame] | 1319 | NEEDAFFIX x ~ |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1320 | COMPOUNDWORDMAX 3 ~ |
Bram Moolenaar | a6c840d | 2005-08-22 22:59:46 +0000 | [diff] [blame] | 1321 | COMPOUNDMIN 1 ~ |
| 1322 | In the .dic file: |
| 1323 | start/s ~ |
| 1324 | end/e ~ |
| 1325 | -/xd ~ |
| 1326 | |
| 1327 | This allows for the word "start-end", but not "startend". |
| 1328 | |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 1329 | An additional implied rule is that, without further flags, a word with a |
| 1330 | prefix cannot be compounded after another word, and a word with a suffix |
| 1331 | cannot be compounded with a following word. Thus the affix cannot appear |
| 1332 | on the inside of a compound word. This can be changed with the |
| 1333 | |spell-COMPOUNDPERMITFLAG|. |
| 1334 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1335 | *spell-NEEDCOMPOUND* |
| 1336 | The NEEDCOMPOUND flag is used to require that a word is used as part of a |
| 1337 | compound word. The word itself is not a good word. Example: |
| 1338 | |
| 1339 | NEEDCOMPOUND & ~ |
| 1340 | |
Bram Moolenaar | 9f94b05 | 2008-11-30 20:12:46 +0000 | [diff] [blame] | 1341 | *spell-ONLYINCOMPOUND* |
| 1342 | The ONLYINCOMPOUND does exactly the same as NEEDCOMPOUND. Supported for |
Bram Moolenaar | 8f3f58f | 2010-01-06 20:52:26 +0100 | [diff] [blame] | 1343 | compatibility with Hunspell. |
Bram Moolenaar | 9f94b05 | 2008-11-30 20:12:46 +0000 | [diff] [blame] | 1344 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1345 | *spell-COMPOUNDMIN* |
Bram Moolenaar | ac6e65f | 2005-08-29 22:25:38 +0000 | [diff] [blame] | 1346 | The minimal character length of a word used for compounding is specified with |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1347 | COMPOUNDMIN. Example: |
| 1348 | COMPOUNDMIN 5 ~ |
| 1349 | |
Bram Moolenaar | ac6e65f | 2005-08-29 22:25:38 +0000 | [diff] [blame] | 1350 | When omitted there is no minimal length. Obviously you could just leave out |
| 1351 | the compound flag from short words instead, this feature is present for |
| 1352 | compatibility with Myspell. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1353 | |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1354 | *spell-COMPOUNDWORDMAX* |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1355 | The maximum number of words that can be concatenated into a compound word is |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1356 | specified with COMPOUNDWORDMAX. Example: |
| 1357 | COMPOUNDWORDMAX 3 ~ |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1358 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1359 | When omitted there is no maximum. It applies to all compound words. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1360 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1361 | To set a limit for words with specific flags make sure the items in |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1362 | COMPOUNDRULE where they appear don't allow too many words. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1363 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1364 | *spell-COMPOUNDSYLMAX* |
| 1365 | The maximum number of syllables that a compound word may contain is specified |
| 1366 | with COMPOUNDSYLMAX. Example: |
| 1367 | COMPOUNDSYLMAX 6 ~ |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1368 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1369 | This has no effect if there is no SYLLABLE item. Without COMPOUNDSYLMAX there |
| 1370 | is no limit on the number of syllables. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1371 | |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1372 | If both COMPOUNDWORDMAX and COMPOUNDSYLMAX are defined, a compound word is |
Bram Moolenaar | a6c840d | 2005-08-22 22:59:46 +0000 | [diff] [blame] | 1373 | accepted if it fits one of the criteria, thus is either made from up to |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1374 | COMPOUNDWORDMAX words or contains up to COMPOUNDSYLMAX syllables. |
Bram Moolenaar | a6c840d | 2005-08-22 22:59:46 +0000 | [diff] [blame] | 1375 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1376 | *spell-COMPOUNDFORBIDFLAG* |
| 1377 | The COMPOUNDFORBIDFLAG specifies a flag that can be used on an affix. It |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 1378 | means that the word plus affix cannot be used in a compound word. Example: |
| 1379 | affix file: |
| 1380 | COMPOUNDFLAG c ~ |
| 1381 | COMPOUNDFORBIDFLAG x ~ |
| 1382 | SFX a Y 2 ~ |
| 1383 | SFX a 0 s . ~ |
| 1384 | SFX a 0 ize/x . ~ |
| 1385 | dictionary: |
| 1386 | word/c ~ |
| 1387 | util/ac ~ |
| 1388 | |
| 1389 | This allows for "wordutil" and "wordutils" but not "wordutilize". |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 1390 | Note: this doesn't work for postponed prefixes yet. |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1391 | |
| 1392 | *spell-COMPOUNDPERMITFLAG* |
| 1393 | The COMPOUNDPERMITFLAG specifies a flag that can be used on an affix. It |
| 1394 | means that the word plus affix can also be used in a compound word in a way |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 1395 | where the affix ends up halfway the word. Without this flag that is not |
| 1396 | allowed. |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 1397 | Note: this doesn't work for postponed prefixes yet. |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1398 | |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1399 | *spell-COMPOUNDROOT* |
| 1400 | The COMPOUNDROOT flag is used for words in the dictionary that are already a |
| 1401 | compound. This means it counts for two words when checking the compounding |
| 1402 | rules. Can also be used for an affix to count the affix as a compounding |
| 1403 | word. |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1404 | |
Bram Moolenaar | 9f94b05 | 2008-11-30 20:12:46 +0000 | [diff] [blame] | 1405 | *spell-CHECKCOMPOUNDPATTERN* |
| 1406 | CHECKCOMPOUNDPATTERN is used to define patterns that, when matching at the |
| 1407 | position where two words are compounded together forbids the compound. |
| 1408 | For example: |
| 1409 | CHECKCOMPOUNDPATTERN o e ~ |
| 1410 | |
| 1411 | This forbids compounding if the first word ends in "o" and the second word |
| 1412 | starts with "e". |
| 1413 | |
| 1414 | The arguments must be plain text, no patterns are actually supported, despite |
| 1415 | the item name. Case is always ignored. |
| 1416 | |
| 1417 | The Hunspell feature to use three arguments and flags is not supported. |
| 1418 | |
Bram Moolenaar | 7b877b3 | 2016-01-09 13:51:34 +0100 | [diff] [blame] | 1419 | *spell-NOCOMPOUNDSUGS* |
| 1420 | This item indicates that using compounding to make suggestions is not a good |
| 1421 | idea. Use this when compounding is used with very short or one-character |
| 1422 | words. E.g. to make numbers out of digits. Without this flag creating |
| 1423 | suggestions would spend most time trying all kind of weird compound words. |
| 1424 | |
| 1425 | NOCOMPOUNDSUGS ~ |
| 1426 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1427 | *spell-SYLLABLE* |
| 1428 | The SYLLABLE item defines characters or character sequences that are used to |
| 1429 | count the number of syllables in a word. Example: |
Bram Moolenaar | ab94343 | 2018-03-29 18:27:07 +0200 | [diff] [blame] | 1430 | SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui ~ |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1431 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1432 | Before the first slash is the set of characters that are counted for one |
| 1433 | syllable, also when repeated and mixed, until the next character that is not |
| 1434 | in this set. After the slash come sequences of characters that are counted |
| 1435 | for one syllable. These are preferred over using characters from the set. |
| 1436 | With the example "ideeen" has three syllables, counted by "i", "ee" and "e". |
| 1437 | |
| 1438 | Only case-folded letters need to be included. |
| 1439 | |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 1440 | Another way to restrict compounding was mentioned above: Adding the |
Bram Moolenaar | 910f66f | 2006-04-05 20:41:53 +0000 | [diff] [blame] | 1441 | |spell-COMPOUNDFORBIDFLAG| flag to an affix causes all words that are made |
Bram Moolenaar | 9ba7e17 | 2013-07-17 22:37:26 +0200 | [diff] [blame] | 1442 | with that affix to not be used for compounding. |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1443 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1444 | |
| 1445 | UNLIMITED COMPOUNDING *spell-NOBREAK* |
| 1446 | |
| 1447 | For some languages, such as Thai, there is no space in between words. This |
| 1448 | looks like all words are compounded. To specify this use the NOBREAK item in |
| 1449 | the affix file, without arguments: |
| 1450 | NOBREAK ~ |
| 1451 | |
| 1452 | Vim will try to figure out where one word ends and a next starts. When there |
| 1453 | are spelling mistakes this may not be quite right. |
| 1454 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1455 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1456 | *spell-COMMON* |
| 1457 | Common words can be specified with the COMMON item. This will give better |
| 1458 | suggestions when editing a short file. Example: |
| 1459 | |
Bram Moolenaar | 3d1cde8 | 2020-08-15 18:55:18 +0200 | [diff] [blame] | 1460 | COMMON the of to and a in is it you that he she was for on are ~ |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1461 | |
| 1462 | The words must be separated by white space, up to 25 per line. |
| 1463 | When multiple regions are specified in a ":mkspell" command the common words |
| 1464 | for all regions are combined and used for all regions. |
| 1465 | |
| 1466 | *spell-NOSPLITSUGS* |
Bram Moolenaar | fd2ac76 | 2006-03-01 22:09:21 +0000 | [diff] [blame] | 1467 | This item indicates that splitting a word to make suggestions is not a good |
| 1468 | idea. Split-word suggestions will appear only when there are few similar |
| 1469 | words. |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1470 | |
| 1471 | NOSPLITSUGS ~ |
| 1472 | |
| 1473 | *spell-NOSUGGEST* |
| 1474 | The flag specified with NOSUGGEST can be used for words that will not be |
| 1475 | suggested. Can be used for obscene words. |
| 1476 | |
| 1477 | NOSUGGEST % ~ |
| 1478 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1479 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1480 | REPLACEMENTS *spell-REP* |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1481 | |
| 1482 | In the affix file REP items can be used to define common mistakes. This is |
| 1483 | used to make spelling suggestions. The items define the "from" text and the |
| 1484 | "to" replacement. Example: |
| 1485 | |
| 1486 | REP 4 ~ |
| 1487 | REP f ph ~ |
| 1488 | REP ph f ~ |
| 1489 | REP k ch ~ |
| 1490 | REP ch k ~ |
| 1491 | |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 1492 | The first line specifies the number of REP lines following. Vim ignores the |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1493 | number, but it must be there (for compatibility with Myspell). |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 1494 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 1495 | Don't include simple one-character replacements or swaps. Vim will try these |
| 1496 | anyway. You can include whole words if you want to, but you might want to use |
| 1497 | the "file:" item in 'spellsuggest' instead. |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1498 | |
Bram Moolenaar | 1e01546 | 2005-09-25 22:16:38 +0000 | [diff] [blame] | 1499 | You can include a space by using an underscore: |
| 1500 | |
| 1501 | REP the_the the ~ |
| 1502 | |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1503 | |
Bram Moolenaar | a40ceaf | 2006-01-13 22:35:40 +0000 | [diff] [blame] | 1504 | SIMILAR CHARACTERS *spell-MAP* *E783* |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1505 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 1506 | In the affix file MAP items can be used to define letters that are very much |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1507 | alike. This is mostly used for a letter with different accents. This is used |
| 1508 | to prefer suggestions with these letters substituted. Example: |
| 1509 | |
| 1510 | MAP 2 ~ |
Bram Moolenaar | ab94343 | 2018-03-29 18:27:07 +0200 | [diff] [blame] | 1511 | MAP eéëêè ~ |
| 1512 | MAP uüùúû ~ |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1513 | |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 1514 | The first line specifies the number of MAP lines following. Vim ignores the |
| 1515 | number, but the line must be there. |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1516 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 1517 | Each letter must appear in only one of the MAP items. It's a bit more |
| 1518 | efficient if the first letter is ASCII or at least one without accents. |
Bram Moolenaar | e756604 | 2005-06-17 22:00:15 +0000 | [diff] [blame] | 1519 | |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1520 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1521 | .SUG FILE *spell-NOSUGFILE* |
| 1522 | |
| 1523 | When soundfolding is specified in the affix file then ":mkspell" will normally |
Bram Moolenaar | d12f5c1 | 2006-01-25 22:10:52 +0000 | [diff] [blame] | 1524 | produce a .sug file next to the .spl file. This file is used to find |
| 1525 | suggestions by their sound-a-like form quickly. At the cost of a lot of |
| 1526 | memory (the amount depends on the number of words, |:mkspell| will display an |
| 1527 | estimate when it's done). |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1528 | |
| 1529 | To avoid producing a .sug file use this item in the affix file: |
| 1530 | |
| 1531 | NOSUGFILE ~ |
| 1532 | |
Bram Moolenaar | d12f5c1 | 2006-01-25 22:10:52 +0000 | [diff] [blame] | 1533 | Users can simply omit the .sug file if they don't want to use it. |
| 1534 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1535 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1536 | SOUND-A-LIKE *spell-SAL* |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1537 | |
| 1538 | In the affix file SAL items can be used to define the sounds-a-like mechanism |
| 1539 | to be used. The main items define the "from" text and the "to" replacement. |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 1540 | Simplistic example: |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1541 | |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 1542 | SAL CIA X ~ |
| 1543 | SAL CH X ~ |
| 1544 | SAL C K ~ |
| 1545 | SAL K K ~ |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1546 | |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 1547 | There are a few rules and this can become quite complicated. An explanation |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 1548 | how it works can be found in the Aspell manual: |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 1549 | http://aspell.net/man-html/Phonetic-Code.html. |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1550 | |
| 1551 | There are a few special items: |
| 1552 | |
| 1553 | SAL followup true ~ |
| 1554 | SAL collapse_result true ~ |
| 1555 | SAL remove_accents true ~ |
| 1556 | |
| 1557 | "1" has the same meaning as "true". Any other value means "false". |
| 1558 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 1559 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1560 | SIMPLE SOUNDFOLDING *spell-SOFOFROM* *spell-SOFOTO* |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 1561 | |
| 1562 | The SAL mechanism is complex and slow. A simpler mechanism is mapping all |
| 1563 | characters to another character, mapping similar sounding characters to the |
| 1564 | same character. At the same time this does case folding. You can not have |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 1565 | both SAL items and simple soundfolding. |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 1566 | |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 1567 | There are two items required: one to specify the characters that are mapped |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 1568 | and one that specifies the characters they are mapped to. They must have |
| 1569 | exactly the same number of characters. Example: |
| 1570 | |
| 1571 | SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ~ |
| 1572 | SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkes ~ |
| 1573 | |
| 1574 | In the example all vowels are mapped to the same character 'e'. Another |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 1575 | method would be to leave out all vowels. Some characters that sound nearly |
| 1576 | the same and are often mixed up, such as 'm' and 'n', are mapped to the same |
| 1577 | character. Don't do this too much, all words will start looking alike. |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 1578 | |
| 1579 | Characters that do not appear in SOFOFROM will be left out, except that all |
| 1580 | white space is replaced by one space. Sequences of the same character in |
| 1581 | SOFOFROM are replaced by one. |
| 1582 | |
| 1583 | You can use the |soundfold()| function to try out the results. Or set the |
Bram Moolenaar | cc016f5 | 2005-12-10 20:23:46 +0000 | [diff] [blame] | 1584 | 'verbose' option to see the score in the output of the |z=| command. |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 1585 | |
| 1586 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1587 | UNSUPPORTED ITEMS *spell-affix-not-supported* |
| 1588 | |
| 1589 | These items appear in the affix file of other spell checkers. In Vim they are |
| 1590 | ignored, not supported or defined in another way. |
| 1591 | |
| 1592 | ACCENT (Hunspell) *spell-ACCENT* |
| 1593 | Use MAP instead. |spell-MAP| |
| 1594 | |
Bram Moolenaar | 9f94b05 | 2008-11-30 20:12:46 +0000 | [diff] [blame] | 1595 | BREAK (Hunspell) *spell-BREAK* |
| 1596 | Define break points. Unclear how it works exactly. |
| 1597 | Not supported. |
| 1598 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1599 | CHECKCOMPOUNDCASE (Hunspell) *spell-CHECKCOMPOUNDCASE* |
| 1600 | Disallow uppercase letters at compound word boundaries. |
| 1601 | Not supported. |
| 1602 | |
| 1603 | CHECKCOMPOUNDDUP (Hunspell) *spell-CHECKCOMPOUNDDUP* |
| 1604 | Disallow using the same word twice in a compound. Not |
| 1605 | supported. |
| 1606 | |
| 1607 | CHECKCOMPOUNDREP (Hunspell) *spell-CHECKCOMPOUNDREP* |
| 1608 | Something about using REP items and compound words. Not |
| 1609 | supported. |
| 1610 | |
| 1611 | CHECKCOMPOUNDTRIPLE (Hunspell) *spell-CHECKCOMPOUNDTRIPLE* |
| 1612 | Forbid three identical characters when compounding. Not |
| 1613 | supported. |
| 1614 | |
Bram Moolenaar | 9712ff1 | 2022-09-18 13:04:22 +0100 | [diff] [blame] | 1615 | CHECKSHARPS (Hunspell) *spell-CHECKSHARPS* |
Bram Moolenaar | 2a953fc | 2019-01-26 17:41:47 +0100 | [diff] [blame] | 1616 | SS letter pair in uppercased (German) words may be upper case |
| 1617 | sharp s (ß). Not supported. |
| 1618 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1619 | COMPLEXPREFIXES (Hunspell) *spell-COMPLEXPREFIXES* |
| 1620 | Enables using two prefixes. Not supported. |
| 1621 | |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1622 | COMPOUND (Hunspell) *spell-COMPOUND* |
Bram Moolenaar | c81e5e7 | 2007-05-05 18:24:42 +0000 | [diff] [blame] | 1623 | This is one line with the count of COMPOUND items, followed by |
Bram Moolenaar | c9b4b05 | 2006-04-30 18:54:39 +0000 | [diff] [blame] | 1624 | that many COMPOUND lines with a pattern. |
| 1625 | Remove the first line with the count and rename the other |
| 1626 | items to COMPOUNDRULE |spell-COMPOUNDRULE| |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1627 | |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1628 | COMPOUNDFIRST (Hunspell) *spell-COMPOUNDFIRST* |
| 1629 | Use COMPOUNDRULE instead. |spell-COMPOUNDRULE| |
| 1630 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1631 | COMPOUNDBEGIN (Hunspell) *spell-COMPOUNDBEGIN* |
Bram Moolenaar | 2a953fc | 2019-01-26 17:41:47 +0100 | [diff] [blame] | 1632 | Words signed with COMPOUNDBEGIN may be first elements in |
| 1633 | compound words. |
| 1634 | Use COMPOUNDRULE instead. |spell-COMPOUNDRULE| |
| 1635 | |
| 1636 | COMPOUNDLAST (Hunspell) *spell-COMPOUNDLAST* |
| 1637 | Words signed with COMPOUNDLAST may be last elements in |
| 1638 | compound words. |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1639 | Use COMPOUNDRULE instead. |spell-COMPOUNDRULE| |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1640 | |
| 1641 | COMPOUNDEND (Hunspell) *spell-COMPOUNDEND* |
Bram Moolenaar | 2a953fc | 2019-01-26 17:41:47 +0100 | [diff] [blame] | 1642 | Probably the same as COMPOUNDLAST |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1643 | |
| 1644 | COMPOUNDMIDDLE (Hunspell) *spell-COMPOUNDMIDDLE* |
Bram Moolenaar | 2a953fc | 2019-01-26 17:41:47 +0100 | [diff] [blame] | 1645 | Words signed with COMPOUNDMIDDLE may be middle elements in |
| 1646 | compound words. |
Bram Moolenaar | 362e1a3 | 2006-03-06 23:29:24 +0000 | [diff] [blame] | 1647 | Use COMPOUNDRULE instead. |spell-COMPOUNDRULE| |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1648 | |
Bram Moolenaar | 9f94b05 | 2008-11-30 20:12:46 +0000 | [diff] [blame] | 1649 | COMPOUNDRULES (Hunspell) *spell-COMPOUNDRULES* |
| 1650 | Number of COMPOUNDRULE lines following. Ignored, but the |
| 1651 | argument must be a number. |
| 1652 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1653 | COMPOUNDSYLLABLE (Hunspell) *spell-COMPOUNDSYLLABLE* |
| 1654 | Use SYLLABLE and COMPOUNDSYLMAX instead. |spell-SYLLABLE| |
| 1655 | |spell-COMPOUNDSYLMAX| |
| 1656 | |
Bram Moolenaar | 9f94b05 | 2008-11-30 20:12:46 +0000 | [diff] [blame] | 1657 | KEY (Hunspell) *spell-KEY* |
| 1658 | Define characters that are close together on the keyboard. |
| 1659 | Used to give better suggestions. Not supported. |
Bram Moolenaar | 6aa8cea | 2017-06-05 14:44:35 +0200 | [diff] [blame] | 1660 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1661 | LANG (Hunspell) *spell-LANG* |
| 1662 | This specifies language-specific behavior. This actually |
| 1663 | moves part of the language knowledge into the program, |
| 1664 | therefore Vim does not support it. Each language property |
| 1665 | must be specified separately. |
| 1666 | |
| 1667 | LEMMA_PRESENT (Hunspell) *spell-LEMMA_PRESENT* |
Bram Moolenaar | 899dddf | 2006-03-26 21:06:50 +0000 | [diff] [blame] | 1668 | Only needed for morphological analysis. |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1669 | |
| 1670 | MAXNGRAMSUGS (Hunspell) *spell-MAXNGRAMSUGS* |
Bram Moolenaar | 9f94b05 | 2008-11-30 20:12:46 +0000 | [diff] [blame] | 1671 | Set number of n-gram suggestions. Not supported. |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1672 | |
| 1673 | PSEUDOROOT (Hunspell) *spell-PSEUDOROOT* |
| 1674 | Use NEEDAFFIX instead. |spell-NEEDAFFIX| |
| 1675 | |
| 1676 | SUGSWITHDOTS (Hunspell) *spell-SUGSWITHDOTS* |
| 1677 | Adds dots to suggestions. Vim doesn't need this. |
| 1678 | |
| 1679 | SYLLABLENUM (Hunspell) *spell-SYLLABLENUM* |
| 1680 | Not supported. |
| 1681 | |
| 1682 | TRY (Myspell, Hunspell, others) *spell-TRY* |
| 1683 | Vim does not use the TRY item, it is ignored. For making |
Bram Moolenaar | a94bc43 | 2006-03-10 21:42:59 +0000 | [diff] [blame] | 1684 | suggestions the actual characters in the words are used, that |
| 1685 | is much more efficient. |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1686 | |
Bram Moolenaar | 4770d09 | 2006-01-12 23:22:24 +0000 | [diff] [blame] | 1687 | WORDCHARS (Hunspell) *spell-WORDCHARS* |
| 1688 | Used to recognize words. Vim doesn't need it, because there |
| 1689 | is no need to separate words before checking them (using a |
| 1690 | trie instead of a hashtable). |
| 1691 | |
Bram Moolenaar | 91f84f6 | 2018-07-29 15:07:52 +0200 | [diff] [blame] | 1692 | vim:tw=78:sw=4:ts=8:noet:ft=help:norl: |