xref: /vim-8.2.3635/src/testdir/test_spell.vim (revision 51ad4eaa)
1" Test spell checking
2
3if !has('spell')
4  finish
5endif
6
7func TearDown()
8  set nospell
9  call delete('Xtest.aff')
10  call delete('Xtest.dic')
11  call delete('Xtest.latin1.add')
12  call delete('Xtest.latin1.add.spl')
13  call delete('Xtest.latin1.spl')
14  call delete('Xtest.latin1.sug')
15endfunc
16
17func Test_wrap_search()
18  new
19  call setline(1, ['The', '', 'A plong line with two zpelling mistakes', '', 'End'])
20  set spell wrapscan
21  normal ]s
22  call assert_equal('plong', expand('<cword>'))
23  normal ]s
24  call assert_equal('zpelling', expand('<cword>'))
25  normal ]s
26  call assert_equal('plong', expand('<cword>'))
27  bwipe!
28  set nospell
29endfunc
30
31func Test_curswant()
32  new
33  call setline(1, ['Another plong line', 'abcdefghijklmnopq'])
34  set spell wrapscan
35  normal 0]s
36  call assert_equal('plong', expand('<cword>'))
37  normal j
38  call assert_equal(9, getcurpos()[2])
39  normal 0[s
40  call assert_equal('plong', expand('<cword>'))
41  normal j
42  call assert_equal(9, getcurpos()[2])
43
44  normal 0]S
45  call assert_equal('plong', expand('<cword>'))
46  normal j
47  call assert_equal(9, getcurpos()[2])
48  normal 0[S
49  call assert_equal('plong', expand('<cword>'))
50  normal j
51  call assert_equal(9, getcurpos()[2])
52
53  normal 1G0
54  call assert_equal('plong', spellbadword()[0])
55  normal j
56  call assert_equal(9, getcurpos()[2])
57
58  bwipe!
59  set nospell
60endfunc
61
62func Test_z_equal_on_invalid_utf8_word()
63  split
64  set spell
65  call setline(1, "\xff")
66  norm z=
67  set nospell
68  bwipe!
69endfunc
70
71func Test_spellreall()
72  new
73  set spell
74  call assert_fails('spellrepall', 'E752:')
75  call setline(1, ['A speling mistake. The same speling mistake.',
76        \                'Another speling mistake.'])
77  call feedkeys(']s1z=', 'tx')
78  call assert_equal('A spelling mistake. The same speling mistake.', getline(1))
79  call assert_equal('Another speling mistake.', getline(2))
80  spellrepall
81  call assert_equal('A spelling mistake. The same spelling mistake.', getline(1))
82  call assert_equal('Another spelling mistake.', getline(2))
83  call assert_fails('spellrepall', 'E753:')
84  set spell&
85  bwipe!
86endfunc
87
88func Test_zz_basic()
89  call LoadAffAndDic(g:test_data_aff1, g:test_data_dic1)
90  call RunGoodBad("wrong OK puts. Test the end",
91        \ "bad: inputs comment ok Ok. test d\xE9\xF4l end the",
92        \["Comment", "deol", "d\xE9\xF4r", "input", "OK", "output", "outputs", "outtest", "put", "puts",
93        \  "test", "testen", "testn", "the end", "uk", "wrong"],
94        \[
95        \   ["bad", ["put", "uk", "OK"]],
96        \   ["inputs", ["input", "puts", "outputs"]],
97        \   ["comment", ["Comment", "outtest", "the end"]],
98        \   ["ok", ["OK", "uk", "put"]],
99        \   ["Ok", ["OK", "Uk", "Put"]],
100        \   ["test", ["Test", "testn", "testen"]],
101        \   ["d\xE9\xF4l", ["deol", "d\xE9\xF4r", "test"]],
102        \   ["end", ["put", "uk", "test"]],
103        \   ["the", ["put", "uk", "test"]],
104        \ ]
105        \ )
106
107  call assert_equal("gebletegek", soundfold('goobledygoook'))
108  call assert_equal("kepereneven", soundfold('k�op�r�n�ven'))
109  call assert_equal("everles gesvets etele", soundfold('oeverloos gezwets edale'))
110endfunc
111
112" Postponed prefixes
113func Test_zz_prefixes()
114  call LoadAffAndDic(g:test_data_aff2, g:test_data_dic1)
115  call RunGoodBad("puts",
116        \ "bad: inputs comment ok Ok end the. test d\xE9\xF4l",
117        \ ["Comment", "deol", "d\xE9\xF4r", "OK", "put", "input", "output", "puts", "outputs", "test", "outtest", "testen", "testn", "the end", "uk", "wrong"],
118        \ [
119        \   ["bad", ["put", "uk", "OK"]],
120        \   ["inputs", ["input", "puts", "outputs"]],
121        \   ["comment", ["Comment"]],
122        \   ["ok", ["OK", "uk", "put"]],
123        \   ["Ok", ["OK", "Uk", "Put"]],
124        \   ["end", ["put", "uk", "deol"]],
125        \   ["the", ["put", "uk", "test"]],
126        \   ["test", ["Test", "testn", "testen"]],
127        \   ["d\xE9\xF4l", ["deol", "d\xE9\xF4r", "test"]],
128        \ ])
129endfunc
130
131"Compound words
132func Test_zz_compound()
133  call LoadAffAndDic(g:test_data_aff3, g:test_data_dic3)
134  call RunGoodBad("foo m\xEF foobar foofoobar barfoo barbarfoo",
135        \ "bad: bar la foom\xEF barm\xEF m\xEFfoo m\xEFbar m\xEFm\xEF lala m\xEFla lam\xEF foola labar",
136        \ ["foo", "m\xEF"],
137        \ [
138        \   ["bad", ["foo", "m\xEF"]],
139        \   ["bar", ["barfoo", "foobar", "foo"]],
140        \   ["la", ["m\xEF", "foo"]],
141        \   ["foom\xEF", ["foo m\xEF", "foo", "foofoo"]],
142        \   ["barm\xEF", ["barfoo", "m\xEF", "barbar"]],
143        \   ["m\xEFfoo", ["m\xEF foo", "foo", "foofoo"]],
144        \   ["m\xEFbar", ["foobar", "barbar", "m\xEF"]],
145        \   ["m\xEFm\xEF", ["m\xEF m\xEF", "m\xEF"]],
146        \   ["lala", []],
147        \   ["m\xEFla", ["m\xEF", "m\xEF m\xEF"]],
148        \   ["lam\xEF", ["m\xEF", "m\xEF m\xEF"]],
149        \   ["foola", ["foo", "foobar", "foofoo"]],
150        \   ["labar", ["barbar", "foobar"]],
151        \ ])
152
153  call LoadAffAndDic(g:test_data_aff4, g:test_data_dic4)
154  call RunGoodBad("word util bork prebork start end wordutil wordutils pro-ok bork borkbork borkborkbork borkborkborkbork borkborkborkborkbork tomato tomatotomato startend startword startwordword startwordend startwordwordend startwordwordwordend prebork preborkbork preborkborkbork nouword",
155        \ "bad: wordutilize pro borkborkborkborkborkbork tomatotomatotomato endstart endend startstart wordend wordstart preborkprebork  preborkpreborkbork startwordwordwordwordend borkpreborkpreborkbork utilsbork  startnouword",
156        \ ["bork", "prebork", "end", "pro-ok", "start", "tomato", "util", "utilize", "utils", "word", "nouword"],
157        \ [
158        \   ["bad", ["end", "bork", "word"]],
159        \   ["wordutilize", ["word utilize", "wordutils", "wordutil"]],
160        \   ["pro", ["bork", "word", "end"]],
161        \   ["borkborkborkborkborkbork", ["bork borkborkborkborkbork", "borkbork borkborkborkbork", "borkborkbork borkborkbork"]],
162        \   ["tomatotomatotomato", ["tomato tomatotomato", "tomatotomato tomato", "tomato tomato tomato"]],
163        \   ["endstart", ["end start", "start"]],
164        \   ["endend", ["end end", "end"]],
165        \   ["startstart", ["start start"]],
166        \   ["wordend", ["word end", "word", "wordword"]],
167        \   ["wordstart", ["word start", "bork start"]],
168        \   ["preborkprebork", ["prebork prebork", "preborkbork", "preborkborkbork"]],
169        \   ["preborkpreborkbork", ["prebork preborkbork", "preborkborkbork", "preborkborkborkbork"]],
170        \   ["startwordwordwordwordend", ["startwordwordwordword end", "startwordwordwordword", "start wordwordwordword end"]],
171        \   ["borkpreborkpreborkbork", ["bork preborkpreborkbork", "bork prebork preborkbork", "bork preborkprebork bork"]],
172        \   ["utilsbork", ["utilbork", "utils bork", "util bork"]],
173        \   ["startnouword", ["start nouword", "startword", "startborkword"]],
174        \ ])
175
176endfunc
177
178"Test affix flags with two characters
179func Test_zz_affix()
180  call LoadAffAndDic(g:test_data_aff5, g:test_data_dic5)
181  call RunGoodBad("fooa1 fooa\xE9 bar prebar barbork prebarbork  startprebar start end startend  startmiddleend nouend",
182        \ "bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart startprobar startnouend",
183        \ ["bar", "barbork", "end", "fooa1", "fooa\xE9", "nouend", "prebar", "prebarbork", "start"],
184        \ [
185        \   ["bad", ["bar", "end", "fooa1"]],
186        \   ["foo", ["fooa1", "fooa\xE9", "bar"]],
187        \   ["fooa2", ["fooa1", "fooa\xE9", "bar"]],
188        \   ["prabar", ["prebar", "bar", "bar bar"]],
189        \   ["probarbirk", ["prebarbork"]],
190        \   ["middle", []],
191        \   ["startmiddle", ["startmiddleend", "startmiddlebar"]],
192        \   ["middleend", []],
193        \   ["endstart", ["end start", "start"]],
194        \   ["startprobar", ["startprebar", "start prebar", "startbar"]],
195        \   ["startnouend", ["start nouend", "startend"]],
196        \ ])
197
198  call LoadAffAndDic(g:test_data_aff6, g:test_data_dic6)
199  call RunGoodBad("meea1 meea\xE9 bar prebar barbork prebarbork  leadprebar lead end leadend  leadmiddleend",
200        \  "bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead leadprobar",
201        \ ["bar", "barbork", "end", "lead", "meea1", "meea\xE9", "prebar", "prebarbork"],
202        \ [
203        \   ["bad", ["bar", "end", "lead"]],
204        \   ["mee", ["meea1", "meea\xE9", "bar"]],
205        \   ["meea2", ["meea1", "meea\xE9", "lead"]],
206        \   ["prabar", ["prebar", "bar", "leadbar"]],
207        \   ["probarbirk", ["prebarbork"]],
208        \   ["middle", []],
209        \   ["leadmiddle", ["leadmiddleend", "leadmiddlebar"]],
210        \   ["middleend", []],
211        \   ["endlead", ["end lead", "lead", "end end"]],
212        \   ["leadprobar", ["leadprebar", "lead prebar", "leadbar"]],
213        \ ])
214
215  call LoadAffAndDic(g:test_data_aff7, g:test_data_dic7)
216  call RunGoodBad("meea1 meea\xE9 bar prebar barmeat prebarmeat  leadprebar lead tail leadtail  leadmiddletail",
217        \ "bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead leadprobar",
218        \ ["bar", "barmeat", "lead", "meea1", "meea\xE9", "prebar", "prebarmeat", "tail"],
219        \ [
220        \   ["bad", ["bar", "lead", "tail"]],
221        \   ["mee", ["meea1", "meea\xE9", "bar"]],
222        \   ["meea2", ["meea1", "meea\xE9", "lead"]],
223        \   ["prabar", ["prebar", "bar", "leadbar"]],
224        \   ["probarmaat", ["prebarmeat"]],
225        \   ["middle", []],
226        \   ["leadmiddle", ["leadmiddlebar"]],
227        \   ["middletail", []],
228        \   ["taillead", ["tail lead", "tail"]],
229        \   ["leadprobar", ["leadprebar", "lead prebar", "leadbar"]],
230        \ ])
231endfunc
232
233func Test_zz_NOSLITSUGS()
234  call LoadAffAndDic(g:test_data_aff8, g:test_data_dic8)
235  call RunGoodBad("foo bar faabar", "bad: foobar barfoo",
236        \ ["bar", "faabar", "foo"],
237        \ [
238        \   ["bad", ["bar", "foo"]],
239        \   ["foobar", ["faabar", "foo bar", "bar"]],
240        \   ["barfoo", ["bar foo", "bar", "foo"]],
241        \ ])
242endfunc
243
244" Numbers
245func Test_zz_Numbers()
246  call LoadAffAndDic(g:test_data_aff9, g:test_data_dic9)
247  call RunGoodBad("0b1011 0777 1234 0x01ff", "",
248        \ ["bar", "foo"],
249        \ [
250        \ ])
251endfunc
252
253function FirstSpellWord()
254  call feedkeys("/^start:\n", 'tx')
255  normal ]smm
256  let [str, a] = spellbadword()
257  return str
258endfunc
259
260function SecondSpellWord()
261  normal `m]s
262  let [str, a] = spellbadword()
263  return str
264endfunc
265
266"Test with SAL instead of SOFO items; test automatic reloading
267func Test_zz_sal_and_addition()
268  set enc=latin1
269  set spellfile=
270  call writefile(g:test_data_dic1, "Xtest.dic")
271  call writefile(g:test_data_aff_sal, "Xtest.aff")
272  mkspell! Xtest Xtest
273  set spl=Xtest.latin1.spl spell
274  call assert_equal('kbltykk', soundfold('goobledygoook'))
275  call assert_equal('kprnfn', soundfold('k�op�r�n�ven'))
276  call assert_equal('*fls kswts tl', soundfold('oeverloos gezwets edale'))
277
278  "also use an addition file
279  call writefile(["/regions=usgbnz", "elequint/2", "elekwint/3"], "Xtest.latin1.add")
280  mkspell! Xtest.latin1.add.spl Xtest.latin1.add
281
282  bwipe!
283  call setline(1, ["start: elequint test elekwint test elekwent asdf"])
284
285  set spellfile=Xtest.latin1.add
286  call assert_equal("elekwent", FirstSpellWord())
287
288  set spl=Xtest_us.latin1.spl
289  call assert_equal("elequint", FirstSpellWord())
290  call assert_equal("elekwint", SecondSpellWord())
291
292  set spl=Xtest_gb.latin1.spl
293  call assert_equal("elekwint", FirstSpellWord())
294  call assert_equal("elekwent", SecondSpellWord())
295
296  set spl=Xtest_nz.latin1.spl
297  call assert_equal("elequint", FirstSpellWord())
298  call assert_equal("elekwent", SecondSpellWord())
299
300  set spl=Xtest_ca.latin1.spl
301  call assert_equal("elequint", FirstSpellWord())
302  call assert_equal("elekwint", SecondSpellWord())
303endfunc
304
305func Test_region_error()
306  messages clear
307  call writefile(["/regions=usgbnz", "elequint/0"], "Xtest.latin1.add")
308  mkspell! Xtest.latin1.add.spl Xtest.latin1.add
309  call assert_match('Invalid region nr in Xtest.latin1.add line 2: 0', execute('messages'))
310  call delete('Xtest.latin1.add')
311  call delete('Xtest.latin1.add.spl')
312endfunc
313
314" Check using z= in new buffer (crash fixed by patch 7.4a.028).
315func Test_zeq_crash()
316  new
317  set maxmem=512 spell
318  call feedkeys('iasdz=:\"', 'tx')
319
320  bwipe!
321endfunc
322
323func LoadAffAndDic(aff_contents, dic_contents)
324  set enc=latin1
325  set spellfile=
326  call writefile(a:aff_contents, "Xtest.aff")
327  call writefile(a:dic_contents, "Xtest.dic")
328  " Generate a .spl file from a .dic and .aff file.
329  mkspell! Xtest Xtest
330  " use that spell file
331  set spl=Xtest.latin1.spl spell
332endfunc
333
334func ListWords()
335  spelldump
336  %yank
337  quit
338  return split(@", "\n")
339endfunc
340
341func TestGoodBadBase()
342  exe '1;/^good:'
343  normal 0f:]s
344  let prevbad = ''
345  let result = []
346  while 1
347    let [bad, a] = spellbadword()
348    if bad == '' || bad == prevbad || bad == 'badend'
349      break
350    endif
351    let prevbad = bad
352    let lst = spellsuggest(bad, 3)
353    normal mm
354
355    call add(result, [bad, lst])
356    normal `m]s
357  endwhile
358  return result
359endfunc
360
361func RunGoodBad(good, bad, expected_words, expected_bad_words)
362  bwipe!
363  call setline(1, ["good: ", a:good,  a:bad, " badend "])
364  let words = ListWords()
365  call assert_equal(a:expected_words, words[1:-1])
366  let bad_words = TestGoodBadBase()
367  call assert_equal(a:expected_bad_words, bad_words)
368  bwipe!
369endfunc
370
371let g:test_data_aff1 = [
372      \"SET ISO8859-1",
373      \"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ",
374      \"",
375      \"FOL  \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF",
376      \"LOW  \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF",
377      \"UPP  \xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xFF",
378      \"",
379      \"SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xBF",
380      \"SOFOTO   ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep?",
381      \"",
382      \"MIDWORD\t'-",
383      \"",
384      \"KEP =",
385      \"RAR ?",
386      \"BAD !",
387      \"",
388      \"PFX I N 1",
389      \"PFX I 0 in .",
390      \"",
391      \"PFX O Y 1",
392      \"PFX O 0 out .",
393      \"",
394      \"SFX S Y 2",
395      \"SFX S 0 s [^s]",
396      \"SFX S 0 es s",
397      \"",
398      \"SFX N N 3",
399      \"SFX N 0 en [^n]",
400      \"SFX N 0 nen n",
401      \"SFX N 0 n .",
402      \"",
403      \"REP 3",
404      \"REP g ch",
405      \"REP ch g",
406      \"REP svp s.v.p.",
407      \"",
408      \"MAP 9",
409      \"MAP a\xE0\xE1\xE2\xE3\xE4\xE5",
410      \"MAP e\xE8\xE9\xEA\xEB",
411      \"MAP i\xEC\xED\xEE\xEF",
412      \"MAP o\xF2\xF3\xF4\xF5\xF6",
413      \"MAP u\xF9\xFA\xFB\xFC",
414      \"MAP n\xF1",
415      \"MAP c\xE7",
416      \"MAP y\xFF\xFD",
417      \"MAP s\xDF",
418      \ ]
419let g:test_data_dic1 = [
420      \"123456",
421      \"test/NO",
422      \"# comment",
423      \"wrong",
424      \"Comment",
425      \"OK",
426      \"uk",
427      \"put/ISO",
428      \"the end",
429      \"deol",
430      \"d\xE9\xF4r",
431      \ ]
432let g:test_data_aff2 = [
433      \"SET ISO8859-1",
434      \"",
435      \"FOL  \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF",
436      \"LOW  \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF",
437      \"UPP  \xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xFF",
438      \"",
439      \"PFXPOSTPONE",
440      \"",
441      \"MIDWORD\t'-",
442      \"",
443      \"KEP =",
444      \"RAR ?",
445      \"BAD !",
446      \"",
447      \"PFX I N 1",
448      \"PFX I 0 in .",
449      \"",
450      \"PFX O Y 1",
451      \"PFX O 0 out [a-z]",
452      \"",
453      \"SFX S Y 2",
454      \"SFX S 0 s [^s]",
455      \"SFX S 0 es s",
456      \"",
457      \"SFX N N 3",
458      \"SFX N 0 en [^n]",
459      \"SFX N 0 nen n",
460      \"SFX N 0 n .",
461      \"",
462      \"REP 3",
463      \"REP g ch",
464      \"REP ch g",
465      \"REP svp s.v.p.",
466      \"",
467      \"MAP 9",
468      \"MAP a\xE0\xE1\xE2\xE3\xE4\xE5",
469      \"MAP e\xE8\xE9\xEA\xEB",
470      \"MAP i\xEC\xED\xEE\xEF",
471      \"MAP o\xF2\xF3\xF4\xF5\xF6",
472      \"MAP u\xF9\xFA\xFB\xFC",
473      \"MAP n\xF1",
474      \"MAP c\xE7",
475      \"MAP y\xFF\xFD",
476      \"MAP s\xDF",
477      \ ]
478let g:test_data_aff3 = [
479      \"SET ISO8859-1",
480      \"",
481      \"COMPOUNDMIN 3",
482      \"COMPOUNDRULE m*",
483      \"NEEDCOMPOUND x",
484      \ ]
485let g:test_data_dic3 = [
486      \"1234",
487      \"foo/m",
488      \"bar/mx",
489      \"m\xEF/m",
490      \"la/mx",
491      \ ]
492let g:test_data_aff4 = [
493      \"SET ISO8859-1",
494      \"",
495      \"FOL  \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF",
496      \"LOW  \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF",
497      \"UPP  \xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xFF",
498      \"",
499      \"COMPOUNDRULE m+",
500      \"COMPOUNDRULE sm*e",
501      \"COMPOUNDRULE sm+",
502      \"COMPOUNDMIN 3",
503      \"COMPOUNDWORDMAX 3",
504      \"COMPOUNDFORBIDFLAG t",
505      \"",
506      \"COMPOUNDSYLMAX 5",
507      \"SYLLABLE a\xE1e\xE9i\xEDo\xF3\xF6\xF5u\xFA\xFC\xFBy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui",
508      \"",
509      \"MAP 9",
510      \"MAP a\xE0\xE1\xE2\xE3\xE4\xE5",
511      \"MAP e\xE8\xE9\xEA\xEB",
512      \"MAP i\xEC\xED\xEE\xEF",
513      \"MAP o\xF2\xF3\xF4\xF5\xF6",
514      \"MAP u\xF9\xFA\xFB\xFC",
515      \"MAP n\xF1",
516      \"MAP c\xE7",
517      \"MAP y\xFF\xFD",
518      \"MAP s\xDF",
519      \"",
520      \"NEEDAFFIX x",
521      \"",
522      \"PFXPOSTPONE",
523      \"",
524      \"MIDWORD '-",
525      \"",
526      \"SFX q N 1",
527      \"SFX q   0    -ok .",
528      \"",
529      \"SFX a Y 2",
530      \"SFX a 0 s .",
531      \"SFX a 0 ize/t .",
532      \"",
533      \"PFX p N 1",
534      \"PFX p 0 pre .",
535      \"",
536      \"PFX P N 1",
537      \"PFX P 0 nou .",
538      \ ]
539let g:test_data_dic4 = [
540      \"1234",
541      \"word/mP",
542      \"util/am",
543      \"pro/xq",
544      \"tomato/m",
545      \"bork/mp",
546      \"start/s",
547      \"end/e",
548      \ ]
549let g:test_data_aff5 = [
550      \"SET ISO8859-1",
551      \"",
552      \"FLAG long",
553      \"",
554      \"NEEDAFFIX !!",
555      \"",
556      \"COMPOUNDRULE ssmm*ee",
557      \"",
558      \"NEEDCOMPOUND xx",
559      \"COMPOUNDPERMITFLAG pp",
560      \"",
561      \"SFX 13 Y 1",
562      \"SFX 13 0 bork .",
563      \"",
564      \"SFX a1 Y 1",
565      \"SFX a1 0 a1 .",
566      \"",
567      \"SFX a\xE9 Y 1",
568      \"SFX a\xE9 0 a\xE9 .",
569      \"",
570      \"PFX zz Y 1",
571      \"PFX zz 0 pre/pp .",
572      \"",
573      \"PFX yy Y 1",
574      \"PFX yy 0 nou .",
575      \ ]
576let g:test_data_dic5 = [
577      \"1234",
578      \"foo/a1a\xE9!!",
579      \"bar/zz13ee",
580      \"start/ss",
581      \"end/eeyy",
582      \"middle/mmxx",
583      \ ]
584let g:test_data_aff6 = [
585      \"SET ISO8859-1",
586      \"",
587      \"FLAG caplong",
588      \"",
589      \"NEEDAFFIX A!",
590      \"",
591      \"COMPOUNDRULE sMm*Ee",
592      \"",
593      \"NEEDCOMPOUND Xx",
594      \"",
595      \"COMPOUNDPERMITFLAG p",
596      \"",
597      \"SFX N3 Y 1",
598      \"SFX N3 0 bork .",
599      \"",
600      \"SFX A1 Y 1",
601      \"SFX A1 0 a1 .",
602      \"",
603      \"SFX A\xE9 Y 1",
604      \"SFX A\xE9 0 a\xE9 .",
605      \"",
606      \"PFX Zz Y 1",
607      \"PFX Zz 0 pre/p .",
608      \ ]
609let g:test_data_dic6 = [
610      \"1234",
611      \"mee/A1A\xE9A!",
612      \"bar/ZzN3Ee",
613      \"lead/s",
614      \"end/Ee",
615      \"middle/MmXx",
616      \ ]
617let g:test_data_aff7 = [
618      \"SET ISO8859-1",
619      \"",
620      \"FLAG num",
621      \"",
622      \"NEEDAFFIX 9999",
623      \"",
624      \"COMPOUNDRULE 2,77*123",
625      \"",
626      \"NEEDCOMPOUND 1",
627      \"COMPOUNDPERMITFLAG 432",
628      \"",
629      \"SFX 61003 Y 1",
630      \"SFX 61003 0 meat .",
631      \"",
632      \"SFX 391 Y 1",
633      \"SFX 391 0 a1 .",
634      \"",
635      \"SFX 111 Y 1",
636      \"SFX 111 0 a\xE9 .",
637      \"",
638      \"PFX 17 Y 1",
639      \"PFX 17 0 pre/432 .",
640      \ ]
641let g:test_data_dic7 = [
642      \"1234",
643      \"mee/391,111,9999",
644      \"bar/17,61003,123",
645      \"lead/2",
646      \"tail/123",
647      \"middle/77,1",
648      \ ]
649let g:test_data_aff8 = [
650      \"SET ISO8859-1",
651      \"",
652      \"NOSPLITSUGS",
653      \ ]
654let g:test_data_dic8 = [
655      \"1234",
656      \"foo",
657      \"bar",
658      \"faabar",
659      \ ]
660let g:test_data_aff9 = [
661      \ ]
662let g:test_data_dic9 = [
663      \"1234",
664      \"foo",
665      \"bar",
666      \ ]
667let g:test_data_aff_sal = [
668      \"SET ISO8859-1",
669      \"TRY esianrtolcdugmphbyfvkwjkqxz-\xEB\xE9\xE8\xEA\xEF\xEE\xE4\xE0\xE2\xF6\xFC\xFB'ESIANRTOLCDUGMPHBYFVKWJKQXZ",
670      \"",
671      \"FOL  \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF",
672      \"LOW  \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xDF\xFF",
673      \"UPP  \xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xFF",
674      \"",
675      \"MIDWORD\t'-",
676      \"",
677      \"KEP =",
678      \"RAR ?",
679      \"BAD !",
680      \"",
681      \"PFX I N 1",
682      \"PFX I 0 in .",
683      \"",
684      \"PFX O Y 1",
685      \"PFX O 0 out .",
686      \"",
687      \"SFX S Y 2",
688      \"SFX S 0 s [^s]",
689      \"SFX S 0 es s",
690      \"",
691      \"SFX N N 3",
692      \"SFX N 0 en [^n]",
693      \"SFX N 0 nen n",
694      \"SFX N 0 n .",
695      \"",
696      \"REP 3",
697      \"REP g ch",
698      \"REP ch g",
699      \"REP svp s.v.p.",
700      \"",
701      \"MAP 9",
702      \"MAP a\xE0\xE1\xE2\xE3\xE4\xE5",
703      \"MAP e\xE8\xE9\xEA\xEB",
704      \"MAP i\xEC\xED\xEE\xEF",
705      \"MAP o\xF2\xF3\xF4\xF5\xF6",
706      \"MAP u\xF9\xFA\xFB\xFC",
707      \"MAP n\xF1",
708      \"MAP c\xE7",
709      \"MAP y\xFF\xFD",
710      \"MAP s\xDF",
711      \"",
712      \"SAL AH(AEIOUY)-^         *H",
713      \"SAL AR(AEIOUY)-^         *R",
714      \"SAL A(HR)^               *",
715      \"SAL A^                   *",
716      \"SAL AH(AEIOUY)-          H",
717      \"SAL AR(AEIOUY)-          R",
718      \"SAL A(HR)                _",
719      \"SAL \xC0^                   *",
720      \"SAL \xC5^                   *",
721      \"SAL BB-                  _",
722      \"SAL B                    B",
723      \"SAL CQ-                  _",
724      \"SAL CIA                  X",
725      \"SAL CH                   X",
726      \"SAL C(EIY)-              S",
727      \"SAL CK                   K",
728      \"SAL COUGH^               KF",
729      \"SAL CC<                  C",
730      \"SAL C                    K",
731      \"SAL DG(EIY)              K",
732      \"SAL DD-                  _",
733      \"SAL D                    T",
734      \"SAL \xC9<                   E",
735      \"SAL EH(AEIOUY)-^         *H",
736      \"SAL ER(AEIOUY)-^         *R",
737      \"SAL E(HR)^               *",
738      \"SAL ENOUGH^$             *NF",
739      \"SAL E^                   *",
740      \"SAL EH(AEIOUY)-          H",
741      \"SAL ER(AEIOUY)-          R",
742      \"SAL E(HR)                _",
743      \"SAL FF-                  _",
744      \"SAL F                    F",
745      \"SAL GN^                  N",
746      \"SAL GN$                  N",
747      \"SAL GNS$                 NS",
748      \"SAL GNED$                N",
749      \"SAL GH(AEIOUY)-          K",
750      \"SAL GH                   _",
751      \"SAL GG9                  K",
752      \"SAL G                    K",
753      \"SAL H                    H",
754      \"SAL IH(AEIOUY)-^         *H",
755      \"SAL IR(AEIOUY)-^         *R",
756      \"SAL I(HR)^               *",
757      \"SAL I^                   *",
758      \"SAL ING6                 N",
759      \"SAL IH(AEIOUY)-          H",
760      \"SAL IR(AEIOUY)-          R",
761      \"SAL I(HR)                _",
762      \"SAL J                    K",
763      \"SAL KN^                  N",
764      \"SAL KK-                  _",
765      \"SAL K                    K",
766      \"SAL LAUGH^               LF",
767      \"SAL LL-                  _",
768      \"SAL L                    L",
769      \"SAL MB$                  M",
770      \"SAL MM                   M",
771      \"SAL M                    M",
772      \"SAL NN-                  _",
773      \"SAL N                    N",
774      \"SAL OH(AEIOUY)-^         *H",
775      \"SAL OR(AEIOUY)-^         *R",
776      \"SAL O(HR)^               *",
777      \"SAL O^                   *",
778      \"SAL OH(AEIOUY)-          H",
779      \"SAL OR(AEIOUY)-          R",
780      \"SAL O(HR)                _",
781      \"SAL PH                   F",
782      \"SAL PN^                  N",
783      \"SAL PP-                  _",
784      \"SAL P                    P",
785      \"SAL Q                    K",
786      \"SAL RH^                  R",
787      \"SAL ROUGH^               RF",
788      \"SAL RR-                  _",
789      \"SAL R                    R",
790      \"SAL SCH(EOU)-            SK",
791      \"SAL SC(IEY)-             S",
792      \"SAL SH                   X",
793      \"SAL SI(AO)-              X",
794      \"SAL SS-                  _",
795      \"SAL S                    S",
796      \"SAL TI(AO)-              X",
797      \"SAL TH                   @",
798      \"SAL TCH--                _",
799      \"SAL TOUGH^               TF",
800      \"SAL TT-                  _",
801      \"SAL T                    T",
802      \"SAL UH(AEIOUY)-^         *H",
803      \"SAL UR(AEIOUY)-^         *R",
804      \"SAL U(HR)^               *",
805      \"SAL U^                   *",
806      \"SAL UH(AEIOUY)-          H",
807      \"SAL UR(AEIOUY)-          R",
808      \"SAL U(HR)                _",
809      \"SAL V^                   W",
810      \"SAL V                    F",
811      \"SAL WR^                  R",
812      \"SAL WH^                  W",
813      \"SAL W(AEIOU)-            W",
814      \"SAL X^                   S",
815      \"SAL X                    KS",
816      \"SAL Y(AEIOU)-            Y",
817      \"SAL ZZ-                  _",
818      \"SAL Z                    S",
819      \ ]
820