Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame^] | 1 | *spell.txt* For Vim version 7.0aa. Last change: 2005 Aug 25 |
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 | |
| 14 | {Vi does not have any of these commands} |
| 15 | |
| 16 | Spell checking is not available when the |+syntax| feature has been disabled |
| 17 | at compile time. |
| 18 | |
| 19 | ============================================================================== |
| 20 | 1. Quick start *spell-quickstart* |
| 21 | |
| 22 | This command switches on spell checking: > |
| 23 | |
| 24 | :setlocal spell spelllang=en_us |
| 25 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 26 | 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] | 27 | |
| 28 | The words that are not recognized are highlighted with one of these: |
Bram Moolenaar | 520470a | 2005-06-16 21:59:56 +0000 | [diff] [blame] | 29 | SpellBad word not recognized |hl-SpellBad| |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 30 | SpellCap word not capitalised |hl-SpellCap| |
Bram Moolenaar | 520470a | 2005-06-16 21:59:56 +0000 | [diff] [blame] | 31 | SpellRare rare word |hl-SpellRare| |
| 32 | SpellLocal wrong spelling for selected region |hl-SpellLocal| |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 33 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 34 | Vim only checks words for spelling, there is no grammar check. |
| 35 | |
Bram Moolenaar | 4536002 | 2005-07-21 21:08:21 +0000 | [diff] [blame] | 36 | If the 'mousemodel' option is set to "popup" and the cursor is on a badly |
| 37 | spelled word or it is "popup_setpos" and the mouse pointer is on a badly |
| 38 | spelled word, then the popup menu will contain an submenu to replace the bad |
| 39 | word. Note: this slows down the appearance of the popup menu. |
| 40 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 41 | To search for the next misspelled word: |
| 42 | |
| 43 | *]s* *E756* |
| 44 | ]s Move to next misspelled word after the cursor. |
Bram Moolenaar | 9d0ec2e | 2005-04-20 19:45:58 +0000 | [diff] [blame] | 45 | A count before the command can be used to repeat. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 46 | |
| 47 | *[s* |
Bram Moolenaar | 9d0ec2e | 2005-04-20 19:45:58 +0000 | [diff] [blame] | 48 | [s Like "]s" but search backwards, find the misspelled |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 49 | word before the cursor. Doesn't recognize words |
| 50 | split over two lines, thus may stop at words that are |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 51 | not highlighted as bad. Does not stop at word with |
| 52 | missing capital at the start of a line. |
Bram Moolenaar | 9d0ec2e | 2005-04-20 19:45:58 +0000 | [diff] [blame] | 53 | |
| 54 | *]S* |
| 55 | ]S Like "]s" but only stop at bad words, not at rare |
| 56 | words or words for another region. |
| 57 | |
| 58 | *[S* |
| 59 | [S Like "]S" but search backwards. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 60 | |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 61 | |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 62 | To add words to your own word list: *E764* |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 63 | |
| 64 | *zg* |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 65 | zg Add word under the cursor as a good word to the first |
| 66 | name in 'spellfile'. In Visual mode the selected |
| 67 | characters are added as a word (including white |
| 68 | space!). If the word is explicitly marked as bad word |
| 69 | in another spell file the result is unpredictable. |
| 70 | A count may precede the command to indicate the entry |
| 71 | in 'spellfile' to be used. A count of two uses the |
| 72 | second entry. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 73 | |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 74 | *zG* |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 75 | zG Like "zg" but add the word to the internal word list |
| 76 | |internal-wordlist|. |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 77 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 78 | *zw* |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 79 | zw Like "zg" but mark the word as a wrong (bad) word. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 80 | |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 81 | *zW* |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 82 | zW Like "zw" but add the word to the internal word list |
| 83 | |internal-wordlist|. |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 84 | |
Bram Moolenaar | 520470a | 2005-06-16 21:59:56 +0000 | [diff] [blame] | 85 | *:spe* *:spellgood* |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 86 | :[count]spe[llgood] {word} |
Bram Moolenaar | 53180ce | 2005-07-05 21:48:14 +0000 | [diff] [blame] | 87 | Add {word} as a good word to 'spellfile', like with |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 88 | "zg". Without count the first name is used, with a |
| 89 | count of two the second entry, etc. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 90 | |
Bram Moolenaar | 53180ce | 2005-07-05 21:48:14 +0000 | [diff] [blame] | 91 | :spe[llgood]! {word} Add {word} as a good word to the internal word list, |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 92 | like with "zG". |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 93 | |
Bram Moolenaar | 520470a | 2005-06-16 21:59:56 +0000 | [diff] [blame] | 94 | *:spellw* *:spellwrong* |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 95 | :[count]spellw[rong] {word} |
Bram Moolenaar | 53180ce | 2005-07-05 21:48:14 +0000 | [diff] [blame] | 96 | Add {word} as a wrong (bad) word to 'spellfile', as |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 97 | with "zw". Without count the first name is used, with |
| 98 | a count of two the second entry, etc. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 99 | |
Bram Moolenaar | 53180ce | 2005-07-05 21:48:14 +0000 | [diff] [blame] | 100 | :spellw[rong]! {word} Add {word} as a wrong (bad) word to the internal word |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 101 | list. |
| 102 | |
Bram Moolenaar | f461c8e | 2005-06-25 23:04:51 +0000 | [diff] [blame] | 103 | After adding a word to 'spellfile' with the above commands its associated |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 104 | ".spl" file will automatically be updated and reloaded. If you change |
| 105 | 'spellfile' manually you need to use the |:mkspell| command. This sequence of |
| 106 | commands mostly works well: > |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 107 | :edit <file in 'spellfile'> |
Bram Moolenaar | f461c8e | 2005-06-25 23:04:51 +0000 | [diff] [blame] | 108 | < (make changes to the spell file) > |
| 109 | :mkspell! % |
| 110 | |
| 111 | More details about the 'spellfile' format below |spell-wordlist-format|. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 112 | |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 113 | *internal-wordlist* |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 114 | The internal word list is used for all buffers where 'spell' is set. It is |
| 115 | not stored, it is lost when you exit Vim. It is also cleared when 'encoding' |
| 116 | is set. |
| 117 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 118 | |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 119 | Finding suggestions for bad words: |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 120 | *z?* |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 121 | z? For the word under/after the cursor suggest correctly |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 122 | spelled words. This also works to find alternatives |
| 123 | for a word that is not highlighted as a bad word, |
| 124 | e.g., when the word after it is bad. |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 125 | The results are sorted on similarity to the word |
| 126 | under/after the cursor. |
Bram Moolenaar | 90915b5 | 2005-08-21 22:17:52 +0000 | [diff] [blame] | 127 | This may take a long time. Hit CTRL-C when you get |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 128 | bored. |
Bram Moolenaar | 90915b5 | 2005-08-21 22:17:52 +0000 | [diff] [blame] | 129 | |
| 130 | If the command is used without a count the |
| 131 | alternatives are listed and you can enter the number |
| 132 | of your choice or press <Enter> if you don't want to |
| 133 | replace. You can also use the mouse to click on your |
| 134 | choice (only works if the mouse can be used in Normal |
| 135 | mode and when there are no line wraps). Click on the |
| 136 | first line (the header) to cancel. |
| 137 | |
| 138 | If a count is used that suggestion is used, without |
| 139 | prompting. For example, "1z?" always takes the first |
| 140 | suggestion. |
| 141 | |
| 142 | If 'verbose' is non-zero a score will be displayed |
| 143 | with the suggestions to indicate the likeliness to the |
| 144 | badly spelled word (the higher the score the more |
| 145 | different). |
Bram Moolenaar | d857f0e | 2005-06-21 22:37:39 +0000 | [diff] [blame] | 146 | When a word was replaced the redo command "." will |
| 147 | repeat the word replacement. This works like "ciw", |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 148 | the good word and <Esc>. This does NOT work for Thai |
| 149 | and other languages without spaces between words. |
Bram Moolenaar | d857f0e | 2005-06-21 22:37:39 +0000 | [diff] [blame] | 150 | |
Bram Moolenaar | 24bbcfe | 2005-06-28 23:32:02 +0000 | [diff] [blame] | 151 | *:spellr* *:spellrepall* *E752* *E753* |
| 152 | :spellr[epall] Repeat the replacement done by |z?| for all matches |
| 153 | with the replaced word in the current window. |
| 154 | |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 155 | In Insert mode, when the cursor is after a badly spelled word, you can use |
| 156 | CTRL-X s to find suggestions. This works like Insert mode completion. Use |
| 157 | CTRL-N to use the next suggestion, CTRL-P to go back. |i_CTRL-X_s| |
| 158 | |
Bram Moolenaar | d857f0e | 2005-06-21 22:37:39 +0000 | [diff] [blame] | 159 | The 'spellsuggest' option influences how the list of suggestions is generated |
| 160 | and sorted. See |'spellsuggest'|. |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 161 | |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 162 | The 'spellcapcheck' option is used to check the first word of a sentence |
| 163 | starts with a capital. This doesn't work for the first word in the file. |
| 164 | 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] | 165 | line may be postponed. Use |CTRL-L| when needed. Also see |set-spc-auto| for |
| 166 | how it can be set automatically when 'spelllang' is set. |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 167 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 168 | ============================================================================== |
| 169 | 2. Remarks on spell checking *spell-remarks* |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 170 | |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 171 | PERFORMANCE |
| 172 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 173 | Vim does on-the-fly spell checking. To make this work fast the word list is |
| 174 | loaded in memory. Thus this uses a lot of memory (1 Mbyte or more). There |
| 175 | might also be a noticeable delay when the word list is loaded, which happens |
| 176 | when 'spell' is set and when 'spelllang' is set while 'spell' was already set. |
| 177 | To minimize the delay each word list is only loaded once, it is not deleted |
| 178 | when 'spelllang' is made empty or 'spell' is reset. When 'encoding' is set |
| 179 | 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] | 180 | |
| 181 | |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 182 | REGIONS |
| 183 | |
| 184 | A word may be spelled differently in various regions. For example, English |
| 185 | comes in (at least) these variants: |
| 186 | |
| 187 | en all regions |
Bram Moolenaar | 5c5474b | 2005-04-19 21:40:26 +0000 | [diff] [blame] | 188 | en_au Australia |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 189 | en_ca Canada |
Bram Moolenaar | 5c5474b | 2005-04-19 21:40:26 +0000 | [diff] [blame] | 190 | en_gb Great Britain |
| 191 | en_nz New Zealand |
| 192 | en_us USA |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 193 | |
| 194 | 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] | 195 | highlighted with SpellLocal |hl-SpellLocal|. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 196 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 197 | Always use lowercase letters for the language and region names. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 198 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 199 | When adding a word with |zg| or another command it's always added for all |
| 200 | regions. You can change that by manually editing the 'spellfile'. See |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 201 | |spell-wordlist-format|. Note that the regions as specified in the files in |
| 202 | 'spellfile' are only used when all entries in "spelllang" specify the same |
| 203 | region (not counting files specified by their .spl name). |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 204 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 205 | *spell-german* |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 206 | Specific exception: For German these special regions are used: |
| 207 | de all German words accepted |
| 208 | de_de old and new spelling |
| 209 | de_19 old spelling |
| 210 | de_20 new spelling |
| 211 | de_at Austria |
| 212 | de_ch Switzerland |
| 213 | |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 214 | *spell-yiddish* |
| 215 | Yiddish requires using "utf-8" encoding, because of the special characters |
| 216 | used. If you are using latin1 Vim will use transliterated (romanized) Yiddish |
| 217 | instead. If you want to use transliterated Yiddish with utf-8 use "yi-tr". |
| 218 | In a table: |
| 219 | 'encoding' 'spelllang' |
| 220 | utf-8 yi Yiddish |
| 221 | latin1 yi transliterated Yiddish |
| 222 | utf-8 yi-tr transliterated Yiddish |
| 223 | |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 224 | |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 225 | SPELL FILES *spell-load* |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 226 | |
| 227 | 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] | 228 | 'runtimepath'. The name is: LL.EEE.spl, where: |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 229 | LL the language name |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 230 | EEE the value of 'encoding' |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 231 | |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 232 | The value for "LL" comes from 'spelllang', but excludes the region name. |
| 233 | Examples: |
| 234 | 'spelllang' LL ~ |
| 235 | en_us en |
| 236 | en-rare en-rare |
| 237 | medical_ca medical |
| 238 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 239 | Only the first file is loaded, the one that is first in 'runtimepath'. If |
| 240 | this succeeds then additionally files with the name LL.EEE.add.spl are loaded. |
| 241 | All the ones that are found are used. |
| 242 | |
Bram Moolenaar | 0d9c26d | 2005-07-02 23:19:16 +0000 | [diff] [blame] | 243 | Additionally, the files related to the names in 'spellfile' are loaded. These |
| 244 | 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] | 245 | |
Bram Moolenaar | 0e21a3f | 2005-04-17 20:28:32 +0000 | [diff] [blame] | 246 | Exceptions: |
| 247 | - Vim uses "latin1" when 'encoding' is "iso-8859-15". The euro sign doesn't |
| 248 | matter for spelling. |
| 249 | - When no spell file for 'encoding' is found "ascii" is tried. This only |
| 250 | works for languages where nearly all words are ASCII, such as English. It |
| 251 | 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] | 252 | is being edited. For the ".add" files the same name as the found main |
| 253 | spell file is used. |
| 254 | |
| 255 | For example, with these values: |
| 256 | 'runtimepath' is "~/.vim,/usr/share/vim70,~/.vim/after" |
| 257 | 'encoding' is "iso-8859-2" |
| 258 | 'spelllang' is "pl" |
| 259 | |
| 260 | Vim will look for: |
| 261 | 1. ~/.vim/spell/pl.iso-8859-2.spl |
| 262 | 2. /usr/share/vim70/spell/pl.iso-8859-2.spl |
| 263 | 3. ~/.vim/spell/pl.iso-8859-2.add.spl |
| 264 | 4. /usr/share/vim70/spell/pl.iso-8859-2.add.spl |
| 265 | 5. ~/.vim/after/spell/pl.iso-8859-2.add.spl |
| 266 | |
| 267 | This assumes 1. is not found and 2. is found. |
| 268 | |
| 269 | If 'encoding' is "latin1" Vim will look for: |
| 270 | 1. ~/.vim/spell/pl.latin1.spl |
| 271 | 2. /usr/share/vim70/spell/pl.latin1.spl |
| 272 | 3. ~/.vim/after/spell/pl.latin1.spl |
| 273 | 4. ~/.vim/spell/pl.ascii.spl |
| 274 | 5. /usr/share/vim70/spell/pl.ascii.spl |
| 275 | 6. ~/.vim/after/spell/pl.ascii.spl |
| 276 | |
| 277 | This assumes none of them are found (Polish doesn't make sense when leaving |
| 278 | out the non-ASCII characters). |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 279 | |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 280 | Spelling for EBCDIC is currently not supported. |
| 281 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 282 | A spell file might not be available in the current 'encoding'. See |
| 283 | |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] | 284 | with "iconv" will NOT work! |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 285 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 286 | *E758* *E759* |
| 287 | 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] | 288 | get an error the file may be truncated, modified or intended for another Vim |
| 289 | version. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 290 | |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 291 | |
| 292 | WORDS |
| 293 | |
| 294 | Vim uses a fixed method to recognize a word. This is independent of |
| 295 | 'iskeyword', so that it also works in help files and for languages that |
| 296 | include characters like '-' in 'iskeyword'. The word characters do depend on |
| 297 | 'encoding'. |
| 298 | |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 299 | The table with word characters is stored in the main .spl file. Therefore it |
| 300 | 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] | 301 | not contain a word table though. |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 302 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 303 | A word that starts with a digit is always ignored. That includes hex numbers |
| 304 | in the form 0xff and 0XFF. |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 305 | |
| 306 | |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 307 | WORD COMBINATIONS |
| 308 | |
| 309 | It is possible to spell-check words that include a space. This is used to |
| 310 | recognize words that are invalid when used by themselves, e.g. for "et al.". |
| 311 | It can also be used to recognize "the the" and highlight it. |
| 312 | |
| 313 | The number of spaces is irrelevant. In most cases a line break may also |
| 314 | appear. However, this makes it difficult to find out where to start checking |
| 315 | for spelling mistakes. When you make a change to one line and only that line |
| 316 | is redrawn Vim won't look in the previous line, thus when "et" is at the end |
| 317 | of the previous line "al." will be flagged as an error. And when you type |
| 318 | "the<CR>the" the highlighting doesn't appear until the first line is redrawn. |
| 319 | Use |CTRL-L| to redraw right away. "[s" will also stop at a word combination |
| 320 | with a line break. |
| 321 | |
| 322 | When encountering a line break Vim skips characters such as '*', '>' and '"', |
| 323 | so that comments in C, shell and Vim code can be spell checked. |
| 324 | |
| 325 | |
Bram Moolenaar | 9d0ec2e | 2005-04-20 19:45:58 +0000 | [diff] [blame] | 326 | SYNTAX HIGHLIGHTING *spell-syntax* |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 327 | |
| 328 | Files that use syntax highlighting can specify where spell checking should be |
| 329 | done: |
| 330 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 331 | 1. everywhere default |
| 332 | 2. in specific items use "contains=@Spell" |
| 333 | 3. everywhere but specific items use "contains=@NoSpell" |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 334 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 335 | For the second method adding the @NoSpell cluster will disable spell checking |
| 336 | again. This can be used, for example, to add @Spell to the comments of a |
| 337 | program, and add @NoSpell for items that shouldn't be checked. |
Bram Moolenaar | 6bb6836 | 2005-03-22 23:03:44 +0000 | [diff] [blame] | 338 | |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 339 | |
| 340 | VIM SCRIPTS |
| 341 | |
| 342 | If you want to write a Vim script that does something with spelling, you may |
| 343 | find these functions useful: |
| 344 | |
| 345 | spellbadword() find badly spelled word at the cursor |
| 346 | spellsuggest() get list of spelling suggestions |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 347 | soundfold() get the sound-a-like version of a word |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 348 | |
Bram Moolenaar | 90cfdbe | 2005-08-12 19:59:19 +0000 | [diff] [blame] | 349 | |
| 350 | SETTING 'spellcapcheck' AUTOMATICALLY *set-spc-auto* |
| 351 | |
| 352 | After the 'spelllang' option has been set successfully, Vim will source the |
| 353 | files "spell/LANG.vim" in 'runtimepath'. "LANG" is the value of 'spelllang' |
| 354 | up to the first comma, dot or underscore. This can be used to set options |
| 355 | specifically for the language, especially 'spellcapcheck'. |
| 356 | |
| 357 | The distribution includes a few of these files. Use this command to see what |
| 358 | they do: > |
| 359 | :next $VIMRUNTIME/spell/*.vim |
| 360 | |
| 361 | Note that the default scripts don't set 'spellcapcheck' if it was changed from |
| 362 | the default value. This assumes the user prefers another value then. |
| 363 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 364 | |
| 365 | DOUBLE SCORING *spell-double-scoring* |
| 366 | |
| 367 | The 'spellsuggest' option can be used to select "double" scoring. This |
| 368 | mechanism is based on the principle that there are two kinds of spelling |
| 369 | mistakes: |
| 370 | |
| 371 | 1. You know how to spell the word, but mistype something. This results in a |
| 372 | small editing distance (character swapped/omitted/inserted) and possibly a |
| 373 | word that sounds completely different. |
| 374 | |
| 375 | 2. You don't know how to spell the word and type something that sounds right. |
| 376 | The edit distance can be big but the word is similar after sound-folding. |
| 377 | |
| 378 | Since scores for these two mistakes will be very different we use a list |
| 379 | for each and mix them. |
| 380 | |
| 381 | The sound-folding is slow and people that know the language won't make the |
| 382 | second kind of mistakes. Therefore 'spellsuggest' can be set to select the |
| 383 | preferred method for scoring the suggestions. |
| 384 | |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 385 | ============================================================================== |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 386 | 3. Generating a spell file *spell-mkspell* |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 387 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 388 | Vim uses a binary file format for spelling. This greatly speeds up loading |
| 389 | the word list and keeps it small. |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 390 | *.aff* *.dic* *Myspell* |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 391 | You can create a Vim spell file from the .aff and .dic files that Myspell |
| 392 | uses. Myspell is used by OpenOffice.org and Mozilla. You should be able to |
| 393 | find them here: |
| 394 | http://lingucomponent.openoffice.org/spell_dic.html |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 395 | 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] | 396 | depends on what word lists you can find. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 397 | |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 398 | If you install Aap (from www.a-a-p.org) you can use the recipes in the |
| 399 | runtime/spell/??/ directories. Aap will take care of downloading the files, |
| 400 | apply patches needed for Vim and build the .spl file. |
| 401 | |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 402 | Make sure your current locale is set properly, otherwise Vim doesn't know what |
| 403 | characters are upper/lower case letters. If the locale isn't available (e.g., |
| 404 | 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] | 405 | |spell-affix-chars|. If the .aff file doesn't define a table then the word |
| 406 | table of the currently active spelling is used. If spelling is not active |
| 407 | then Vim will try to guess. |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 408 | |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 409 | *:mksp* *:mkspell* |
| 410 | :mksp[ell][!] [-ascii] {outname} {inname} ... |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 411 | Generate a Vim spell file word lists. Example: > |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 412 | :mkspell /tmp/nl nl_NL.words |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 413 | < *E751* |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 414 | When {outname} ends in ".spl" it is used as the output |
| 415 | file name. Otherwise it should be a language name, |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 416 | such as "en", without the region name. The file |
| 417 | written will be "{outname}.{encoding}.spl", where |
| 418 | {encoding} is the value of the 'encoding' option. |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 419 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 420 | When the output file already exists [!] must be used |
Bram Moolenaar | 520470a | 2005-06-16 21:59:56 +0000 | [diff] [blame] | 421 | to overwrite it. |
| 422 | |
Bram Moolenaar | 0e21a3f | 2005-04-17 20:28:32 +0000 | [diff] [blame] | 423 | When the [-ascii] argument is present, words with |
| 424 | non-ascii characters are skipped. The resulting file |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 425 | ends in "ascii.spl". |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 426 | |
| 427 | The input can be the Myspell format files {inname}.aff |
| 428 | and {inname}.dic. If {inname}.aff does not exist then |
| 429 | {inname} is used as the file name of a plain word |
| 430 | list. |
| 431 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 432 | Multiple {inname} arguments can be given to combine |
| 433 | regions into one Vim spell file. Example: > |
| 434 | :mkspell ~/.vim/spell/en /tmp/en_US /tmp/en_CA /tmp/en_AU |
| 435 | < This combines the English word lists for US, CA and AU |
| 436 | into one en.spl file. |
| 437 | Up to eight regions can be combined. *E754* *755* |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 438 | The REP and SAL items of the first .aff file where |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 439 | they appear are used. |spell-REP| |spell-SAL| |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 440 | |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 441 | This command uses a lot of memory, required to find |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 442 | the optimal word tree (Polish, Italian and Hungarian |
| 443 | require several hundred Mbyte). The final result will |
| 444 | be much smaller, because compression is used. To |
| 445 | avoid running out of memory compression will be done |
| 446 | now and then. This can be tuned with the 'mkspellmem' |
| 447 | option. |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 448 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 449 | After the spell file was written and it was being used |
| 450 | in a buffer it will be reloaded automatically. |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 451 | |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 452 | :mksp[ell] [-ascii] {name}.{enc}.add |
| 453 | Like ":mkspell" above, using {name}.{enc}.add as the |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 454 | input file and producing an output file in the same |
| 455 | directory that has ".spl" appended. |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 456 | |
| 457 | :mksp[ell] [-ascii] {name} |
| 458 | Like ":mkspell" above, using {name} as the input file |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 459 | and producing an output file in the same directory |
| 460 | that has ".{enc}.spl" appended. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 461 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 462 | Vim will report the number of duplicate words. This might be a mistake in the |
| 463 | list of words. But sometimes it is used to have different prefixes and |
| 464 | 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] | 465 | this). If you want Vim to report all duplicate words set the 'verbose' |
| 466 | option. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 467 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 468 | Since you might want to change a Myspell word list for use with Vim the |
| 469 | following procedure is recommended: |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 470 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 471 | 1. Obtain the xx_YY.aff and xx_YY.dic files from Myspell. |
| 472 | 2. Make a copy of these files to xx_YY.orig.aff and xx_YY.orig.dic. |
| 473 | 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] | 474 | words, define word characters with FOL/LOW/UPP, etc. The distributed |
| 475 | "src/spell/*.diff" files can be used. |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 476 | 4. Start Vim with the right locale and use |:mkspell| to generate the Vim |
| 477 | spell file. |
| 478 | 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] | 479 | 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] | 480 | wrote it somewhere else. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 481 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 482 | When the Myspell files are updated you can merge the differences: |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 483 | 1. Obtain the new Myspell files as xx_YY.new.aff and xx_UU.new.dic. |
| 484 | 2. Use Vimdiff to see what changed: > |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 485 | vimdiff xx_YY.orig.dic xx_YY.new.dic |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 486 | 3. Take over the changes you like in xx_YY.dic. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 487 | You may also need to change xx_YY.aff. |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 488 | 4. Rename xx_YY.new.dic to xx_YY.orig.dic and xx_YY.new.aff to xx_YY.new.aff. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 489 | |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 490 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 491 | SPELL FILE VERSIONS *E770* *E771* *E772* |
| 492 | |
| 493 | Spell checking is a relatively new feature in Vim, thus it's possible that the |
| 494 | .spl file format will be changed to support more languages. Vim will check |
| 495 | the validity of the spell file and report anything wrong. |
| 496 | |
| 497 | E771: Old spell file, needs to be updated ~ |
| 498 | This spell file is older than your Vim. You need to update the .spl file. |
| 499 | |
| 500 | E772: Spell file is for newer version of Vim ~ |
| 501 | This means the spell file was made for a later version of Vim. You need to |
| 502 | update Vim. |
| 503 | |
| 504 | E770: Unsupported section in spell file ~ |
| 505 | This means the spell file was made for a later version of Vim and contains a |
| 506 | section that is required for the spell file to work. In this case it's |
| 507 | probably a good idea to upgrade your Vim. |
| 508 | |
| 509 | |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 510 | SPELL FILE DUMP |
| 511 | |
| 512 | If for some reason you want to check what words are supported by the currently |
| 513 | used spelling files, use this command: |
| 514 | |
| 515 | *:spelldump* *:spelld* |
| 516 | :spelld[ump] Open a new window and fill it with all currently valid |
| 517 | words. |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 518 | Note: For some languages the result may be enormous, |
| 519 | causing Vim to run out of memory. |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 520 | |
| 521 | The format of the word list is used |spell-wordlist-format|. You should be |
| 522 | able to read it with ":mkspell" to generate one .spl file that includes all |
| 523 | the words. |
| 524 | |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 525 | When all entries to 'spelllang' use the same regions or no regions at all then |
| 526 | the region information is included in the dumped words. Otherwise only words |
| 527 | for the current region are included and no "/regions" line is generated. |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 528 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 529 | Comment lines with the name of the .spl file are used as a header above the |
| 530 | words that were generated from that .spl file. |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 531 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 532 | ============================================================================== |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 533 | 4. Spell file format *spell-file-format* |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 534 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 535 | This is the format of the files that are used by the person who creates and |
| 536 | maintains a word list. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 537 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 538 | Note that we avoid the word "dictionary" here. That is because the goal of |
| 539 | spell checking differs from writing a dictionary (as in the book). For |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 540 | spelling we need a list of words that are OK, thus should not to be |
| 541 | highlighted. Person and company names will not appear in a dictionary, but do |
| 542 | appear in a word list. And some old words are rarely used while they are |
| 543 | common 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] | 544 | |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 545 | 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] | 546 | compression. The files with affix compression are used by Myspell (Mozilla |
| 547 | and OpenOffice.org). This requires two files, one with .aff and one with .dic |
| 548 | extension. |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 549 | |
| 550 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 551 | FORMAT OF STRAIGHT WORD LIST *spell-wordlist-format* |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 552 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 553 | 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] | 554 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 555 | Additionally the following items are recognized: |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 556 | |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 557 | - Empty and blank lines are ignored. |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 558 | |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 559 | - Lines starting with a # are ignored (comment lines). |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 560 | |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 561 | - A line starting with "/encoding=", before any word, specifies the encoding |
| 562 | 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] | 563 | to setup conversion from the specified encoding to 'encoding'. Thus you can |
| 564 | use one word list for several target encodings. |
| 565 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 566 | - A line starting with "/regions=" specifies the region names that are |
| 567 | supported. Each region name must be two ASCII letters. The first one is |
| 568 | 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] | 569 | In an addition word list the region names should be equal to the main word |
| 570 | list! |
| 571 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 572 | - Other lines starting with '/' are reserved for future use. The ones that |
| 573 | are not recognized are ignored (but you do get a warning message). |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 574 | |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 575 | - A "/" may follow the word with the following items: |
| 576 | = Case must match exactly. |
| 577 | ? Rare word. |
| 578 | ! Bad (wrong) word. |
| 579 | digit A region in which the word is valid. If no regions are |
| 580 | specified the word is valid in all regions. |
| 581 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 582 | Example: |
| 583 | |
| 584 | # This is an example word list comment |
| 585 | /encoding=latin1 encoding of the file |
| 586 | /regions=uscagb regions "us", "ca" and "gb" |
| 587 | example word for all regions |
Bram Moolenaar | 1f8a5f0 | 2005-07-01 22:41:52 +0000 | [diff] [blame] | 588 | blah/12 word for regions "us" and "ca" |
| 589 | vim/! bad word |
| 590 | Campbell/?3 rare word in region 3 "gb" |
| 591 | 's mornings/= keep-case word |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 592 | |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 593 | Note that when "/=" is used the same word with all upper-case letters is not |
| 594 | accepted. This is different from a word with mixed case that is automatically |
| 595 | marked as keep-case, those words may appear in all upper-case letters. |
| 596 | |
Bram Moolenaar | 75c50c4 | 2005-06-04 22:06:24 +0000 | [diff] [blame] | 597 | |
| 598 | FORMAT WITH AFFIX COMPRESSION |
| 599 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 600 | There are two files: the basic word list and an affix file. The affixes are |
| 601 | used to modify the basic words to get the full word list. This significantly |
| 602 | reduces the number of words, especially for a language like Polish. This is |
| 603 | called affix compression. |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 604 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 605 | The basic word list and the affix file are combined and turned into a binary |
| 606 | spell file. All the preprocessing has been done, thus this file loads fast. |
| 607 | The binary spell file format is described in the source code (src/spell.c). |
| 608 | But only developers need to know about it. |
| 609 | |
| 610 | The preprocessing also allows us to take the Myspell language files and modify |
| 611 | them before the Vim word list is made. The tools for this can be found in the |
| 612 | "src/spell" directory. |
| 613 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 614 | The format for the affix and word list files is based on what Myspell uses |
| 615 | (the spell checker of Mozilla and OpenOffice.org). A description can be found |
| 616 | here: |
| 617 | http://lingucomponent.openoffice.org/affix.readme ~ |
| 618 | Note that affixes are case sensitive, this isn't obvious from the description. |
| 619 | |
| 620 | Vim does not use the TRY item, it is ignored. For making suggestions the |
| 621 | possible characters in the words are used. |
| 622 | |
| 623 | Vim supports quite a few extras. They are described below |spell-affix-vim|. |
| 624 | Attempts have been made to keep this compatible with other spell checkers, so |
| 625 | that the same files can be used. |
| 626 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 627 | |
Bram Moolenaar | 3638c68 | 2005-06-08 22:05:14 +0000 | [diff] [blame] | 628 | WORD LIST FORMAT *spell-dic-format* |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 629 | |
| 630 | A very short example, with line numbers: |
| 631 | |
| 632 | 1 1234 |
| 633 | 2 aan |
| 634 | 3 Als |
| 635 | 4 Etten-Leur |
| 636 | 5 et al. |
| 637 | 6 's-Gravenhage |
| 638 | 7 's-Gravenhaags |
| 639 | 8 bedel/P |
| 640 | 9 kado/1 |
| 641 | 10 cadeau/2 |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 642 | 11 TCP,IP |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 643 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 644 | The first line contains the number of words. Vim ignores it, but you do get |
| 645 | an error message if it's not there. *E760* |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 646 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 647 | What follows is one word per line. There should be no white space before or |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 648 | after the word. After the word there is an optional slash and flags. Most of |
| 649 | these flags are letters that indicate the affixes that can be used with this |
| 650 | word. These are specified with SFX and PFX lines in the .aff file. See the |
| 651 | Myspell documentation. Vim allows using other flag types with the FLAG item |
| 652 | in the affix file |spell-FLAG|. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 653 | |
| 654 | When the word only has lower-case letters it will also match with the word |
| 655 | starting with an upper-case letter. |
| 656 | |
| 657 | When the word includes an upper-case letter, this means the upper-case letter |
| 658 | is required at this position. The same word with a lower-case letter at this |
| 659 | position will not match. When some of the other letters are upper-case it will |
| 660 | not match either. |
| 661 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 662 | The word with all upper-case characters will always be OK. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 663 | |
| 664 | word list matches does not match ~ |
| 665 | als als Als ALS ALs AlS aLs aLS |
| 666 | Als Als ALS als ALs AlS aLs aLS |
| 667 | ALS ALS als Als ALs AlS aLs aLS |
| 668 | AlS AlS ALS als Als ALs aLs aLS |
| 669 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 670 | The KEP affix ID can be used to specifically match a word with identical case |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 671 | only, see below |spell-KEP|. |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 672 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 673 | Note in line 5 to 7 that non-word characters are used. You can include |
| 674 | any character in a word. When checking the text a word still only matches |
| 675 | when it appears with a non-word character before and after it. For Myspell a |
| 676 | word starting with a non-word character probably won't work. |
| 677 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 678 | In line 12 the word "TCP/IP" is defined. Since the slash has a special |
| 679 | meaning the comma is used instead. This is defined with the SLASH item in the |
| 680 | affix file, see |spell-SLASH|. Note that without this SLASH item the |
| 681 | word will be "TCP,IP". |
| 682 | |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 683 | *spell-affix-vim* |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 684 | A flag that Vim adds and is not in Myspell is the flag defined with KEP in the |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 685 | affix file. This has the meaning that case matters. This can be used if the |
| 686 | word does not have the first letter in upper case at the start of a sentence. |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 687 | Example (assuming that = was used for KEP): |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 688 | |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 689 | word list matches does not match ~ |
| 690 | 's morgens/= 's morgens 'S morgens 's Morgens 'S MORGENS |
| 691 | 's Morgens 's Morgens 'S MORGENS 'S morgens 's morgens |
| 692 | |
| 693 | The flag can also be used to avoid that the word matches when it is in all |
| 694 | upper-case letters. |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 695 | |
| 696 | *spell-affix-mbyte* |
| 697 | The basic word list is normally in an 8-bit encoding, which is mentioned in |
| 698 | the affix file. The affix file must always be in the same encoding as the |
| 699 | word list. This is compatible with Myspell. For Vim the encoding may also be |
| 700 | something else, any encoding that "iconv" supports. The "SET" line must |
| 701 | specify the name of the encoding. When using a multi-byte encoding it's |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 702 | possible to use more different affixes (but Myspell doesn't support that, thus |
| 703 | you may not want to use it anyway). |
Bram Moolenaar | 13fcaaf | 2005-04-15 21:13:42 +0000 | [diff] [blame] | 704 | |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 705 | |
| 706 | CHARACTER TABLES |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 707 | *spell-affix-chars* |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 708 | When using an 8-bit encoding the affix file should define what characters are |
| 709 | word characters (as specified with ENC). This is because the system where |
| 710 | ":mkspell" is used may not support a locale with this encoding and isalpha() |
| 711 | won't work. For example when using "cp1250" on Unix. |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 712 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 713 | *E761* *E762* *spell-FOL* |
| 714 | *spell-LOW* *spell-UPP* |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 715 | Three lines in the affix file are needed. Simplistic example: |
| 716 | |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 717 | FOL áëñ ~ |
| 718 | LOW áëñ ~ |
| 719 | UPP ÁËÑ ~ |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 720 | |
| 721 | All three lines must have exactly the same number of characters. |
| 722 | |
| 723 | The "FOL" line specifies the case-folded characters. These are used to |
| 724 | compare words while ignoring case. For most encodings this is identical to |
| 725 | the lower case line. |
| 726 | |
| 727 | The "LOW" line specifies the characters in lower-case. Mostly it's equal to |
| 728 | the "FOL" line. |
| 729 | |
| 730 | The "UPP" line specifies the characters with upper-case. That is, a character |
| 731 | is upper-case where it's different from the character at the same position in |
| 732 | "FOL". |
| 733 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 734 | An exception is made for the German sharp s ß. The upper-case version is |
| 735 | "SS". In the FOL/LOW/UPP lines it should be included, so that it's recognized |
| 736 | as a word character, but use the ß character in all three. |
| 737 | |
Bram Moolenaar | 0cb032e | 2005-04-23 20:52:00 +0000 | [diff] [blame] | 738 | ASCII characters should be omitted, Vim always handles these in the same way. |
| 739 | When the encoding is UTF-8 no word characters need to be specified. |
| 740 | |
| 741 | *E763* |
Bram Moolenaar | 3b50694 | 2005-06-23 22:36:45 +0000 | [diff] [blame] | 742 | Vim allows you to use spell checking for several languages in the same file. |
| 743 | You can list them in the 'spelllang' option. As a consequence all spell files |
| 744 | for the same encoding must use the same word characters, otherwise they can't |
| 745 | be combined without errors. If you get a warning that the word tables differ |
| 746 | you may need to generate the .spl file again with |:mkspell|. Check the FOL, |
| 747 | LOW and UPP lines in the used .aff file. |
| 748 | |
| 749 | The XX.ascii.spl spell file generated with the "-ascii" argument will not |
| 750 | contain the table with characters, so that it can be combine with spell files |
| 751 | 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] | 752 | |
Bram Moolenaar | e756604 | 2005-06-17 22:00:15 +0000 | [diff] [blame] | 753 | |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 754 | MID-WORD CHARACTERS |
| 755 | *spell-midword* |
| 756 | Some characters are only to be considered word characters if they are used in |
| 757 | between two ordinary word characters. An example is the single quote: It is |
| 758 | often used to put text in quotes, thus it can't be recognized as a word |
| 759 | character, but when it appears in between word characters it must be part of |
| 760 | the word. This is needed to detect a spelling error such as they'are. That |
| 761 | should be they're, but since "they" and "are" are words themselves that would |
| 762 | go unnoticed. |
| 763 | |
| 764 | These characters are defined with MIDWORD in the .aff file: |
| 765 | |
| 766 | MIDWORD '- ~ |
| 767 | |
| 768 | |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 769 | FLAG TYPES *spell-FLAG* |
| 770 | |
| 771 | Flags are used to specify the affixes that can be used with a word and for |
| 772 | other properties of the word. Normally single-character flags are used. This |
| 773 | limits the number of possible flags, especially for 8-bit encodings. The FLAG |
| 774 | item can be used if more affixes are to be used. Possible values: |
| 775 | |
| 776 | FLAG long use two-character flags |
| 777 | FLAG num use numbers, from 1 up to 65000 |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame^] | 778 | FLAG caplong use one-character flags without A-Z and two-character |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 779 | flags that start with A-Z |
| 780 | |
| 781 | With "FLAG num" the numbers in a list of affixes need to be separated with a |
| 782 | comma: "234,2143,1435". This method is inefficient, but useful if the file is |
| 783 | generated with a program. |
| 784 | |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame^] | 785 | When using "caplong" the two-character flags all start with a capital: "Aa", |
| 786 | "B1", "BB", etc. This is useful to use one-character flags for the most |
| 787 | common items and two-character flags for uncommon items. |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 788 | |
| 789 | Note: When using utf-8 only characters up to 65000 may be used for flags. |
| 790 | |
| 791 | |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 792 | AFFIXES |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 793 | *spell-PFX* *spell-SFX* |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 794 | 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] | 795 | documentation or the Aspell manual: |
| 796 | http://aspell.net/man-html/Affix-Compression.html). |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 797 | |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 798 | Note that Myspell ignores any extra text after the relevant info. Vim |
| 799 | requires this text to start with a "#" so that mistakes don't go unnoticed. |
| 800 | Example: |
| 801 | |
| 802 | SFX F 0 in [^i]n # Spion > Spionin ~ |
| 803 | SFX F 0 nen in # Bauerin > Bauerinnen ~ |
| 804 | |
Bram Moolenaar | 81f1ecb | 2005-08-25 21:27:31 +0000 | [diff] [blame^] | 805 | Apparently Myspell allows an affix name to appear more than once. Since this |
| 806 | might also be a mistake, Vim checks for an extra "S". The affix files for |
| 807 | Myspell that use this feature apparently have this flag. Example: |
| 808 | |
| 809 | SFX a Y 1 S ~ |
| 810 | SFX a 0 an . ~ |
| 811 | |
| 812 | SFX a Y 2 S ~ |
| 813 | SFX a 0 en . ~ |
| 814 | SFX a 0 on . ~ |
| 815 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 816 | *spell-affix-rare* |
Bram Moolenaar | 9a50b1b | 2005-06-27 22:48:21 +0000 | [diff] [blame] | 817 | An extra item for Vim is the "rare" flag. It must come after the other |
| 818 | fields, before a comment. When used then all words that use the affix will be |
| 819 | marked as rare words. Example: |
| 820 | |
| 821 | PFX F 0 nene . rare ~ |
| 822 | SFX F 0 oin n rare # hardly ever used ~ |
| 823 | |
| 824 | However, if the word also appears as a good word in another way it won't be |
| 825 | marked as rare. |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 826 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 827 | *spell-affix-nocomp* |
| 828 | Another extra item for Vim is the "nocomp" flag. It must come after the other |
Bram Moolenaar | 90915b5 | 2005-08-21 22:17:52 +0000 | [diff] [blame] | 829 | fields, before a comment. It can be either before or after "rare". When |
| 830 | present then all words that use the affix will not be part of a compound word. |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 831 | Example: |
| 832 | affix file: |
| 833 | COMPOUNDFLAG c ~ |
| 834 | SFX a Y 2 ~ |
| 835 | SFX a 0 s . ~ |
| 836 | SFX a 0 ize . nocomp ~ |
| 837 | dictionary: |
| 838 | word/c ~ |
| 839 | util/ac ~ |
| 840 | |
| 841 | This allows for "wordutil" and "wordutils" but not "wordutilize". |
| 842 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 843 | *spell-PFXPOSTPONE* |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 844 | When an affix file has very many prefixes that apply to many words it's not |
| 845 | possible to build the whole word list in memory. This applies to Hebrew (a |
| 846 | list with all words is over a Gbyte). In that case applying prefixes must be |
| 847 | postponed. This makes spell checking slower. It is indicated by this keyword |
| 848 | in the .aff file: |
| 849 | |
| 850 | PFXPOSTPONE ~ |
| 851 | |
| 852 | Only prefixes without a chop string can be postponed, prefixes with a chop |
Bram Moolenaar | 78984f5 | 2005-08-01 07:19:10 +0000 | [diff] [blame] | 853 | string will still be included in the word list. An exception if the chop |
| 854 | string is one character and equal to the last character of the added string, |
| 855 | but in lower case. Thus when the chop string is used to allow the following |
| 856 | word to start with an upper case letter. |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 857 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 858 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 859 | WORDS WITH A SLASH *spell-SLASH* |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 860 | |
| 861 | The slash is used in the .dic file to separate the basic word from the affix |
| 862 | letters that can be used. Unfortunately, this means you cannot use a slash in |
| 863 | a word. Thus "TCP/IP" cannot be a word. To work around that you can define a |
| 864 | replacement character for the slash. Example: |
| 865 | |
| 866 | SLASH , ~ |
| 867 | |
| 868 | Now you can use "TCP,IP" to add the word "TCP/IP". |
| 869 | |
| 870 | Of course, the letter used should itself not appear in any word! The letter |
| 871 | must be ASCII, thus a single byte. |
| 872 | |
| 873 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 874 | KEEP-CASE WORDS *spell-KEP* |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 875 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 876 | In the affix file a KEP line can be used to define the affix name used for |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 877 | keep-case words. Example: |
| 878 | |
Bram Moolenaar | 82cf9b6 | 2005-06-07 21:09:25 +0000 | [diff] [blame] | 879 | KEP = ~ |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 880 | |
| 881 | See above for an example |spell-affix-vim|. |
| 882 | |
Bram Moolenaar | e13305e | 2005-06-19 22:54:15 +0000 | [diff] [blame] | 883 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 884 | RARE WORDS *spell-RAR* |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 885 | |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 886 | In the affix file a RAR line can be used to define the affix name used for |
| 887 | rare words. Example: |
| 888 | |
| 889 | RAR ? ~ |
| 890 | |
| 891 | Rare words are highlighted differently from bad words. This is to be used for |
| 892 | 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] | 893 | a typing mistake anyway. When the same word is found as good it won't be |
| 894 | highlighted as rare. |
| 895 | |
| 896 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 897 | BAD WORDS *spell-BAD* |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 898 | |
Bram Moolenaar | 30abd28 | 2005-06-22 22:35:10 +0000 | [diff] [blame] | 899 | In the affix file a BAD line can be used to define the affix name used for |
| 900 | bad words. Example: |
| 901 | |
| 902 | BAD ! ~ |
| 903 | |
| 904 | 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] | 905 | "the the" in the .dic file: |
| 906 | |
| 907 | the the/! ~ |
| 908 | |
| 909 | Once a word has been marked as bad it won't be undone by encountering the same |
| 910 | word as good. |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 911 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 912 | *spell-NEEDAFFIX* |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 913 | The NEEDAFFIX flag is used to require that a word is used with an affix. The |
| 914 | word itself is not a good word. Example: |
| 915 | |
| 916 | NEEDAFFIX + ~ |
| 917 | |
Bram Moolenaar | 45eeb13 | 2005-06-06 21:59:07 +0000 | [diff] [blame] | 918 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 919 | COMPOUND WORDS *spell-compound* |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 920 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 921 | A compound word is a longer word made by concatenating words that appear in |
| 922 | the .dic file. To specify which words may be concatenated a character is |
| 923 | used. This character is put in the list of affixes after the word. We will |
| 924 | call this character a flag here. Obviously these flags must be different from |
| 925 | any affix IDs used. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 926 | |
| 927 | *spell-COMPOUNDFLAG* |
| 928 | The Myspell compatible method uses one flag, specified with COMPOUNDFLAG. |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 929 | All words with this flag combine in any order. This means there is no control |
| 930 | over which word comes first. Example: |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 931 | COMPOUNDFLAG c ~ |
| 932 | |
| 933 | *spell-COMPOUNDFLAGS* |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 934 | A more advanced method to specify how compound words can be formed uses |
| 935 | multiple items with multiple flags. This is not compatible with Myspell 3.0. |
| 936 | Let's start with an example: |
| 937 | COMPOUNDFLAGS c+ ~ |
| 938 | COMPOUNDFLAGS se ~ |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 939 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 940 | The first line defines that words with the "c" flag can be concatenated in any |
| 941 | order. The second line defines compound words that are made of one word with |
| 942 | the "s" flag and one word with the "e" flag. With this dictionary: |
| 943 | bork/c ~ |
| 944 | onion/s ~ |
| 945 | soup/e ~ |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 946 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 947 | You can make these words: |
| 948 | bork |
| 949 | borkbork |
| 950 | borkborkbork |
| 951 | (etc.) |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 952 | onion |
| 953 | soup |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 954 | onionsoup |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 955 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 956 | The COMPOUNDFLAGS item may appear multiple times. The argument is made out of |
| 957 | one or more groups, where each group can be: |
| 958 | one flag e.g., c |
| 959 | alternate flags inside [] e.g., [abc] |
| 960 | Optionally this may be followed by: |
| 961 | * the group appears zero or more times, e.g., sm*e |
| 962 | + the group appears one or more times, e.g., c+ |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 963 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 964 | This is similar to the regexp pattern syntax (but not the same!). A few |
| 965 | examples with the sequence of word flags they require: |
| 966 | COMPOUNDFLAGS x+ x xx xxx etc. |
| 967 | COMPOUNDFLAGS yz yz |
| 968 | COMPOUNDFLAGS x+z xz xxz xxxz etc. |
| 969 | COMPOUNDFLAGS yx+ yx yxx yxxx etc. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 970 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 971 | COMPOUNDFLAGS [abc]z az bz cz |
| 972 | COMPOUNDFLAGS [abc]+z az aaz abaz bz baz bcbz cz caz cbaz etc. |
| 973 | COMPOUNDFLAGS a[xyz]+ ax axx axyz ay ayx ayzz az azy azxy etc. |
| 974 | COMPOUNDFLAGS sm*e se sme smme smmme etc. |
| 975 | COMPOUNDFLAGS 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] | 976 | |
Bram Moolenaar | a6c840d | 2005-08-22 22:59:46 +0000 | [diff] [blame] | 977 | A specific example: Allow a compound to be made of two words and a dash: |
| 978 | In the .aff file: |
| 979 | COMPOUNDFLAGS sde ~ |
| 980 | NEEDAFFIX x ~ |
| 981 | COMPOUNDMAX 3 ~ |
| 982 | COMPOUNDMIN 1 ~ |
| 983 | In the .dic file: |
| 984 | start/s ~ |
| 985 | end/e ~ |
| 986 | -/xd ~ |
| 987 | |
| 988 | This allows for the word "start-end", but not "startend". |
| 989 | |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 990 | *spell-COMPOUNDMIN* |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 991 | The minimal byte length of a word used for concatenation is specified with |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 992 | COMPOUNDMIN. Example: |
| 993 | COMPOUNDMIN 5 ~ |
| 994 | |
| 995 | When omitted a minimal length of 3 bytes is used. Obviously you could just |
| 996 | leave out the compound flag from short words instead, this feature is present |
| 997 | for compatibility with Myspell. |
| 998 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 999 | *spell-COMPOUNDMAX* |
| 1000 | The maximum number of words that can be concatenated into a compound word is |
| 1001 | specified with COMPOUNDMAX. Example: |
| 1002 | COMPOUNDMAX 3 ~ |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1003 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1004 | When omitted there is no maximum. It applies to all compound words. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1005 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1006 | To set a limit for words with specific flags make sure the items in |
| 1007 | COMPOUNDFLAGS where they appear don't allow too many words. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1008 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1009 | *spell-COMPOUNDSYLMAX* |
| 1010 | The maximum number of syllables that a compound word may contain is specified |
| 1011 | with COMPOUNDSYLMAX. Example: |
| 1012 | COMPOUNDSYLMAX 6 ~ |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1013 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1014 | This has no effect if there is no SYLLABLE item. Without COMPOUNDSYLMAX there |
| 1015 | is no limit on the number of syllables. |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1016 | |
Bram Moolenaar | a6c840d | 2005-08-22 22:59:46 +0000 | [diff] [blame] | 1017 | If both COMPOUNDMAX and COMPOUNDSYLMAX are defined, a compound word is |
| 1018 | accepted if it fits one of the criteria, thus is either made from up to |
| 1019 | COMPOUNDMAX words or contains up to COMPOUNDSYLMAX syllables. |
| 1020 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1021 | *spell-SYLLABLE* |
| 1022 | The SYLLABLE item defines characters or character sequences that are used to |
| 1023 | count the number of syllables in a word. Example: |
| 1024 | 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] | 1025 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1026 | Before the first slash is the set of characters that are counted for one |
| 1027 | syllable, also when repeated and mixed, until the next character that is not |
| 1028 | in this set. After the slash come sequences of characters that are counted |
| 1029 | for one syllable. These are preferred over using characters from the set. |
| 1030 | With the example "ideeen" has three syllables, counted by "i", "ee" and "e". |
| 1031 | |
| 1032 | Only case-folded letters need to be included. |
| 1033 | |
| 1034 | Above another way to restrict compounding was mentioned above: adding "nocomp" |
| 1035 | after an affix causes all words that are made with that affix not be be used |
| 1036 | for compounding. |spell-affix-nocomp| |
| 1037 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1038 | |
| 1039 | UNLIMITED COMPOUNDING *spell-NOBREAK* |
| 1040 | |
| 1041 | For some languages, such as Thai, there is no space in between words. This |
| 1042 | looks like all words are compounded. To specify this use the NOBREAK item in |
| 1043 | the affix file, without arguments: |
| 1044 | NOBREAK ~ |
| 1045 | |
| 1046 | Vim will try to figure out where one word ends and a next starts. When there |
| 1047 | are spelling mistakes this may not be quite right. |
| 1048 | |
Bram Moolenaar | 8aff23a | 2005-08-19 20:40:30 +0000 | [diff] [blame] | 1049 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
| 1050 | NOTE: The following has not been implemented yet, because there are no word |
| 1051 | lists that support this. |
| 1052 | > *spell-CMP* |
| 1053 | > Sometimes it is necessary to change a word when concatenating it to another, |
| 1054 | > by removing a few letters, inserting something or both. It can also be useful |
| 1055 | > to restrict concatenation to words that match a pattern. For this purpose CMP |
| 1056 | > items can be used. They look like this: |
| 1057 | > CMP {flag} {flags} {strip} {strip2} {add} {cond} {cond2} |
| 1058 | > |
| 1059 | > {flag} the flag, as used in COMPOUNDFLAGS for the lead word |
| 1060 | > {flags} accepted flags for the following word ('.' to accept |
| 1061 | > all) |
| 1062 | > {strip} text to remove from the end of the lead word (zero |
| 1063 | > for no stripping) |
| 1064 | > {strip2} text to remove from the start of the following word |
| 1065 | > (zero for no stripping) |
| 1066 | > {add} text to insert between the words (zero for no |
| 1067 | > addition) |
| 1068 | > {cond} condition to match at the end of the lead word |
| 1069 | > {cond2} condition to match at the start of the following word |
| 1070 | > |
| 1071 | > This is the same as what is used for SFX and PFX items, with the extra {flags} |
| 1072 | > and {cond2} fields. Example: |
| 1073 | > CMP f mrt 0 - . . ~ |
| 1074 | > |
| 1075 | > When used with the food and dish word list above, this means that a dash is |
| 1076 | > inserted after each food item. Thus you get "onion-soup" and |
| 1077 | > "onion-tomato-salat". |
| 1078 | > |
| 1079 | > When there are CMP items for a compound flag the concatenation is only done |
| 1080 | > when a CMP item matches. |
| 1081 | > |
| 1082 | > When there are no CMP items for a compound flag, then all words will be |
| 1083 | > concatenated, as if there was an item: |
| 1084 | > CMP {flag} . 0 0 . . |
| 1085 | > |
| 1086 | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
Bram Moolenaar | ae5bce1 | 2005-08-15 21:41:48 +0000 | [diff] [blame] | 1087 | |
| 1088 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1089 | REPLACEMENTS *spell-REP* |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1090 | |
| 1091 | In the affix file REP items can be used to define common mistakes. This is |
| 1092 | used to make spelling suggestions. The items define the "from" text and the |
| 1093 | "to" replacement. Example: |
| 1094 | |
| 1095 | REP 4 ~ |
| 1096 | REP f ph ~ |
| 1097 | REP ph f ~ |
| 1098 | REP k ch ~ |
| 1099 | REP ch k ~ |
| 1100 | |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 1101 | The first line specifies the number of REP lines following. Vim ignores the |
| 1102 | number, but it must be there. |
| 1103 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 1104 | Don't include simple one-character replacements or swaps. Vim will try these |
| 1105 | anyway. You can include whole words if you want to, but you might want to use |
| 1106 | the "file:" item in 'spellsuggest' instead. |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1107 | |
| 1108 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1109 | SIMILAR CHARACTERS *spell-MAP* |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1110 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 1111 | 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] | 1112 | alike. This is mostly used for a letter with different accents. This is used |
| 1113 | to prefer suggestions with these letters substituted. Example: |
| 1114 | |
| 1115 | MAP 2 ~ |
| 1116 | MAP eéëêè ~ |
| 1117 | MAP uüùúû ~ |
| 1118 | |
Bram Moolenaar | 6e7c7f3 | 2005-08-24 22:16:11 +0000 | [diff] [blame] | 1119 | The first line specifies the number of MAP lines following. Vim ignores the |
| 1120 | number, but the line must be there. |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1121 | |
Bram Moolenaar | d042c56 | 2005-06-30 22:04:15 +0000 | [diff] [blame] | 1122 | Each letter must appear in only one of the MAP items. It's a bit more |
| 1123 | 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] | 1124 | |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1125 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1126 | SOUND-A-LIKE *spell-SAL* |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1127 | |
| 1128 | In the affix file SAL items can be used to define the sounds-a-like mechanism |
| 1129 | 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] | 1130 | Simplistic example: |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1131 | |
| 1132 | SAL CIA X ~ |
| 1133 | SAL CH X ~ |
| 1134 | SAL C K ~ |
| 1135 | SAL K K ~ |
| 1136 | |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 1137 | 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] | 1138 | how it works can be found in the Aspell manual: |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 1139 | http://aspell.net/man-html/Phonetic-Code.html. |
Bram Moolenaar | 9ba0eb8 | 2005-06-13 22:28:56 +0000 | [diff] [blame] | 1140 | |
| 1141 | There are a few special items: |
| 1142 | |
| 1143 | SAL followup true ~ |
| 1144 | SAL collapse_result true ~ |
| 1145 | SAL remove_accents true ~ |
| 1146 | |
| 1147 | "1" has the same meaning as "true". Any other value means "false". |
| 1148 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 1149 | |
Bram Moolenaar | 6f16eb8 | 2005-08-23 21:02:42 +0000 | [diff] [blame] | 1150 | SIMPLE SOUNDFOLDING *spell-SOFOFROM* *spell-SOFOTO* |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 1151 | |
| 1152 | The SAL mechanism is complex and slow. A simpler mechanism is mapping all |
| 1153 | characters to another character, mapping similar sounding characters to the |
| 1154 | 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] | 1155 | both SAL items and simple soundfolding. |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 1156 | |
Bram Moolenaar | 7d1f5db | 2005-07-03 21:39:27 +0000 | [diff] [blame] | 1157 | 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] | 1158 | and one that specifies the characters they are mapped to. They must have |
| 1159 | exactly the same number of characters. Example: |
| 1160 | |
| 1161 | SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ~ |
| 1162 | SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkes ~ |
| 1163 | |
| 1164 | 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] | 1165 | method would be to leave out all vowels. Some characters that sound nearly |
| 1166 | the same and are often mixed up, such as 'm' and 'n', are mapped to the same |
| 1167 | 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] | 1168 | |
| 1169 | Characters that do not appear in SOFOFROM will be left out, except that all |
| 1170 | white space is replaced by one space. Sequences of the same character in |
| 1171 | SOFOFROM are replaced by one. |
| 1172 | |
| 1173 | You can use the |soundfold()| function to try out the results. Or set the |
| 1174 | 'verbose' option to see the score in the output of the |z?| command. |
| 1175 | |
| 1176 | |
Bram Moolenaar | 217ad92 | 2005-03-20 22:37:15 +0000 | [diff] [blame] | 1177 | vim:tw=78:sw=4:ts=8:ft=help:norl: |