1 Tests for spell checking with 'encoding' set to "utf-8". vim: set ft=vim :
7 :" Don't want to depend on the locale from the environment. The .aff and .dic
8 :" text is in latin1, the test text is utf-8.
14 :" Function to test .aff/.dic with list of good and bad words.
15 :func TestOne(aff, dic)
18 $put ='test '. a:aff . '-' . a:dic
19 " Generate a .spl file from a .dic and .aff file.
20 exe '1;/^' . a:aff . 'affstart/+1,/^' . a:aff . 'affend/-1w! Xtest.aff'
21 exe '1;/^' . a:dic . 'dicstart/+1,/^' . a:dic . 'dicend/-1w! Xtest.dic'
24 set spl=Xtest.utf-8.spl spell
25 " list all valid words
31 " find all bad words and suggestions for them
32 exe '1;/^' . a:aff . 'good:'
36 let [bad, a] = spellbadword()
37 if bad == '' || bad == prevbad || bad == 'badend'
41 let lst = spellsuggest(bad, 3)
49 :call TestOne('1', '1')
50 :$put =soundfold('goobledygoook')
51 :$put =soundfold('kóopërÿnôven')
52 :$put =soundfold('oeverloos gezwets edale')
55 :" and now with SAL instead of SOFO items; test automatic reloading
56 gg:/^affstart_sal/+1,/^affend_sal/-1w! Xtest.aff
58 :$put =soundfold('goobledygoook')
59 :$put =soundfold('kóopërÿnôven')
60 :$put =soundfold('oeverloos gezwets edale')
62 :" also use an addition file
63 gg:/^addstart/+1,/^addend/-1w! Xtest.utf-8.add
64 :mkspell! Xtest.utf-8.add.spl Xtest.utf-8.add
65 :set spellfile=Xtest.utf-8.add
67 ]s:let [str, a] = spellbadword()
69 :set spl=Xtest_us.utf-8.spl
71 ]smm:let [str, a] = spellbadword()
73 `m]s:let [str, a] = spellbadword()
75 :set spl=Xtest_gb.utf-8.spl
77 ]smm:let [str, a] = spellbadword()
79 `m]s:let [str, a] = spellbadword()
81 :set spl=Xtest_nz.utf-8.spl
83 ]smm:let [str, a] = spellbadword()
85 `m]s:let [str, a] = spellbadword()
87 :set spl=Xtest_ca.utf-8.spl
89 ]smm:let [str, a] = spellbadword()
91 `m]s:let [str, a] = spellbadword()
96 :call TestOne('2', '1')
99 :call TestOne('3', '3')
100 :call TestOne('4', '4')
101 :call TestOne('5', '5')
102 :call TestOne('6', '6')
103 :call TestOne('7', '7')
105 :" clean up for valgrind
109 gg:/^test output:/,$wq! test.out
114 TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ
116 FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
117 LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
118 UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ
120 SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ¿
121 SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep?
165 TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ
167 FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
168 LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
169 UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ
322 FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
323 LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
324 UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ
388 1good: wrong OK puts. Test the end
389 bad: inputs comment ok Ok. test déôl end the
393 bad: inputs comment ok Ok end the. test déôl
396 Test rules for compounding.
414 3good: foo mï foobar foofoobar barfoo barbarfoo
415 bad: bar la foomï barmï mïfoo mïbar mïmï lala mïla lamï foola labar
419 Tests for compounding.
424 FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
425 LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
426 UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ
436 SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui
480 4good: word util bork prebork start end wordutil wordutils pro-ok
481 bork borkbork borkborkbork borkborkborkbork borkborkborkborkbork
482 tomato tomatotomato startend startword startwordword startwordend
483 startwordwordend startwordwordwordend prebork preborkbork
486 bad: wordutilize pro borkborkborkborkborkbork tomatotomatotomato
487 endstart endend startstart wordend wordstart
488 preborkprebork preborkpreborkbork
489 startwordwordwordwordend borkpreborkpreborkbork
490 utilsbork startnouword
494 elequint test elekwint test elekwent asdf
496 Test affix flags with two characters
508 COMPOUNDPERMITFLAG pp
535 5good: fooa1 fooaé bar prebar barbork prebarbork startprebar
536 start end startend startmiddleend nouend
537 bad: foo fooa2 prabar probarbirk middle startmiddle middleend endstart
538 startprobar startnouend
576 6good: meea1 meeaé bar prebar barbork prebarbork leadprebar
577 lead end leadend leadmiddleend
578 bad: mee meea2 prabar probarbirk middle leadmiddle middleend endlead
585 FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
586 LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ
587 UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ
593 COMPOUNDRULE 2,77*123
596 COMPOUNDPERMITFLAG 432
620 7good: meea1 meeaé bar prebar barmeat prebarmeat leadprebar
621 lead tail leadtail leadmiddletail
622 bad: mee meea2 prabar probarmaat middle leadmiddle middletail taillead