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 swedishStemmer
extends SnowballProgram
{
12 private Among a_0
[] = {
13 new Among ( "a", -1, 1, "", this),
14 new Among ( "arna", 0, 1, "", this),
15 new Among ( "erna", 0, 1, "", this),
16 new Among ( "heterna", 2, 1, "", this),
17 new Among ( "orna", 0, 1, "", this),
18 new Among ( "ad", -1, 1, "", this),
19 new Among ( "e", -1, 1, "", this),
20 new Among ( "ade", 6, 1, "", this),
21 new Among ( "ande", 6, 1, "", this),
22 new Among ( "arne", 6, 1, "", this),
23 new Among ( "are", 6, 1, "", this),
24 new Among ( "aste", 6, 1, "", this),
25 new Among ( "en", -1, 1, "", this),
26 new Among ( "anden", 12, 1, "", this),
27 new Among ( "aren", 12, 1, "", this),
28 new Among ( "heten", 12, 1, "", this),
29 new Among ( "ern", -1, 1, "", this),
30 new Among ( "ar", -1, 1, "", this),
31 new Among ( "er", -1, 1, "", this),
32 new Among ( "heter", 18, 1, "", this),
33 new Among ( "or", -1, 1, "", this),
34 new Among ( "s", -1, 2, "", this),
35 new Among ( "as", 21, 1, "", this),
36 new Among ( "arnas", 22, 1, "", this),
37 new Among ( "ernas", 22, 1, "", this),
38 new Among ( "ornas", 22, 1, "", this),
39 new Among ( "es", 21, 1, "", this),
40 new Among ( "ades", 26, 1, "", this),
41 new Among ( "andes", 26, 1, "", this),
42 new Among ( "ens", 21, 1, "", this),
43 new Among ( "arens", 29, 1, "", this),
44 new Among ( "hetens", 29, 1, "", this),
45 new Among ( "erns", 21, 1, "", this),
46 new Among ( "at", -1, 1, "", this),
47 new Among ( "andet", -1, 1, "", this),
48 new Among ( "het", -1, 1, "", this),
49 new Among ( "ast", -1, 1, "", this)
52 private Among a_1
[] = {
53 new Among ( "dd", -1, -1, "", this),
54 new Among ( "gd", -1, -1, "", this),
55 new Among ( "nn", -1, -1, "", this),
56 new Among ( "dt", -1, -1, "", this),
57 new Among ( "gt", -1, -1, "", this),
58 new Among ( "kt", -1, -1, "", this),
59 new Among ( "tt", -1, -1, "", this)
62 private Among a_2
[] = {
63 new Among ( "ig", -1, 1, "", this),
64 new Among ( "lig", 0, 1, "", this),
65 new Among ( "els", -1, 1, "", this),
66 new Among ( "fullt", -1, 3, "", this),
67 new Among ( "l\u00F6st", -1, 2, "", this)
70 private static final char g_v
[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32 };
72 private static final char g_s_ending
[] = {119, 127, 149 };
77 private void copy_from(swedishStemmer other
) {
80 super.copy_from(other
);
83 private boolean r_mark_regions() {
94 if (0 > c
|| c
> limit
)
100 // setmark x, line 29
108 if (!(in_grouping(g_v
, 97, 246)))
126 if (!(out_grouping(g_v
, 97, 246)))
138 // setmark p1, line 30
152 private boolean r_main_suffix() {
158 v_1
= limit
- cursor
;
165 v_2
= limit_backward
;
166 limit_backward
= cursor
;
167 cursor
= limit
- v_1
;
171 // substring, line 37
172 among_var
= find_among_b(a_0
, 37);
175 limit_backward
= v_2
;
180 limit_backward
= v_2
;
191 if (!(in_grouping_b(g_s_ending
, 98, 121)))
202 private boolean r_consonant_pair() {
207 v_1
= limit
- cursor
;
214 v_2
= limit_backward
;
215 limit_backward
= cursor
;
216 cursor
= limit
- v_1
;
219 v_3
= limit
- cursor
;
221 if (find_among_b(a_1
, 7) == 0)
223 limit_backward
= v_2
;
226 cursor
= limit
- v_3
;
231 if (cursor
<= limit_backward
)
233 limit_backward
= v_2
;
241 limit_backward
= v_2
;
245 private boolean r_other_suffix() {
250 v_1
= limit
- cursor
;
257 v_2
= limit_backward
;
258 limit_backward
= cursor
;
259 cursor
= limit
- v_1
;
263 // substring, line 56
264 among_var
= find_among_b(a_2
, 5);
267 limit_backward
= v_2
;
274 limit_backward
= v_2
;
284 slice_from("l\u00F6s");
292 limit_backward
= v_2
;
296 public boolean stem() {
305 // call mark_regions, line 66
306 if (!r_mark_regions())
312 // backwards, line 67
313 limit_backward
= cursor
; cursor
= limit
;
316 v_2
= limit
- cursor
;
318 // call main_suffix, line 68
319 if (!r_main_suffix())
324 cursor
= limit
- v_2
;
326 v_3
= limit
- cursor
;
328 // call consonant_pair, line 69
329 if (!r_consonant_pair())
334 cursor
= limit
- v_3
;
336 v_4
= limit
- cursor
;
338 // call other_suffix, line 70
339 if (!r_other_suffix())
344 cursor
= limit
- v_4
;
345 cursor
= limit_backward
; return true;