📄 porterstemmer.java
字号:
// This file was generated automatically by the Snowball to Java compilerpackage org.tartarus.snowball.ext;import org.tartarus.snowball.Among; /** * This class was automatically generated by a Snowball to Java compiler * It implements the stemming algorithm defined by a snowball script. */public class porterStemmer extends org.tartarus.snowball.SnowballStemmer {private static final long serialVersionUID = 1L; private final static porterStemmer methodObject = new porterStemmer (); private final static Among a_0[] = { new Among ( "s", -1, 3, "", methodObject ), new Among ( "ies", 0, 2, "", methodObject ), new Among ( "sses", 0, 1, "", methodObject ), new Among ( "ss", 0, -1, "", methodObject ) }; private final static Among a_1[] = { new Among ( "", -1, 3, "", methodObject ), new Among ( "bb", 0, 2, "", methodObject ), new Among ( "dd", 0, 2, "", methodObject ), new Among ( "ff", 0, 2, "", methodObject ), new Among ( "gg", 0, 2, "", methodObject ), new Among ( "bl", 0, 1, "", methodObject ), new Among ( "mm", 0, 2, "", methodObject ), new Among ( "nn", 0, 2, "", methodObject ), new Among ( "pp", 0, 2, "", methodObject ), new Among ( "rr", 0, 2, "", methodObject ), new Among ( "at", 0, 1, "", methodObject ), new Among ( "tt", 0, 2, "", methodObject ), new Among ( "iz", 0, 1, "", methodObject ) }; private final static Among a_2[] = { new Among ( "ed", -1, 2, "", methodObject ), new Among ( "eed", 0, 1, "", methodObject ), new Among ( "ing", -1, 2, "", methodObject ) }; private final static Among a_3[] = { new Among ( "anci", -1, 3, "", methodObject ), new Among ( "enci", -1, 2, "", methodObject ), new Among ( "abli", -1, 4, "", methodObject ), new Among ( "eli", -1, 6, "", methodObject ), new Among ( "alli", -1, 9, "", methodObject ), new Among ( "ousli", -1, 12, "", methodObject ), new Among ( "entli", -1, 5, "", methodObject ), new Among ( "aliti", -1, 10, "", methodObject ), new Among ( "biliti", -1, 14, "", methodObject ), new Among ( "iviti", -1, 13, "", methodObject ), new Among ( "tional", -1, 1, "", methodObject ), new Among ( "ational", 10, 8, "", methodObject ), new Among ( "alism", -1, 10, "", methodObject ), new Among ( "ation", -1, 8, "", methodObject ), new Among ( "ization", 13, 7, "", methodObject ), new Among ( "izer", -1, 7, "", methodObject ), new Among ( "ator", -1, 8, "", methodObject ), new Among ( "iveness", -1, 13, "", methodObject ), new Among ( "fulness", -1, 11, "", methodObject ), new Among ( "ousness", -1, 12, "", methodObject ) }; private final static Among a_4[] = { new Among ( "icate", -1, 2, "", methodObject ), new Among ( "ative", -1, 3, "", methodObject ), new Among ( "alize", -1, 1, "", methodObject ), new Among ( "iciti", -1, 2, "", methodObject ), new Among ( "ical", -1, 2, "", methodObject ), new Among ( "ful", -1, 3, "", methodObject ), new Among ( "ness", -1, 3, "", methodObject ) }; private final static Among a_5[] = { new Among ( "ic", -1, 1, "", methodObject ), new Among ( "ance", -1, 1, "", methodObject ), new Among ( "ence", -1, 1, "", methodObject ), new Among ( "able", -1, 1, "", methodObject ), new Among ( "ible", -1, 1, "", methodObject ), new Among ( "ate", -1, 1, "", methodObject ), new Among ( "ive", -1, 1, "", methodObject ), new Among ( "ize", -1, 1, "", methodObject ), new Among ( "iti", -1, 1, "", methodObject ), new Among ( "al", -1, 1, "", methodObject ), new Among ( "ism", -1, 1, "", methodObject ), new Among ( "ion", -1, 2, "", methodObject ), new Among ( "er", -1, 1, "", methodObject ), new Among ( "ous", -1, 1, "", methodObject ), new Among ( "ant", -1, 1, "", methodObject ), new Among ( "ent", -1, 1, "", methodObject ), new Among ( "ment", 15, 1, "", methodObject ), new Among ( "ement", 16, 1, "", methodObject ), new Among ( "ou", -1, 1, "", methodObject ) }; private static final char g_v[] = {17, 65, 16, 1 }; private static final char g_v_WXY[] = {1, 17, 65, 208, 1 }; private boolean B_Y_found; private int I_p2; private int I_p1; private void copy_from(porterStemmer other) { B_Y_found = other.B_Y_found; I_p2 = other.I_p2; I_p1 = other.I_p1; super.copy_from(other); } private boolean r_shortv() { // (, line 19 if (!(out_grouping_b(g_v_WXY, 89, 121))) { return false; } if (!(in_grouping_b(g_v, 97, 121))) { return false; } if (!(out_grouping_b(g_v, 97, 121))) { return false; } return true; } private boolean r_R1() { if (!(I_p1 <= cursor)) { return false; } return true; } private boolean r_R2() { if (!(I_p2 <= cursor)) { return false; } return true; } private boolean r_Step_1a() { int among_var; // (, line 24 // [, line 25 ket = cursor; // substring, line 25 among_var = find_among_b(a_0, 4); if (among_var == 0) { return false; } // ], line 25 bra = cursor; switch(among_var) { case 0: return false; case 1: // (, line 26 // <-, line 26 slice_from("ss"); break; case 2: // (, line 27 // <-, line 27 slice_from("i"); break; case 3: // (, line 29 // delete, line 29 slice_del(); break; } return true; } private boolean r_Step_1b() { int among_var; int v_1; int v_3; int v_4; // (, line 33 // [, line 34 ket = cursor; // substring, line 34 among_var = find_among_b(a_2, 3); if (among_var == 0) { return false; } // ], line 34 bra = cursor; switch(among_var) { case 0: return false; case 1: // (, line 35 // call R1, line 35 if (!r_R1()) { return false; } // <-, line 35 slice_from("ee"); break; case 2: // (, line 37 // test, line 38 v_1 = limit - cursor; // gopast, line 38 golab0: while(true) { lab1: do { if (!(in_grouping_b(g_v, 97, 121))) { break lab1; } break golab0; } while (false); if (cursor <= limit_backward) { return false; } cursor--; } cursor = limit - v_1; // delete, line 38 slice_del(); // test, line 39 v_3 = limit - cursor; // substring, line 39 among_var = find_among_b(a_1, 13); if (among_var == 0) { return false; } cursor = limit - v_3; switch(among_var) { case 0: return false; case 1: // (, line 41 // <+, line 41 { int c = cursor; insert(cursor, cursor, "e"); cursor = c; } break; case 2: // (, line 44 // [, line 44 ket = cursor; // next, line 44 if (cursor <= limit_backward) { return false; } cursor--; // ], line 44 bra = cursor; // delete, line 44 slice_del(); break; case 3: // (, line 45 // atmark, line 45 if (cursor != I_p1) { return false; } // test, line 45 v_4 = limit - cursor; // call shortv, line 45 if (!r_shortv()) { return false; } cursor = limit - v_4; // <+, line 45 { int c = cursor; insert(cursor, cursor, "e"); cursor = c; } break; } break; } return true; } private boolean r_Step_1c() { int v_1; // (, line 51 // [, line 52 ket = cursor; // or, line 52 lab0: do { v_1 = limit - cursor;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -