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 norwegianStemmer
extends SnowballProgram
{
12 private Among a_0
[] = {
13 new Among ( "a", -1, 1, "", this),
14 new Among ( "e", -1, 1, "", this),
15 new Among ( "ede", 1, 1, "", this),
16 new Among ( "ande", 1, 1, "", this),
17 new Among ( "ende", 1, 1, "", this),
18 new Among ( "ane", 1, 1, "", this),
19 new Among ( "ene", 1, 1, "", this),
20 new Among ( "hetene", 6, 1, "", this),
21 new Among ( "erte", 1, 3, "", this),
22 new Among ( "en", -1, 1, "", this),
23 new Among ( "heten", 9, 1, "", this),
24 new Among ( "ar", -1, 1, "", this),
25 new Among ( "er", -1, 1, "", this),
26 new Among ( "heter", 12, 1, "", this),
27 new Among ( "s", -1, 2, "", this),
28 new Among ( "as", 14, 1, "", this),
29 new Among ( "es", 14, 1, "", this),
30 new Among ( "edes", 16, 1, "", this),
31 new Among ( "endes", 16, 1, "", this),
32 new Among ( "enes", 16, 1, "", this),
33 new Among ( "hetenes", 19, 1, "", this),
34 new Among ( "ens", 14, 1, "", this),
35 new Among ( "hetens", 21, 1, "", this),
36 new Among ( "ers", 14, 1, "", this),
37 new Among ( "ets", 14, 1, "", this),
38 new Among ( "et", -1, 1, "", this),
39 new Among ( "het", 25, 1, "", this),
40 new Among ( "ert", -1, 3, "", this),
41 new Among ( "ast", -1, 1, "", this)
44 private Among a_1
[] = {
45 new Among ( "dt", -1, -1, "", this),
46 new Among ( "vt", -1, -1, "", this)
49 private Among a_2
[] = {
50 new Among ( "leg", -1, 1, "", this),
51 new Among ( "eleg", 0, 1, "", this),
52 new Among ( "ig", -1, 1, "", this),
53 new Among ( "eig", 2, 1, "", this),
54 new Among ( "lig", 2, 1, "", this),
55 new Among ( "elig", 4, 1, "", this),
56 new Among ( "els", -1, 1, "", this),
57 new Among ( "lov", -1, 1, "", this),
58 new Among ( "elov", 7, 1, "", this),
59 new Among ( "slov", 7, 1, "", this),
60 new Among ( "hetslov", 9, 1, "", this)
63 private static final char g_v
[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
65 private static final char g_s_ending
[] = {119, 125, 149, 1 };
70 private void copy_from(norwegianStemmer other
) {
73 super.copy_from(other
);
76 private boolean r_mark_regions() {
87 if (0 > c
|| c
> limit
)
101 if (!(in_grouping(g_v
, 97, 248)))
119 if (!(out_grouping(g_v
, 97, 248)))
131 // setmark p1, line 31
145 private boolean r_main_suffix() {
152 v_1
= limit
- cursor
;
159 v_2
= limit_backward
;
160 limit_backward
= cursor
;
161 cursor
= limit
- v_1
;
165 // substring, line 38
166 among_var
= find_among_b(a_0
, 29);
169 limit_backward
= v_2
;
174 limit_backward
= v_2
;
187 v_3
= limit
- cursor
;
189 if (!(in_grouping_b(g_s_ending
, 98, 122)))
195 cursor
= limit
- v_3
;
198 if (!(eq_s_b(1, "k")))
202 if (!(out_grouping_b(g_v
, 97, 248)))
219 private boolean r_consonant_pair() {
225 v_1
= limit
- cursor
;
228 v_2
= limit
- cursor
;
235 v_3
= limit_backward
;
236 limit_backward
= cursor
;
237 cursor
= limit
- v_2
;
241 // substring, line 54
242 if (find_among_b(a_1
, 2) == 0)
244 limit_backward
= v_3
;
249 limit_backward
= v_3
;
250 cursor
= limit
- v_1
;
252 if (cursor
<= limit_backward
)
264 private boolean r_other_suffix() {
270 v_1
= limit
- cursor
;
277 v_2
= limit_backward
;
278 limit_backward
= cursor
;
279 cursor
= limit
- v_1
;
283 // substring, line 63
284 among_var
= find_among_b(a_2
, 11);
287 limit_backward
= v_2
;
292 limit_backward
= v_2
;
305 public boolean stem() {
314 // call mark_regions, line 74
315 if (!r_mark_regions())
321 // backwards, line 75
322 limit_backward
= cursor
; cursor
= limit
;
325 v_2
= limit
- cursor
;
327 // call main_suffix, line 76
328 if (!r_main_suffix())
333 cursor
= limit
- v_2
;
335 v_3
= limit
- cursor
;
337 // call consonant_pair, line 77
338 if (!r_consonant_pair())
343 cursor
= limit
- v_3
;
345 v_4
= limit
- cursor
;
347 // call other_suffix, line 78
348 if (!r_other_suffix())
353 cursor
= limit
- v_4
;
354 cursor
= limit_backward
; return true;