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