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 DanishStemmer extends SnowballProgram {
12 private Among a_0[] = {
13 new Among ( "hed", -1, 1, "", this),
14 new Among ( "ethed", 0, 1, "", this),
15 new Among ( "ered", -1, 1, "", this),
16 new Among ( "e", -1, 1, "", this),
17 new Among ( "erede", 3, 1, "", this),
18 new Among ( "ende", 3, 1, "", this),
19 new Among ( "erende", 5, 1, "", this),
20 new Among ( "ene", 3, 1, "", this),
21 new Among ( "erne", 3, 1, "", this),
22 new Among ( "ere", 3, 1, "", this),
23 new Among ( "en", -1, 1, "", this),
24 new Among ( "heden", 10, 1, "", this),
25 new Among ( "eren", 10, 1, "", this),
26 new Among ( "er", -1, 1, "", this),
27 new Among ( "heder", 13, 1, "", this),
28 new Among ( "erer", 13, 1, "", this),
29 new Among ( "s", -1, 2, "", this),
30 new Among ( "heds", 16, 1, "", this),
31 new Among ( "es", 16, 1, "", this),
32 new Among ( "endes", 18, 1, "", this),
33 new Among ( "erendes", 19, 1, "", this),
34 new Among ( "enes", 18, 1, "", this),
35 new Among ( "ernes", 18, 1, "", this),
36 new Among ( "eres", 18, 1, "", this),
37 new Among ( "ens", 16, 1, "", this),
38 new Among ( "hedens", 24, 1, "", this),
39 new Among ( "erens", 24, 1, "", this),
40 new Among ( "ers", 16, 1, "", this),
41 new Among ( "ets", 16, 1, "", this),
42 new Among ( "erets", 28, 1, "", this),
43 new Among ( "et", -1, 1, "", this),
44 new Among ( "eret", 30, 1, "", this)
47 private Among a_1[] = {
48 new Among ( "gd", -1, -1, "", this),
49 new Among ( "dt", -1, -1, "", this),
50 new Among ( "gt", -1, -1, "", this),
51 new Among ( "kt", -1, -1, "", this)
54 private Among a_2[] = {
55 new Among ( "ig", -1, 1, "", this),
56 new Among ( "lig", 0, 1, "", this),
57 new Among ( "elig", 1, 1, "", this),
58 new Among ( "els", -1, 1, "", this),
59 new Among ( "l\u00F8st", -1, 2, "", this)
62 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 };
64 private static final char g_s_ending[] = {239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 };
68 private StringBuilder S_ch = new StringBuilder();
70 private void copy_from(DanishStemmer other) {
74 super.copy_from(other);
77 private boolean r_mark_regions() {
88 if (0 > c || c > limit)
102 if (!(in_grouping(g_v, 97, 248)))
120 if (!(out_grouping(g_v, 97, 248)))
132 // setmark p1, line 34
146 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 41
166 among_var = find_among_b(a_0, 32);
169 limit_backward = v_2;
174 limit_backward = v_2;
185 if (!(in_grouping_b(g_s_ending, 97, 229)))
196 private boolean r_consonant_pair() {
202 v_1 = limit - cursor;
205 v_2 = limit - cursor;
212 v_3 = limit_backward;
213 limit_backward = cursor;
214 cursor = limit - v_2;
218 // substring, line 56
219 if (find_among_b(a_1, 4) == 0)
221 limit_backward = v_3;
226 limit_backward = v_3;
227 cursor = limit - v_1;
229 if (cursor <= limit_backward)
241 private boolean r_other_suffix() {
249 v_1 = limit - cursor;
255 if (!(eq_s_b(2, "st")))
262 if (!(eq_s_b(2, "ig")))
269 cursor = limit - v_1;
271 v_2 = limit - cursor;
278 v_3 = limit_backward;
279 limit_backward = cursor;
280 cursor = limit - v_2;
284 // substring, line 67
285 among_var = find_among_b(a_2, 5);
288 limit_backward = v_3;
293 limit_backward = v_3;
302 v_4 = limit - cursor;
304 // call consonant_pair, line 70
305 if (!r_consonant_pair())
310 cursor = limit - v_4;
315 slice_from("l\u00F8s");
321 private boolean r_undouble() {
326 v_1 = limit - cursor;
333 v_2 = limit_backward;
334 limit_backward = cursor;
335 cursor = limit - v_1;
339 if (!(out_grouping_b(g_v, 97, 248)))
341 limit_backward = v_2;
347 S_ch = slice_to(S_ch);
348 limit_backward = v_2;
359 public boolean stem() {
369 // call mark_regions, line 84
370 if (!r_mark_regions())
376 // backwards, line 85
377 limit_backward = cursor; cursor = limit;
380 v_2 = limit - cursor;
382 // call main_suffix, line 86
383 if (!r_main_suffix())
388 cursor = limit - v_2;
390 v_3 = limit - cursor;
392 // call consonant_pair, line 87
393 if (!r_consonant_pair())
398 cursor = limit - v_3;
400 v_4 = limit - cursor;
402 // call other_suffix, line 88
403 if (!r_other_suffix())
408 cursor = limit - v_4;
410 v_5 = limit - cursor;
412 // call undouble, line 89
418 cursor = limit - v_5;
419 cursor = limit_backward; return true;