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 finnishStemmer
extends SnowballProgram
{
12 private Among a_0
[] = {
13 new Among ( "pa", -1, 1, "", this),
14 new Among ( "sti", -1, 2, "", this),
15 new Among ( "kaan", -1, 1, "", this),
16 new Among ( "han", -1, 1, "", this),
17 new Among ( "kin", -1, 1, "", this),
18 new Among ( "h\u00E4n", -1, 1, "", this),
19 new Among ( "k\u00E4\u00E4n", -1, 1, "", this),
20 new Among ( "ko", -1, 1, "", this),
21 new Among ( "p\u00E4", -1, 1, "", this),
22 new Among ( "k\u00F6", -1, 1, "", this)
25 private Among a_1
[] = {
26 new Among ( "lla", -1, -1, "", this),
27 new Among ( "na", -1, -1, "", this),
28 new Among ( "ssa", -1, -1, "", this),
29 new Among ( "ta", -1, -1, "", this),
30 new Among ( "lta", 3, -1, "", this),
31 new Among ( "sta", 3, -1, "", this)
34 private Among a_2
[] = {
35 new Among ( "ll\u00E4", -1, -1, "", this),
36 new Among ( "n\u00E4", -1, -1, "", this),
37 new Among ( "ss\u00E4", -1, -1, "", this),
38 new Among ( "t\u00E4", -1, -1, "", this),
39 new Among ( "lt\u00E4", 3, -1, "", this),
40 new Among ( "st\u00E4", 3, -1, "", this)
43 private Among a_3
[] = {
44 new Among ( "lle", -1, -1, "", this),
45 new Among ( "ine", -1, -1, "", this)
48 private Among a_4
[] = {
49 new Among ( "nsa", -1, 3, "", this),
50 new Among ( "mme", -1, 3, "", this),
51 new Among ( "nne", -1, 3, "", this),
52 new Among ( "ni", -1, 2, "", this),
53 new Among ( "si", -1, 1, "", this),
54 new Among ( "an", -1, 4, "", this),
55 new Among ( "en", -1, 6, "", this),
56 new Among ( "\u00E4n", -1, 5, "", this),
57 new Among ( "ns\u00E4", -1, 3, "", this)
60 private Among a_5
[] = {
61 new Among ( "aa", -1, -1, "", this),
62 new Among ( "ee", -1, -1, "", this),
63 new Among ( "ii", -1, -1, "", this),
64 new Among ( "oo", -1, -1, "", this),
65 new Among ( "uu", -1, -1, "", this),
66 new Among ( "\u00E4\u00E4", -1, -1, "", this),
67 new Among ( "\u00F6\u00F6", -1, -1, "", this)
70 private Among a_6
[] = {
71 new Among ( "a", -1, 8, "", this),
72 new Among ( "lla", 0, -1, "", this),
73 new Among ( "na", 0, -1, "", this),
74 new Among ( "ssa", 0, -1, "", this),
75 new Among ( "ta", 0, -1, "", this),
76 new Among ( "lta", 4, -1, "", this),
77 new Among ( "sta", 4, -1, "", this),
78 new Among ( "tta", 4, 9, "", this),
79 new Among ( "lle", -1, -1, "", this),
80 new Among ( "ine", -1, -1, "", this),
81 new Among ( "ksi", -1, -1, "", this),
82 new Among ( "n", -1, 7, "", this),
83 new Among ( "han", 11, 1, "", this),
84 new Among ( "den", 11, -1, "r_VI", this),
85 new Among ( "seen", 11, -1, "r_LONG", this),
86 new Among ( "hen", 11, 2, "", this),
87 new Among ( "tten", 11, -1, "r_VI", this),
88 new Among ( "hin", 11, 3, "", this),
89 new Among ( "siin", 11, -1, "r_VI", this),
90 new Among ( "hon", 11, 4, "", this),
91 new Among ( "h\u00E4n", 11, 5, "", this),
92 new Among ( "h\u00F6n", 11, 6, "", this),
93 new Among ( "\u00E4", -1, 8, "", this),
94 new Among ( "ll\u00E4", 22, -1, "", this),
95 new Among ( "n\u00E4", 22, -1, "", this),
96 new Among ( "ss\u00E4", 22, -1, "", this),
97 new Among ( "t\u00E4", 22, -1, "", this),
98 new Among ( "lt\u00E4", 26, -1, "", this),
99 new Among ( "st\u00E4", 26, -1, "", this),
100 new Among ( "tt\u00E4", 26, 9, "", this)
103 private Among a_7
[] = {
104 new Among ( "eja", -1, -1, "", this),
105 new Among ( "mma", -1, 1, "", this),
106 new Among ( "imma", 1, -1, "", this),
107 new Among ( "mpa", -1, 1, "", this),
108 new Among ( "impa", 3, -1, "", this),
109 new Among ( "mmi", -1, 1, "", this),
110 new Among ( "immi", 5, -1, "", this),
111 new Among ( "mpi", -1, 1, "", this),
112 new Among ( "impi", 7, -1, "", this),
113 new Among ( "ej\u00E4", -1, -1, "", this),
114 new Among ( "mm\u00E4", -1, 1, "", this),
115 new Among ( "imm\u00E4", 10, -1, "", this),
116 new Among ( "mp\u00E4", -1, 1, "", this),
117 new Among ( "imp\u00E4", 12, -1, "", this)
120 private Among a_8
[] = {
121 new Among ( "i", -1, -1, "", this),
122 new Among ( "j", -1, -1, "", this)
125 private Among a_9
[] = {
126 new Among ( "mma", -1, 1, "", this),
127 new Among ( "imma", 0, -1, "", this)
130 private static final char g_AEI
[] = {17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8 };
132 private static final char g_V1
[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
134 private static final char g_V2
[] = {17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
136 private static final char g_particle_end
[] = {17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
138 private boolean B_ending_removed
;
139 private StringBuffer S_x
= new StringBuffer();
143 private void copy_from(finnishStemmer other
) {
144 B_ending_removed
= other
.B_ending_removed
;
148 super.copy_from(other
);
151 private boolean r_mark_regions() {
162 if (!(in_grouping(g_V1
, 97, 246)))
180 if (!(out_grouping(g_V1
, 97, 246)))
192 // setmark p1, line 46
199 if (!(in_grouping(g_V1
, 97, 246)))
217 if (!(out_grouping(g_V1
, 97, 246)))
229 // setmark p2, line 47
234 private boolean r_R2() {
235 if (!(I_p2
<= cursor
))
242 private boolean r_particle_etc() {
248 v_1
= limit
- cursor
;
255 v_2
= limit_backward
;
256 limit_backward
= cursor
;
257 cursor
= limit
- v_1
;
261 // substring, line 55
262 among_var
= find_among_b(a_0
, 10);
265 limit_backward
= v_2
;
270 limit_backward
= v_2
;
276 if (!(in_grouping_b(g_particle_end
, 97, 246)))
295 private boolean r_possessive() {
302 v_1
= limit
- cursor
;
309 v_2
= limit_backward
;
310 limit_backward
= cursor
;
311 cursor
= limit
- v_1
;
315 // substring, line 69
316 among_var
= find_among_b(a_4
, 9);
319 limit_backward
= v_2
;
324 limit_backward
= v_2
;
332 v_3
= limit
- cursor
;
335 if (!(eq_s_b(1, "k")))
341 cursor
= limit
- v_3
;
353 if (!(eq_s_b(3, "kse")))
370 if (find_among_b(a_1
, 6) == 0)
380 if (find_among_b(a_2
, 6) == 0)
390 if (find_among_b(a_3
, 2) == 0)
401 private boolean r_LONG() {
403 if (find_among_b(a_5
, 7) == 0)
410 private boolean r_VI() {
413 if (!(eq_s_b(1, "i")))
417 if (!(in_grouping_b(g_V2
, 97, 246)))
424 private boolean r_case_ending() {
433 v_1
= limit
- cursor
;
440 v_2
= limit_backward
;
441 limit_backward
= cursor
;
442 cursor
= limit
- v_1
;
446 // substring, line 96
447 among_var
= find_among_b(a_6
, 30);
450 limit_backward
= v_2
;
455 limit_backward
= v_2
;
462 if (!(eq_s_b(1, "a")))
470 if (!(eq_s_b(1, "e")))
478 if (!(eq_s_b(1, "i")))
486 if (!(eq_s_b(1, "o")))
494 if (!(eq_s_b(1, "\u00E4")))
502 if (!(eq_s_b(1, "\u00F6")))
510 v_3
= limit
- cursor
;
514 v_4
= limit
- cursor
;
517 v_5
= limit
- cursor
;
519 // call LONG, line 111
526 cursor
= limit
- v_5
;
528 if (!(eq_s_b(2, "ie")))
530 cursor
= limit
- v_3
;
534 cursor
= limit
- v_4
;
536 if (cursor
<= limit_backward
)
538 cursor
= limit
- v_3
;
548 if (!(in_grouping_b(g_V1
, 97, 246)))
552 if (!(out_grouping_b(g_V1
, 97, 246)))
560 if (!(eq_s_b(1, "e")))
568 // set ending_removed, line 139
569 B_ending_removed
= true;
573 private boolean r_other_endings() {
579 // setlimit, line 142
580 v_1
= limit
- cursor
;
587 v_2
= limit_backward
;
588 limit_backward
= cursor
;
589 cursor
= limit
- v_1
;
593 // substring, line 142
594 among_var
= find_among_b(a_7
, 14);
597 limit_backward
= v_2
;
602 limit_backward
= v_2
;
610 v_3
= limit
- cursor
;
613 if (!(eq_s_b(2, "po")))
619 cursor
= limit
- v_3
;
628 private boolean r_i_plural() {
632 // setlimit, line 154
633 v_1
= limit
- cursor
;
640 v_2
= limit_backward
;
641 limit_backward
= cursor
;
642 cursor
= limit
- v_1
;
646 // substring, line 154
647 if (find_among_b(a_8
, 2) == 0)
649 limit_backward
= v_2
;
654 limit_backward
= v_2
;
660 private boolean r_t_plural() {
669 // setlimit, line 161
670 v_1
= limit
- cursor
;
677 v_2
= limit_backward
;
678 limit_backward
= cursor
;
679 cursor
= limit
- v_1
;
684 if (!(eq_s_b(1, "t")))
686 limit_backward
= v_2
;
692 v_3
= limit
- cursor
;
693 if (!(in_grouping_b(g_V1
, 97, 246)))
695 limit_backward
= v_2
;
698 cursor
= limit
- v_3
;
701 limit_backward
= v_2
;
702 // setlimit, line 165
703 v_4
= limit
- cursor
;
710 v_5
= limit_backward
;
711 limit_backward
= cursor
;
712 cursor
= limit
- v_4
;
716 // substring, line 165
717 among_var
= find_among_b(a_9
, 2);
720 limit_backward
= v_5
;
725 limit_backward
= v_5
;
733 v_6
= limit
- cursor
;
736 if (!(eq_s_b(2, "po")))
742 cursor
= limit
- v_6
;
751 private boolean r_tidy() {
762 // setlimit, line 173
763 v_1
= limit
- cursor
;
770 v_2
= limit_backward
;
771 limit_backward
= cursor
;
772 cursor
= limit
- v_1
;
775 v_3
= limit
- cursor
;
779 v_4
= limit
- cursor
;
780 // call LONG, line 174
785 cursor
= limit
- v_4
;
790 if (cursor
<= limit_backward
)
800 cursor
= limit
- v_3
;
802 v_5
= limit
- cursor
;
807 if (!(in_grouping_b(g_AEI
, 97, 228)))
813 if (!(out_grouping_b(g_V1
, 97, 246)))
820 cursor
= limit
- v_5
;
822 v_6
= limit
- cursor
;
828 if (!(eq_s_b(1, "j")))
836 v_7
= limit
- cursor
;
839 if (!(eq_s_b(1, "o")))
845 cursor
= limit
- v_7
;
847 if (!(eq_s_b(1, "u")))
855 cursor
= limit
- v_6
;
857 v_8
= limit
- cursor
;
863 if (!(eq_s_b(1, "o")))
870 if (!(eq_s_b(1, "j")))
877 cursor
= limit
- v_8
;
878 limit_backward
= v_2
;
882 v_9
= limit
- cursor
;
884 if (!(out_grouping_b(g_V1
, 97, 246)))
888 cursor
= limit
- v_9
;
891 cursor
= limit
- v_9
;
892 if (cursor
<= limit_backward
)
901 if (cursor
<= limit_backward
)
920 public boolean stem() {
934 // call mark_regions, line 185
935 if (!r_mark_regions())
941 // unset ending_removed, line 186
942 B_ending_removed
= false;
943 // backwards, line 187
944 limit_backward
= cursor
; cursor
= limit
;
947 v_2
= limit
- cursor
;
949 // call particle_etc, line 188
950 if (!r_particle_etc())
955 cursor
= limit
- v_2
;
957 v_3
= limit
- cursor
;
959 // call possessive, line 189
965 cursor
= limit
- v_3
;
967 v_4
= limit
- cursor
;
969 // call case_ending, line 190
970 if (!r_case_ending())
975 cursor
= limit
- v_4
;
977 v_5
= limit
- cursor
;
979 // call other_endings, line 191
980 if (!r_other_endings())
985 cursor
= limit
- v_5
;
988 v_6
= limit
- cursor
;
991 // Boolean test ending_removed, line 192
992 if (!(B_ending_removed
))
997 v_7
= limit
- cursor
;
999 // call i_plural, line 192
1005 cursor
= limit
- v_7
;
1008 cursor
= limit
- v_6
;
1010 v_8
= limit
- cursor
;
1012 // call t_plural, line 192
1018 cursor
= limit
- v_8
;
1021 v_9
= limit
- cursor
;
1023 // call tidy, line 193
1029 cursor
= limit
- v_9
;
1030 cursor
= limit_backward
; return true;