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(
"pa", - 1, 1,
"",
this),
new Among(
"sti", - 1, 2,
"",
this),
new Among(
"kaan", - 1, 1,
"",
this),
new Among(
"han", - 1, 1,
"",
this),
new Among(
"kin", - 1, 1,
"",
this),
new Among(
"h\u00E4n", - 1, 1,
"",
this),
new Among(
"k\u00E4\u00E4n", - 1, 1,
"",
this),
new Among(
"ko", - 1, 1,
"",
this),
new Among(
"p\u00E4", - 1, 1,
"",
this),
new Among(
"k\u00F6", - 1, 1,
"",
this)};
36 a_1 =
new Among[]{
new Among(
"lla", - 1, - 1,
"",
this),
new Among(
"na", - 1, - 1,
"",
this),
new Among(
"ssa", - 1, - 1,
"",
this),
new Among(
"ta", - 1, - 1,
"",
this),
new Among(
"lta", 3, - 1,
"",
this),
new Among(
"sta", 3, - 1,
"",
this)};
37 a_2 =
new Among[]{
new Among(
"ll\u00E4", - 1, - 1,
"",
this),
new Among(
"n\u00E4", - 1, - 1,
"",
this),
new Among(
"ss\u00E4", - 1, - 1,
"",
this),
new Among(
"t\u00E4", - 1, - 1,
"",
this),
new Among(
"lt\u00E4", 3, - 1,
"",
this),
new Among(
"st\u00E4", 3, - 1,
"",
this)};
38 a_3 =
new Among[]{
new Among(
"lle", - 1, - 1,
"",
this),
new Among(
"ine", - 1, - 1,
"",
this)};
39 a_4 =
new Among[]{
new Among(
"nsa", - 1, 3,
"",
this),
new Among(
"mme", - 1, 3,
"",
this),
new Among(
"nne", - 1, 3,
"",
this),
new Among(
"ni", - 1, 2,
"",
this),
new Among(
"si", - 1, 1,
"",
this),
new Among(
"an", - 1, 4,
"",
this),
new Among(
"en", - 1, 6,
"",
this),
new Among(
"\u00E4n", - 1, 5,
"",
this),
new Among(
"ns\u00E4", - 1, 3,
"",
this)};
40 a_5 =
new Among[]{
new Among(
"aa", - 1, - 1,
"",
this),
new Among(
"ee", - 1, - 1,
"",
this),
new Among(
"ii", - 1, - 1,
"",
this),
new Among(
"oo", - 1, - 1,
"",
this),
new Among(
"uu", - 1, - 1,
"",
this),
new Among(
"\u00E4\u00E4", - 1, - 1,
"",
this),
new Among(
"\u00F6\u00F6", - 1, - 1,
"",
this)};
41 a_6 =
new Among[]{
new Among(
"a", - 1, 8,
"",
this),
new Among(
"lla", 0, - 1,
"",
this),
new Among(
"na", 0, - 1,
"",
this),
new Among(
"ssa", 0, - 1,
"",
this),
new Among(
"ta", 0, - 1,
"",
this),
new Among(
"lta", 4, - 1,
"",
this),
new Among(
"sta", 4, - 1,
"",
this),
new Among(
"tta", 4, 9,
"",
this),
new Among(
"lle", - 1, - 1,
"",
this),
new Among(
"ine", - 1, - 1,
"",
this),
new Among(
"ksi", - 1, - 1,
"",
this),
new Among(
"n", - 1, 7,
"",
this),
new Among(
"han", 11, 1,
"",
this),
new Among(
"den", 11, - 1,
"r_VI",
this),
new Among(
"seen", 11, - 1,
"r_LONG",
this),
new Among(
"hen", 11, 2,
"",
this),
new Among(
"tten", 11, - 1,
"r_VI",
this),
new Among(
"hin", 11, 3,
"",
this),
new Among(
"siin", 11, - 1,
"r_VI",
this),
new Among(
"hon", 11, 4,
"",
this),
new Among(
"h\u00E4n", 11, 5,
"",
this),
new Among(
"h\u00F6n", 11, 6,
"",
this),
new Among(
"\u00E4", - 1, 8,
"",
this),
new Among(
"ll\u00E4", 22, - 1,
"",
this),
new Among(
"n\u00E4", 22, - 1,
"",
this),
new Among(
"ss\u00E4", 22, - 1,
"",
this),
new Among(
"t\u00E4", 22, - 1,
"",
this),
new Among(
"lt\u00E4", 26, - 1,
"",
this),
new Among(
"st\u00E4", 26, - 1,
"",
this),
new Among(
"tt\u00E4", 26, 9,
"",
this)};
42 a_7 =
new Among[]{
new Among(
"eja", - 1, - 1,
"",
this),
new Among(
"mma", - 1, 1,
"",
this),
new Among(
"imma", 1, - 1,
"",
this),
new Among(
"mpa", - 1, 1,
"",
this),
new Among(
"impa", 3, - 1,
"",
this),
new Among(
"mmi", - 1, 1,
"",
this),
new Among(
"immi", 5, - 1,
"",
this),
new Among(
"mpi", - 1, 1,
"",
this),
new Among(
"impi", 7, - 1,
"",
this),
new Among(
"ej\u00E4", - 1, - 1,
"",
this),
new Among(
"mm\u00E4", - 1, 1,
"",
this),
new Among(
"imm\u00E4", 10, - 1,
"",
this),
new Among(
"mp\u00E4", - 1, 1,
"",
this),
new Among(
"imp\u00E4", 12, - 1,
"",
this)};
43 a_8 =
new Among[]{
new Among(
"i", - 1, - 1,
"",
this),
new Among(
"j", - 1, - 1,
"",
this)};
44 a_9 =
new Among[]{
new Among(
"mma", - 1, 1,
"",
this),
new Among(
"imma", 0, - 1,
"",
this)};
58 private static readonly
char[] g_AEI =
new char[]{(char) (17), (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) (0), (char) (0), (char) (8)};
59 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) (8), (char) (0), (char) (32)};
60 private static readonly
char[] g_V =
new char[]{(char) (17), (char) (65), (char) (16), (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) (0), (char) (8), (char) (0), (char) (32)};
61 private static readonly
char[] g_particle_end =
new char[]{(char) (17), (char) (97), (char) (24), (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) (8), (char) (0), (char) (32)};
63 private bool B_ending_removed;
64 private System.Text.StringBuilder S_x =
new System.Text.StringBuilder();
68 protected internal virtual void copy_from(FinnishStemmer other)
70 B_ending_removed = other.B_ending_removed;
74 base.copy_from(other);
77 private bool r_mark_regions()
90 if (!(in_grouping(g_v, 97, 246)))
116 if (!(out_grouping(g_v, 97, 246)))
143 if (!(in_grouping(g_v, 97, 246)))
169 if (!(out_grouping(g_v, 97, 246)))
195 if (!(I_p2 <= cursor))
202 private bool r_particle_etc()
209 v_1 = limit - cursor;
216 v_2 = limit_backward;
217 limit_backward = cursor;
218 cursor = limit - v_1;
223 among_var = find_among_b(a_0, 10);
226 limit_backward = v_2;
231 limit_backward = v_2;
240 if (!(in_grouping_b(g_particle_end, 97, 246)))
260 private bool r_possessive()
268 v_1 = limit - cursor;
275 v_2 = limit_backward;
276 limit_backward = cursor;
277 cursor = limit - v_1;
282 among_var = find_among_b(a_4, 9);
285 limit_backward = v_2;
290 limit_backward = v_2;
301 v_3 = limit - cursor;
305 if (!(eq_s_b(1,
"k")))
315 cursor = limit - v_3;
328 if (!(eq_s_b(3,
"kse")))
347 if (find_among_b(a_1, 6) == 0)
358 if (find_among_b(a_2, 6) == 0)
369 if (find_among_b(a_3, 2) == 0)
380 private bool r_LONG()
383 if (find_among_b(a_5, 7) == 0)
394 if (!(eq_s_b(1,
"i")))
398 if (!(in_grouping_b(g_V, 97, 246)))
405 private bool r_case()
415 v_1 = limit - cursor;
422 v_2 = limit_backward;
423 limit_backward = cursor;
424 cursor = limit - v_1;
429 among_var = find_among_b(a_6, 30);
432 limit_backward = v_2;
437 limit_backward = v_2;
447 if (!(eq_s_b(1,
"a")))
456 if (!(eq_s_b(1,
"e")))
465 if (!(eq_s_b(1,
"i")))
474 if (!(eq_s_b(1,
"o")))
483 if (!(eq_s_b(1,
"\u00E4")))
492 if (!(eq_s_b(1,
"\u00F6")))
501 v_3 = limit - cursor;
506 v_4 = limit - cursor;
510 v_5 = limit - cursor;
524 cursor = limit - v_5;
526 if (!(eq_s_b(2,
"ie")))
528 cursor = limit - v_3;
536 cursor = limit - v_4;
538 if (cursor <= limit_backward)
540 cursor = limit - v_3;
555 if (!(in_grouping_b(g_v, 97, 246)))
559 if (!(out_grouping_b(g_v, 97, 246)))
568 if (!(eq_s_b(1,
"e")))
577 B_ending_removed =
true;
581 private bool r_other_endings()
589 v_1 = limit - cursor;
596 v_2 = limit_backward;
597 limit_backward = cursor;
598 cursor = limit - v_1;
603 among_var = find_among_b(a_7, 14);
606 limit_backward = v_2;
611 limit_backward = v_2;
622 v_3 = limit - cursor;
626 if (!(eq_s_b(2,
"po")))
636 cursor = limit - v_3;
645 private bool r_i_plural()
651 v_1 = limit - cursor;
658 v_2 = limit_backward;
659 limit_backward = cursor;
660 cursor = limit - v_1;
665 if (find_among_b(a_8, 2) == 0)
667 limit_backward = v_2;
672 limit_backward = v_2;
678 private bool r_t_plural()
689 v_1 = limit - cursor;
696 v_2 = limit_backward;
697 limit_backward = cursor;
698 cursor = limit - v_1;
703 if (!(eq_s_b(1,
"t")))
705 limit_backward = v_2;
711 v_3 = limit - cursor;
712 if (!(in_grouping_b(g_v, 97, 246)))
714 limit_backward = v_2;
717 cursor = limit - v_3;
720 limit_backward = v_2;
722 v_4 = limit - cursor;
729 v_5 = limit_backward;
730 limit_backward = cursor;
731 cursor = limit - v_4;
736 among_var = find_among_b(a_9, 2);
739 limit_backward = v_5;
744 limit_backward = v_5;
755 v_6 = limit - cursor;
759 if (!(eq_s_b(2,
"po")))
769 cursor = limit - v_6;
778 private bool r_tidy()
791 v_1 = limit - cursor;
798 v_2 = limit_backward;
799 limit_backward = cursor;
800 cursor = limit - v_1;
803 v_3 = limit - cursor;
808 v_4 = limit - cursor;
814 cursor = limit - v_4;
819 if (cursor <= limit_backward)
833 cursor = limit - v_3;
835 v_5 = limit - cursor;
841 if (!(in_grouping_b(g_AEI, 97, 228)))
847 if (!(out_grouping_b(g_v, 97, 246)))
858 cursor = limit - v_5;
860 v_6 = limit - cursor;
867 if (!(eq_s_b(1,
"j")))
876 v_7 = limit - cursor;
880 if (!(eq_s_b(1,
"o")))
890 cursor = limit - v_7;
892 if (!(eq_s_b(1,
"u")))
908 cursor = limit - v_6;
910 v_8 = limit - cursor;
917 if (!(eq_s_b(1,
"o")))
924 if (!(eq_s_b(1,
"j")))
935 cursor = limit - v_8;
936 limit_backward = v_2;
940 v_9 = limit - cursor;
943 if (!(out_grouping_b(g_v, 97, 246)))
947 cursor = limit - v_9;
954 cursor = limit - v_9;
955 if (cursor <= limit_backward)
967 if (cursor <= limit_backward)
986 public override bool Stem()
1003 if (!r_mark_regions())
1014 B_ending_removed =
false;
1016 limit_backward = cursor; cursor = limit;
1019 v_2 = limit - cursor;
1023 if (!r_particle_etc())
1032 cursor = limit - v_2;
1034 v_3 = limit - cursor;
1038 if (!r_possessive())
1047 cursor = limit - v_3;
1049 v_4 = limit - cursor;
1062 cursor = limit - v_4;
1064 v_5 = limit - cursor;
1068 if (!r_other_endings())
1077 cursor = limit - v_5;
1081 v_6 = limit - cursor;
1086 if (!(B_ending_removed))
1091 v_7 = limit - cursor;
1104 cursor = limit - v_7;
1111 cursor = limit - v_6;
1113 v_8 = limit - cursor;
1126 cursor = limit - v_8;
1133 v_9 = limit - cursor;
1146 cursor = limit - v_9;
1147 cursor = limit_backward;
return true;