1 // This file was generated automatically by the Snowball to Java compiler
3 package org.tartarus.snowball.ext;
4 import org.tartarus.snowball.SnowballProgram;
5 import org.tartarus.snowball.Among;
8 * Generated class implementing code defined by a snowball script.
10 public class KpStemmer extends SnowballProgram {
12 private Among a_0[] = {
13 new Among ( "nde", -1, 7, "", this),
14 new Among ( "en", -1, 6, "", this),
15 new Among ( "s", -1, 2, "", this),
16 new Among ( "'s", 2, 1, "", this),
17 new Among ( "es", 2, 4, "", this),
18 new Among ( "ies", 4, 3, "", this),
19 new Among ( "aus", 2, 5, "", this)
22 private Among a_1[] = {
23 new Among ( "de", -1, 5, "", this),
24 new Among ( "ge", -1, 2, "", this),
25 new Among ( "ische", -1, 4, "", this),
26 new Among ( "je", -1, 1, "", this),
27 new Among ( "lijke", -1, 3, "", this),
28 new Among ( "le", -1, 9, "", this),
29 new Among ( "ene", -1, 10, "", this),
30 new Among ( "re", -1, 8, "", this),
31 new Among ( "se", -1, 7, "", this),
32 new Among ( "te", -1, 6, "", this),
33 new Among ( "ieve", -1, 11, "", this)
36 private Among a_2[] = {
37 new Among ( "heid", -1, 3, "", this),
38 new Among ( "fie", -1, 7, "", this),
39 new Among ( "gie", -1, 8, "", this),
40 new Among ( "atie", -1, 1, "", this),
41 new Among ( "isme", -1, 5, "", this),
42 new Among ( "ing", -1, 5, "", this),
43 new Among ( "arij", -1, 6, "", this),
44 new Among ( "erij", -1, 5, "", this),
45 new Among ( "sel", -1, 3, "", this),
46 new Among ( "rder", -1, 4, "", this),
47 new Among ( "ster", -1, 3, "", this),
48 new Among ( "iteit", -1, 2, "", this),
49 new Among ( "dst", -1, 10, "", this),
50 new Among ( "tst", -1, 9, "", this)
53 private Among a_3[] = {
54 new Among ( "end", -1, 10, "", this),
55 new Among ( "atief", -1, 2, "", this),
56 new Among ( "erig", -1, 10, "", this),
57 new Among ( "achtig", -1, 9, "", this),
58 new Among ( "ioneel", -1, 1, "", this),
59 new Among ( "baar", -1, 3, "", this),
60 new Among ( "laar", -1, 5, "", this),
61 new Among ( "naar", -1, 4, "", this),
62 new Among ( "raar", -1, 6, "", this),
63 new Among ( "eriger", -1, 10, "", this),
64 new Among ( "achtiger", -1, 9, "", this),
65 new Among ( "lijker", -1, 8, "", this),
66 new Among ( "tant", -1, 7, "", this),
67 new Among ( "erigst", -1, 10, "", this),
68 new Among ( "achtigst", -1, 9, "", this),
69 new Among ( "lijkst", -1, 8, "", this)
72 private Among a_4[] = {
73 new Among ( "ig", -1, 1, "", this),
74 new Among ( "iger", -1, 1, "", this),
75 new Among ( "igst", -1, 1, "", this)
78 private Among a_5[] = {
79 new Among ( "ft", -1, 2, "", this),
80 new Among ( "kt", -1, 1, "", this),
81 new Among ( "pt", -1, 3, "", this)
84 private Among a_6[] = {
85 new Among ( "bb", -1, 1, "", this),
86 new Among ( "cc", -1, 2, "", this),
87 new Among ( "dd", -1, 3, "", this),
88 new Among ( "ff", -1, 4, "", this),
89 new Among ( "gg", -1, 5, "", this),
90 new Among ( "hh", -1, 6, "", this),
91 new Among ( "jj", -1, 7, "", this),
92 new Among ( "kk", -1, 8, "", this),
93 new Among ( "ll", -1, 9, "", this),
94 new Among ( "mm", -1, 10, "", this),
95 new Among ( "nn", -1, 11, "", this),
96 new Among ( "pp", -1, 12, "", this),
97 new Among ( "qq", -1, 13, "", this),
98 new Among ( "rr", -1, 14, "", this),
99 new Among ( "ss", -1, 15, "", this),
100 new Among ( "tt", -1, 16, "", this),
101 new Among ( "v", -1, 21, "", this),
102 new Among ( "vv", 16, 17, "", this),
103 new Among ( "ww", -1, 18, "", this),
104 new Among ( "xx", -1, 19, "", this),
105 new Among ( "z", -1, 22, "", this),
106 new Among ( "zz", 20, 20, "", this)
109 private Among a_7[] = {
110 new Among ( "d", -1, 1, "", this),
111 new Among ( "t", -1, 2, "", this)
114 private static final char g_v[] = {17, 65, 16, 1 };
116 private static final char g_v_WX[] = {17, 65, 208, 1 };
118 private static final char g_AOU[] = {1, 64, 16 };
120 private static final char g_AIOU[] = {1, 65, 16 };
122 private boolean B_GE_removed;
123 private boolean B_stemmed;
124 private boolean B_Y_found;
128 private StringBuilder S_ch = new StringBuilder();
130 private void copy_from(KpStemmer other) {
131 B_GE_removed = other.B_GE_removed;
132 B_stemmed = other.B_stemmed;
133 B_Y_found = other.B_Y_found;
138 super.copy_from(other);
141 private boolean r_R1() {
143 // setmark x, line 32
152 private boolean r_R2() {
154 // setmark x, line 33
163 private boolean r_V() {
167 v_1 = limit - cursor;
171 v_2 = limit - cursor;
173 if (!(in_grouping_b(g_v, 97, 121)))
179 cursor = limit - v_2;
181 if (!(eq_s_b(2, "ij")))
186 cursor = limit - v_1;
190 private boolean r_VX() {
194 v_1 = limit - cursor;
197 if (cursor <= limit_backward)
204 v_2 = limit - cursor;
206 if (!(in_grouping_b(g_v, 97, 121)))
212 cursor = limit - v_2;
214 if (!(eq_s_b(2, "ij")))
219 cursor = limit - v_1;
223 private boolean r_C() {
227 v_1 = limit - cursor;
231 v_2 = limit - cursor;
234 if (!(eq_s_b(2, "ij")))
240 cursor = limit - v_2;
242 if (!(out_grouping_b(g_v, 97, 121)))
246 cursor = limit - v_1;
250 private boolean r_lengthen_V() {
260 v_1 = limit - cursor;
263 if (!(out_grouping_b(g_v_WX, 97, 121)))
271 v_2 = limit - cursor;
274 if (!(in_grouping_b(g_AOU, 97, 117)))
281 v_3 = limit - cursor;
285 v_4 = limit - cursor;
287 if (!(out_grouping_b(g_v, 97, 121)))
293 cursor = limit - v_4;
295 if (cursor > limit_backward)
300 cursor = limit - v_3;
303 cursor = limit - v_2;
306 if (!(eq_s_b(1, "e")))
313 v_5 = limit - cursor;
317 v_6 = limit - cursor;
319 if (!(out_grouping_b(g_v, 97, 121)))
325 cursor = limit - v_6;
327 if (cursor > limit_backward)
334 v_7 = limit - cursor;
336 if (!(in_grouping_b(g_AIOU, 97, 117)))
342 cursor = limit - v_7;
346 v_8 = limit - cursor;
350 if (cursor <= limit_backward)
355 if (!(in_grouping_b(g_AIOU, 97, 117)))
359 if (!(out_grouping_b(g_v, 97, 121)))
365 cursor = limit - v_8;
367 cursor = limit - v_5;
370 S_ch = slice_to(S_ch);
374 insert(cursor, cursor, S_ch);
378 cursor = limit - v_1;
382 private boolean r_Step_1() {
392 among_var = find_among_b(a_0, 7);
417 v_1 = limit - cursor;
421 if (!(eq_s_b(1, "t")))
432 cursor = limit - v_1;
456 v_2 = limit - cursor;
460 if (!(eq_s_b(2, "ar")))
478 // call lengthen_V, line 55
485 cursor = limit - v_2;
489 if (!(eq_s_b(2, "er")))
509 cursor = limit - v_2;
544 v_3 = limit - cursor;
548 if (!(eq_s_b(3, "hed")))
563 cursor = limit - v_3;
567 if (!(eq_s_b(2, "nd")))
575 cursor = limit - v_3;
579 if (!(eq_s_b(1, "d")))
599 cursor = limit - v_3;
604 v_4 = limit - cursor;
607 if (!(eq_s_b(1, "i")))
613 cursor = limit - v_4;
615 if (!(eq_s_b(1, "j")))
629 cursor = limit - v_3;
643 // call lengthen_V, line 64
659 private boolean r_Step_2() {
666 among_var = find_among_b(a_1, 11);
681 v_1 = limit - cursor;
685 if (!(eq_s_b(2, "'t")))
695 cursor = limit - v_1;
699 if (!(eq_s_b(2, "et")))
719 cursor = limit - v_1;
723 if (!(eq_s_b(3, "rnt")))
733 cursor = limit - v_1;
737 if (!(eq_s_b(1, "t")))
757 cursor = limit - v_1;
761 if (!(eq_s_b(3, "ink")))
771 cursor = limit - v_1;
775 if (!(eq_s_b(2, "mp")))
785 cursor = limit - v_1;
789 if (!(eq_s_b(1, "'")))
804 cursor = limit - v_1;
907 insert(cursor, cursor, "l");
908 // call lengthen_V, line 87
929 insert(cursor, cursor, "en");
930 // call lengthen_V, line 88
955 private boolean r_Step_3() {
961 among_var = find_among_b(a_2, 14);
991 // call lengthen_V, line 97
1014 // call R1, line 104
1021 // call lengthen_V, line 104
1022 if (!r_lengthen_V())
1029 // call R1, line 105
1044 // call R2, line 106
1052 insert(cursor, cursor, "f");
1053 // call lengthen_V, line 106
1054 if (!r_lengthen_V())
1061 // call R2, line 107
1069 insert(cursor, cursor, "g");
1070 // call lengthen_V, line 107
1071 if (!r_lengthen_V())
1078 // call R1, line 108
1093 // call R1, line 109
1110 private boolean r_Step_4() {
1116 v_1 = limit - cursor;
1122 among_var = find_among_b(a_3, 16);
1135 // call R1, line 116
1145 // call R1, line 117
1155 // call R1, line 118
1165 // call R1, line 119
1180 // call R1, line 120
1195 // call R1, line 121
1210 // call R1, line 122
1220 // call R1, line 124
1230 // call R1, line 127
1240 // call R1, line 131
1252 // call lengthen_V, line 131
1253 if (!r_lengthen_V())
1261 cursor = limit - v_1;
1266 among_var = find_among_b(a_4, 3);
1279 // call R1, line 138
1291 // call lengthen_V, line 138
1292 if (!r_lengthen_V())
1302 private boolean r_Step_7() {
1308 among_var = find_among_b(a_5, 3);
1338 private boolean r_Step_6() {
1344 among_var = find_among_b(a_6, 22);
1469 private boolean r_Step_1c() {
1477 among_var = find_among_b(a_7, 2);
1485 // call R1, line 182
1502 v_1 = limit - cursor;
1505 // literal, line 183
1506 if (!(eq_s_b(1, "n")))
1510 // call R1, line 183
1517 cursor = limit - v_1;
1526 v_2 = limit - cursor;
1529 // literal, line 184
1530 if (!(eq_s_b(1, "h")))
1534 // call R1, line 184
1541 cursor = limit - v_2;
1550 private boolean r_Lose_prefix() {
1557 // literal, line 190
1558 if (!(eq_s(2, "ge")))
1569 if (0 > c || c > limit)
1582 if (!(in_grouping(g_v, 97, 121)))
1590 if (cursor >= limit)
1601 if (!(out_grouping(g_v, 97, 121)))
1609 if (cursor >= limit)
1615 // set GE_removed, line 191
1616 B_GE_removed = true;
1622 private boolean r_Lose_infix() {
1628 if (cursor >= limit)
1640 // literal, line 197
1641 if (!(eq_s(2, "ge")))
1649 if (cursor >= limit)
1660 if (0 > c || c > limit)
1673 if (!(in_grouping(g_v, 97, 121)))
1681 if (cursor >= limit)
1692 if (!(out_grouping(g_v, 97, 121)))
1700 if (cursor >= limit)
1706 // set GE_removed, line 198
1707 B_GE_removed = true;
1713 private boolean r_measure() {
1725 // tolimit, line 204
1727 // setmark p1, line 205
1729 // setmark p2, line 206
1738 replab2: while(true)
1741 if (!(out_grouping(g_v, 97, 121)))
1749 // atleast, line 209
1752 // atleast, line 209
1753 replab4: while(true)
1762 // literal, line 209
1763 if (!(eq_s(2, "ij")))
1770 if (!(in_grouping(g_v, 97, 121)))
1786 if (!(out_grouping(g_v, 97, 121)))
1790 // setmark p1, line 209
1793 replab8: while(true)
1796 if (!(out_grouping(g_v, 97, 121)))
1804 // atleast, line 210
1807 // atleast, line 210
1808 replab10: while(true)
1817 // literal, line 210
1818 if (!(eq_s(2, "ij")))
1825 if (!(in_grouping(g_v, 97, 121)))
1841 if (!(out_grouping(g_v, 97, 121)))
1845 // setmark p2, line 210
1852 public boolean stem() {
1873 // unset Y_found, line 216
1875 // unset stemmed, line 217
1883 // literal, line 218
1884 if (!(eq_s(1, "y")))
1892 // set Y_found, line 218
1900 replab2: while(true)
1911 if (!(in_grouping(g_v, 97, 121)))
1917 // literal, line 219
1918 if (!(eq_s(1, "y")))
1928 if (cursor >= limit)
1936 // set Y_found, line 219
1945 // call measure, line 221
1950 // backwards, line 223
1951 limit_backward = cursor; cursor = limit;
1954 v_5 = limit - cursor;
1957 // call Step_1, line 224
1962 // set stemmed, line 224
1965 cursor = limit - v_5;
1967 v_6 = limit - cursor;
1970 // call Step_2, line 225
1975 // set stemmed, line 225
1978 cursor = limit - v_6;
1980 v_7 = limit - cursor;
1983 // call Step_3, line 226
1988 // set stemmed, line 226
1991 cursor = limit - v_7;
1993 v_8 = limit - cursor;
1996 // call Step_4, line 227
2001 // set stemmed, line 227
2004 cursor = limit - v_8;
2005 cursor = limit_backward; // unset GE_removed, line 229
2006 B_GE_removed = false;
2013 // call Lose_prefix, line 230
2014 if (!r_Lose_prefix())
2019 // call measure, line 230
2026 // backwards, line 231
2027 limit_backward = cursor; cursor = limit;
2030 v_11 = limit - cursor;
2033 // Boolean test GE_removed, line 232
2034 if (!(B_GE_removed))
2038 // call Step_1c, line 232
2044 cursor = limit - v_11;
2045 cursor = limit_backward; // unset GE_removed, line 234
2046 B_GE_removed = false;
2053 // call Lose_infix, line 235
2054 if (!r_Lose_infix())
2059 // call measure, line 235
2066 // backwards, line 236
2067 limit_backward = cursor; cursor = limit;
2070 v_14 = limit - cursor;
2073 // Boolean test GE_removed, line 237
2074 if (!(B_GE_removed))
2078 // call Step_1c, line 237
2084 cursor = limit - v_14;
2085 cursor = limit_backward; // backwards, line 239
2086 limit_backward = cursor; cursor = limit;
2089 v_15 = limit - cursor;
2092 // call Step_7, line 240
2097 // set stemmed, line 240
2100 cursor = limit - v_15;
2102 v_16 = limit - cursor;
2108 // Boolean test stemmed, line 241
2115 // Boolean test GE_removed, line 241
2116 if (!(B_GE_removed))
2121 // call Step_6, line 241
2127 cursor = limit - v_16;
2128 cursor = limit_backward; // do, line 243
2132 // Boolean test Y_found, line 243
2138 replab19: while(true)
2144 golab21: while(true)
2151 // literal, line 243
2152 if (!(eq_s(1, "Y")))
2162 if (cursor >= limit)