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 porterStemmer
extends SnowballProgram
{
12 private Among a_0
[] = {
13 new Among ( "s", -1, 3, "", this),
14 new Among ( "ies", 0, 2, "", this),
15 new Among ( "sses", 0, 1, "", this),
16 new Among ( "ss", 0, -1, "", this)
19 private Among a_1
[] = {
20 new Among ( "", -1, 3, "", this),
21 new Among ( "bb", 0, 2, "", this),
22 new Among ( "dd", 0, 2, "", this),
23 new Among ( "ff", 0, 2, "", this),
24 new Among ( "gg", 0, 2, "", this),
25 new Among ( "bl", 0, 1, "", this),
26 new Among ( "mm", 0, 2, "", this),
27 new Among ( "nn", 0, 2, "", this),
28 new Among ( "pp", 0, 2, "", this),
29 new Among ( "rr", 0, 2, "", this),
30 new Among ( "at", 0, 1, "", this),
31 new Among ( "tt", 0, 2, "", this),
32 new Among ( "iz", 0, 1, "", this)
35 private Among a_2
[] = {
36 new Among ( "ed", -1, 2, "", this),
37 new Among ( "eed", 0, 1, "", this),
38 new Among ( "ing", -1, 2, "", this)
41 private Among a_3
[] = {
42 new Among ( "anci", -1, 3, "", this),
43 new Among ( "enci", -1, 2, "", this),
44 new Among ( "abli", -1, 4, "", this),
45 new Among ( "eli", -1, 6, "", this),
46 new Among ( "alli", -1, 9, "", this),
47 new Among ( "ousli", -1, 12, "", this),
48 new Among ( "entli", -1, 5, "", this),
49 new Among ( "aliti", -1, 10, "", this),
50 new Among ( "biliti", -1, 14, "", this),
51 new Among ( "iviti", -1, 13, "", this),
52 new Among ( "tional", -1, 1, "", this),
53 new Among ( "ational", 10, 8, "", this),
54 new Among ( "alism", -1, 10, "", this),
55 new Among ( "ation", -1, 8, "", this),
56 new Among ( "ization", 13, 7, "", this),
57 new Among ( "izer", -1, 7, "", this),
58 new Among ( "ator", -1, 8, "", this),
59 new Among ( "iveness", -1, 13, "", this),
60 new Among ( "fulness", -1, 11, "", this),
61 new Among ( "ousness", -1, 12, "", this)
64 private Among a_4
[] = {
65 new Among ( "icate", -1, 2, "", this),
66 new Among ( "ative", -1, 3, "", this),
67 new Among ( "alize", -1, 1, "", this),
68 new Among ( "iciti", -1, 2, "", this),
69 new Among ( "ical", -1, 2, "", this),
70 new Among ( "ful", -1, 3, "", this),
71 new Among ( "ness", -1, 3, "", this)
74 private Among a_5
[] = {
75 new Among ( "ic", -1, 1, "", this),
76 new Among ( "ance", -1, 1, "", this),
77 new Among ( "ence", -1, 1, "", this),
78 new Among ( "able", -1, 1, "", this),
79 new Among ( "ible", -1, 1, "", this),
80 new Among ( "ate", -1, 1, "", this),
81 new Among ( "ive", -1, 1, "", this),
82 new Among ( "ize", -1, 1, "", this),
83 new Among ( "iti", -1, 1, "", this),
84 new Among ( "al", -1, 1, "", this),
85 new Among ( "ism", -1, 1, "", this),
86 new Among ( "ion", -1, 2, "", this),
87 new Among ( "er", -1, 1, "", this),
88 new Among ( "ous", -1, 1, "", this),
89 new Among ( "ant", -1, 1, "", this),
90 new Among ( "ent", -1, 1, "", this),
91 new Among ( "ment", 15, 1, "", this),
92 new Among ( "ement", 16, 1, "", this),
93 new Among ( "ou", -1, 1, "", this)
96 private static final char g_v
[] = {17, 65, 16, 1 };
98 private static final char g_v_WXY
[] = {1, 17, 65, 208, 1 };
100 private boolean B_Y_found
;
104 private void copy_from(porterStemmer other
) {
105 B_Y_found
= other
.B_Y_found
;
108 super.copy_from(other
);
111 private boolean r_shortv() {
113 if (!(out_grouping_b(g_v_WXY
, 89, 121)))
117 if (!(in_grouping_b(g_v
, 97, 121)))
121 if (!(out_grouping_b(g_v
, 97, 121)))
128 private boolean r_R1() {
129 if (!(I_p1
<= cursor
))
136 private boolean r_R2() {
137 if (!(I_p2
<= cursor
))
144 private boolean r_Step_1a() {
149 // substring, line 25
150 among_var
= find_among_b(a_0
, 4);
179 private boolean r_Step_1b() {
187 // substring, line 34
188 among_var
= find_among_b(a_2
, 3);
211 v_1
= limit
- cursor
;
216 if (!(in_grouping_b(g_v
, 97, 121)))
222 if (cursor
<= limit_backward
)
228 cursor
= limit
- v_1
;
232 v_3
= limit
- cursor
;
233 // substring, line 39
234 among_var
= find_among_b(a_1
, 13);
239 cursor
= limit
- v_3
;
248 insert(cursor
, cursor
, "e");
257 if (cursor
<= limit_backward
)
275 v_4
= limit
- cursor
;
276 // call shortv, line 45
281 cursor
= limit
- v_4
;
285 insert(cursor
, cursor
, "e");
295 private boolean r_Step_1c() {
302 v_1
= limit
- cursor
;
305 if (!(eq_s_b(1, "y")))
311 cursor
= limit
- v_1
;
313 if (!(eq_s_b(1, "Y")))
324 if (!(in_grouping_b(g_v
, 97, 121)))
330 if (cursor
<= limit_backward
)
341 private boolean r_Step_2() {
346 // substring, line 58
347 among_var
= find_among_b(a_3
, 20);
436 private boolean r_Step_3() {
441 // substring, line 82
442 among_var
= find_among_b(a_4
, 7);
476 private boolean r_Step_4() {
482 // substring, line 92
483 among_var
= find_among_b(a_5
, 19);
507 v_1
= limit
- cursor
;
510 if (!(eq_s_b(1, "s")))
516 cursor
= limit
- v_1
;
518 if (!(eq_s_b(1, "t")))
530 private boolean r_Step_5a() {
537 if (!(eq_s_b(1, "e")))
545 v_1
= limit
- cursor
;
554 cursor
= limit
- v_1
;
563 v_2
= limit
- cursor
;
565 // call shortv, line 102
572 cursor
= limit
- v_2
;
580 private boolean r_Step_5b() {
585 if (!(eq_s_b(1, "l")))
597 if (!(eq_s_b(1, "l")))
606 public boolean stem() {
624 // unset Y_found, line 115
641 // set Y_found, line 116
660 if (!(in_grouping(g_v
, 97, 121)))
685 // set Y_found, line 117
704 if (!(in_grouping(g_v
, 97, 121)))
720 if (!(out_grouping(g_v
, 97, 121)))
732 // setmark p1, line 122
738 if (!(in_grouping(g_v
, 97, 121)))
754 if (!(out_grouping(g_v
, 97, 121)))
766 // setmark p2, line 123
770 // backwards, line 126
771 limit_backward
= cursor
; cursor
= limit
;
774 v_10
= limit
- cursor
;
776 // call Step_1a, line 127
782 cursor
= limit
- v_10
;
784 v_11
= limit
- cursor
;
786 // call Step_1b, line 128
792 cursor
= limit
- v_11
;
794 v_12
= limit
- cursor
;
796 // call Step_1c, line 129
802 cursor
= limit
- v_12
;
804 v_13
= limit
- cursor
;
806 // call Step_2, line 130
812 cursor
= limit
- v_13
;
814 v_14
= limit
- cursor
;
816 // call Step_3, line 131
822 cursor
= limit
- v_14
;
824 v_15
= limit
- cursor
;
826 // call Step_4, line 132
832 cursor
= limit
- v_15
;
834 v_16
= limit
- cursor
;
836 // call Step_5a, line 133
842 cursor
= limit
- v_16
;
844 v_17
= limit
- cursor
;
846 // call Step_5b, line 134
852 cursor
= limit
- v_17
;
853 cursor
= limit_backward
; // do, line 137
857 // Boolean test Y_found, line 137
863 replab24
: while(true)