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(
"a", - 1, 1,
"",
this),
new Among(
"arna", 0, 1,
"",
this),
new Among(
"erna", 0, 1,
"",
this),
new Among(
"heterna", 2, 1,
"",
this),
new Among(
"orna", 0, 1,
"",
this),
new Among(
"ad", - 1, 1,
"",
this),
new Among(
"e", - 1, 1,
"",
this),
new Among(
"ade", 6, 1,
"",
this),
new Among(
"ande", 6, 1,
"",
this),
new Among(
"arne", 6, 1,
"",
this),
new Among(
"are", 6, 1,
"",
this),
new Among(
"aste", 6, 1,
"",
this),
new Among(
"en", - 1, 1,
"",
this),
new Among(
"anden", 12, 1,
"",
this),
new Among(
"aren", 12, 1,
"",
this),
new Among(
"heten", 12, 1,
"",
this),
new Among(
"ern", - 1, 1,
"",
this),
new Among(
"ar", - 1, 1,
"",
this),
new Among(
"er", - 1, 1,
"",
this),
new Among(
"heter", 18, 1,
"",
this),
new Among(
"or", - 1, 1,
"",
this),
new Among(
"s", - 1, 2,
"",
this),
new Among(
"as", 21, 1,
"",
this),
new Among(
"arnas", 22, 1,
"",
this),
new Among(
"ernas", 22, 1,
"",
this),
new Among(
"ornas", 22, 1,
"",
this),
new Among(
"es", 21, 1,
"",
this),
new Among(
"ades", 26, 1,
"",
this),
new Among(
"andes", 26, 1,
"",
this),
new Among(
"ens", 21, 1,
"",
this),
new Among(
"arens", 29, 1,
"",
this),
new Among(
"hetens", 29, 1,
"",
this),
new Among(
"erns", 21, 1,
"",
this),
new Among(
"at", - 1, 1,
"",
this),
new Among(
"andet", - 1, 1,
"",
this),
new Among(
"het", - 1, 1,
"",
this),
new Among(
"ast", - 1, 1,
"",
this)};
36 a_1 =
new Among[]{
new Among(
"dd", - 1, - 1,
"",
this),
new Among(
"gd", - 1, - 1,
"",
this),
new Among(
"nn", - 1, - 1,
"",
this),
new Among(
"dt", - 1, - 1,
"",
this),
new Among(
"gt", - 1, - 1,
"",
this),
new Among(
"kt", - 1, - 1,
"",
this),
new Among(
"tt", - 1, - 1,
"",
this)};
37 a_2 =
new Among[]{
new Among(
"ig", - 1, 1,
"",
this),
new Among(
"lig", 0, 1,
"",
this),
new Among(
"els", - 1, 1,
"",
this),
new Among(
"fullt", - 1, 3,
"",
this),
new Among(
"l\u00F6st", - 1, 2,
"",
this)};
43 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) (24), (char) (0), (char) (32)};
44 private static readonly
char[] g_s_ending =
new char[]{(char) (119), (char) (127), (char) (149)};
48 protected internal virtual void copy_from(SwedishStemmer other)
51 base.copy_from(other);
54 private bool r_mark_regions()
65 if (!(in_grouping(g_v, 97, 246)))
91 if (!(out_grouping(g_v, 97, 246)))
129 private bool r_main_suffix()
136 v_1 = limit - cursor;
143 v_2 = limit_backward;
144 limit_backward = cursor;
145 cursor = limit - v_1;
150 among_var = find_among_b(a_0, 37);
153 limit_backward = v_2;
158 limit_backward = v_2;
173 if (!(in_grouping_b(g_s_ending, 98, 121)))
184 private bool r_consonant_pair()
190 v_1 = limit - cursor;
197 v_2 = limit_backward;
198 limit_backward = cursor;
199 cursor = limit - v_1;
202 v_3 = limit - cursor;
204 if (find_among_b(a_1, 7) == 0)
206 limit_backward = v_2;
209 cursor = limit - v_3;
214 if (cursor <= limit_backward)
216 limit_backward = v_2;
224 limit_backward = v_2;
228 private bool r_other_suffix()
234 v_1 = limit - cursor;
241 v_2 = limit_backward;
242 limit_backward = cursor;
243 cursor = limit - v_1;
248 among_var = find_among_b(a_2, 5);
251 limit_backward = v_2;
260 limit_backward = v_2;
272 slice_from(
"l\u00F6s");
281 limit_backward = v_2;
285 public override bool Stem()
297 if (!r_mark_regions())
308 limit_backward = cursor; cursor = limit;
311 v_2 = limit - cursor;
315 if (!r_main_suffix())
324 cursor = limit - v_2;
326 v_3 = limit - cursor;
330 if (!r_consonant_pair())
339 cursor = limit - v_3;
341 v_4 = limit - cursor;
345 if (!r_other_suffix())
354 cursor = limit - v_4;
355 cursor = limit_backward;
return true;