20 using Among = SF.Snowball.Among;
22 namespace SF.Snowball.Ext
24 #pragma warning disable 162,164
33 private void InitBlock()
35 a_0 =
new Among[] {
new Among(
"hed", -1, 1,
"",
this),
new Among(
"ethed", 0, 1,
"",
this),
new Among(
"ered", -1, 1,
"",
this),
new Among(
"e", -1, 1,
"",
this),
new Among(
"erede", 3, 1,
"",
this),
new Among(
"ende", 3, 1,
"",
this),
new Among(
"erende", 5, 1,
"",
this),
new Among(
"ene", 3, 1,
"",
this),
new Among(
"erne", 3, 1,
"",
this),
new Among(
"ere", 3, 1,
"",
this),
new Among(
"en", -1, 1,
"",
this),
new Among(
"heden", 10, 1,
"",
this),
new Among(
"eren", 10, 1,
"",
this),
new Among(
"er", -1, 1,
"",
this),
new Among(
"heder", 13, 1,
"",
this),
new Among(
"erer", 13, 1,
"",
this),
new Among(
"s", -1, 2,
"",
this),
new Among(
"heds", 16, 1,
"",
this),
new Among(
"es", 16, 1,
"",
this),
new Among(
"endes", 18, 1,
"",
this),
new Among(
"erendes", 19, 1,
"",
this),
new Among(
"enes", 18, 1,
"",
this),
new Among(
"ernes", 18, 1,
"",
this),
new Among(
"eres", 18, 1,
"",
this),
new Among(
"ens", 16, 1,
"",
this),
new Among(
"hedens", 24, 1,
"",
this),
new Among(
"erens", 24, 1,
"",
this),
new Among(
"ers", 16, 1,
"",
this),
new Among(
"ets", 16, 1,
"",
this),
new Among(
"erets", 28, 1,
"",
this),
new Among(
"et", -1, 1,
"",
this),
new Among(
"eret", 30, 1,
"",
this) };
36 a_1 =
new Among[]{
new Among(
"gd", - 1, - 1,
"",
this),
new Among(
"dt", - 1, - 1,
"",
this),
new Among(
"gt", - 1, - 1,
"",
this),
new Among(
"kt", - 1, - 1,
"",
this)};
37 a_2 =
new Among[]{
new Among(
"ig", - 1, 1,
"",
this),
new Among(
"lig", 0, 1,
"",
this),
new Among(
"elig", 1, 1,
"",
this),
new Among(
"els", - 1, 1,
"",
this),
new Among(
"l\u00F8st", - 1, 2,
"",
this)};
44 private static readonly
char[] g_v =
new char[]{(char) (17), (char) (65), (char) (16), (char) (1), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (48), (char) (0), (char) (128)};
45 private static readonly
char[] g_s_ending =
new char[]{(char) (239), (char) (254), (char) (42), (char) (3), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (0), (char) (16)};
48 private System.Text.StringBuilder S_ch =
new System.Text.StringBuilder();
50 protected internal virtual void copy_from(DanishStemmer other)
54 base.copy_from(other);
57 private bool r_mark_regions()
68 if (!(in_grouping(g_v, 97, 248)))
94 if (!(out_grouping(g_v, 97, 248)))
132 private bool r_main_suffix()
139 v_1 = limit - cursor;
146 v_2 = limit_backward;
147 limit_backward = cursor;
148 cursor = limit - v_1;
153 among_var = find_among_b(a_0, 32);
156 limit_backward = v_2;
161 limit_backward = v_2;
176 if (!(in_grouping_b(g_s_ending, 97, 229)))
187 private bool r_consonant_pair()
194 v_1 = limit - cursor;
197 v_2 = limit - cursor;
204 v_3 = limit_backward;
205 limit_backward = cursor;
206 cursor = limit - v_2;
211 if (find_among_b(a_1, 4) == 0)
213 limit_backward = v_3;
218 limit_backward = v_3;
219 cursor = limit - v_1;
221 if (cursor <= limit_backward)
233 private bool r_other_suffix()
242 v_1 = limit - cursor;
249 if (!(eq_s_b(2,
"st")))
256 if (!(eq_s_b(2,
"ig")))
267 cursor = limit - v_1;
269 v_2 = limit - cursor;
276 v_3 = limit_backward;
277 limit_backward = cursor;
278 cursor = limit - v_2;
283 among_var = find_among_b(a_2, 5);
286 limit_backward = v_3;
291 limit_backward = v_3;
303 v_4 = limit - cursor;
307 if (!r_consonant_pair())
316 cursor = limit - v_4;
322 slice_from(
"l\u00F8s");
328 private bool r_undouble()
334 v_1 = limit - cursor;
341 v_2 = limit_backward;
342 limit_backward = cursor;
343 cursor = limit - v_1;
347 if (!(out_grouping_b(g_v, 97, 248)))
349 limit_backward = v_2;
355 S_ch = slice_to(S_ch);
356 limit_backward = v_2;
367 public override bool Stem()
380 if (!r_mark_regions())
391 limit_backward = cursor; cursor = limit;
394 v_2 = limit - cursor;
398 if (!r_main_suffix())
407 cursor = limit - v_2;
409 v_3 = limit - cursor;
413 if (!r_consonant_pair())
422 cursor = limit - v_3;
424 v_4 = limit - cursor;
428 if (!r_other_suffix())
437 cursor = limit - v_4;
439 v_5 = limit - cursor;
452 cursor = limit - v_5;
453 cursor = limit_backward;
return true;