Merge branch 'master' of git://factorcode.org/git/factor
[factor/jcg.git] / basis / porter-stemmer / porter-stemmer-tests.factor
blob72bf5c0bb5adcbf46bf3356e939c868ef2b14324
1 IN: porter-stemmer.tests
2 USING: arrays io kernel porter-stemmer sequences tools.test
3 io.files io.encodings.utf8 ;
5 [ 0 ] [ "xa" consonant-seq ] unit-test
6 [ 0 ] [ "xxaa" consonant-seq ] unit-test
7 [ 1 ] [ "xaxa" consonant-seq ] unit-test
8 [ 2 ] [ "xaxaxa" consonant-seq ] unit-test
9 [ 3 ] [ "xaxaxaxa" consonant-seq ] unit-test
10 [ 3 ] [ "zzzzxaxaxaxaeee" consonant-seq ] unit-test
12 [ t ] [ 0 "fish" consonant? ] unit-test
13 [ f ] [ 0 "and" consonant? ] unit-test
14 [ t ] [ 0 "yes" consonant? ] unit-test
15 [ f ] [ 1 "gym" consonant? ] unit-test
17 [ t ] [ 5 "splitting" double-consonant? ] unit-test
18 [ f ] [ 2 "feel" double-consonant? ] unit-test
20 [ f ] [ "xxxz" stem-vowel? ] unit-test
21 [ t ] [ "baobab" stem-vowel? ] unit-test
23 [ t ] [ "hop" cvc? ] unit-test
24 [ t ] [ "cav" cvc? ] unit-test
25 [ t ] [ "lov" cvc? ] unit-test
26 [ t ] [ "crim" cvc? ] unit-test
27 [ f ] [ "show" cvc? ] unit-test
28 [ f ] [ "box" cvc? ] unit-test
29 [ f ] [ "tray" cvc? ] unit-test
30 [ f ] [ "meet" cvc? ] unit-test
32 [ "caress" ] [ "caresses" step1a step1b "" like ] unit-test
33 [ "poni" ] [ "ponies" step1a step1b "" like ] unit-test
34 [ "ti" ] [ "ties" step1a step1b "" like ] unit-test
35 [ "caress" ] [ "caress" step1a step1b "" like ] unit-test
36 [ "cat" ] [ "cats" step1a step1b "" like ] unit-test
37 [ "feed" ] [ "feed" step1a step1b "" like ] unit-test
38 [ "agree" ] [ "agreed" step1a step1b "" like ] unit-test
39 [ "disable" ] [ "disabled" step1a step1b "" like ] unit-test
40 [ "mat" ] [ "matting" step1a step1b "" like ] unit-test
41 [ "mate" ] [ "mating" step1a step1b "" like ] unit-test
42 [ "meet" ] [ "meeting" step1a step1b "" like ] unit-test
43 [ "mill" ] [ "milling" step1a step1b "" like ] unit-test
44 [ "mess" ] [ "messing" step1a step1b "" like ] unit-test
45 [ "meet" ] [ "meetings" step1a step1b "" like ] unit-test
47 [ "fishi" ] [ "fishy" step1c ] unit-test
48 [ "by" ] [ "by" step1c ] unit-test
50 [ "realizat" ] [ "realization" step4 ] unit-test
51 [ "ion" ] [ "ion" step4 ] unit-test
52 [ "able" ] [ "able" step4 ] unit-test
54 [ "fear" ] [ "feare" step5 "" like ] unit-test
55 [ "mate" ] [ "mate" step5 "" like ] unit-test
56 [ "hell" ] [ "hell" step5 "" like ] unit-test
57 [ "mate" ] [ "mate" step5 "" like ] unit-test
59 [ { } ] [
60     "resource:basis/porter-stemmer/test/voc.txt" utf8 file-lines
61     [ stem ] map
62     "resource:basis/porter-stemmer/test/output.txt" utf8 file-lines
63     [ 2array ] 2map [ first2 = not ] filter
64 ] unit-test