languages/german2.cc

Go to the documentation of this file.
00001 /* This file was generated automatically by the Snowball to ISO C++ compiler */
00002 
00003 #include <limits.h>
00004 #include "german2.h"
00005 
00006 static const symbol s_0_1[2] = { 'a', 'e' };
00007 static const symbol s_0_2[2] = { 'o', 'e' };
00008 static const symbol s_0_3[2] = { 'q', 'u' };
00009 static const symbol s_0_4[2] = { 'u', 'e' };
00010 static const symbol s_0_5[2] = { 0xC3, 0x9F };
00011 
00012 static const struct among a_0[6] =
00013 {
00014 /*  0 */ { 0, 0, -1, 6},
00015 /*  1 */ { 2, s_0_1, 0, 2},
00016 /*  2 */ { 2, s_0_2, 0, 3},
00017 /*  3 */ { 2, s_0_3, 0, 5},
00018 /*  4 */ { 2, s_0_4, 0, 4},
00019 /*  5 */ { 2, s_0_5, 0, 1}
00020 };
00021 
00022 static const symbol s_1_1[1] = { 'U' };
00023 static const symbol s_1_2[1] = { 'Y' };
00024 static const symbol s_1_3[2] = { 0xC3, 0xA4 };
00025 static const symbol s_1_4[2] = { 0xC3, 0xB6 };
00026 static const symbol s_1_5[2] = { 0xC3, 0xBC };
00027 
00028 static const struct among a_1[6] =
00029 {
00030 /*  0 */ { 0, 0, -1, 6},
00031 /*  1 */ { 1, s_1_1, 0, 2},
00032 /*  2 */ { 1, s_1_2, 0, 1},
00033 /*  3 */ { 2, s_1_3, 0, 3},
00034 /*  4 */ { 2, s_1_4, 0, 4},
00035 /*  5 */ { 2, s_1_5, 0, 5}
00036 };
00037 
00038 static const symbol s_2_0[1] = { 'e' };
00039 static const symbol s_2_1[2] = { 'e', 'm' };
00040 static const symbol s_2_2[2] = { 'e', 'n' };
00041 static const symbol s_2_3[3] = { 'e', 'r', 'n' };
00042 static const symbol s_2_4[2] = { 'e', 'r' };
00043 static const symbol s_2_5[1] = { 's' };
00044 static const symbol s_2_6[2] = { 'e', 's' };
00045 
00046 static const struct among a_2[7] =
00047 {
00048 /*  0 */ { 1, s_2_0, -1, 1},
00049 /*  1 */ { 2, s_2_1, -1, 1},
00050 /*  2 */ { 2, s_2_2, -1, 1},
00051 /*  3 */ { 3, s_2_3, -1, 1},
00052 /*  4 */ { 2, s_2_4, -1, 1},
00053 /*  5 */ { 1, s_2_5, -1, 2},
00054 /*  6 */ { 2, s_2_6, 5, 1}
00055 };
00056 
00057 static const symbol s_3_0[2] = { 'e', 'n' };
00058 static const symbol s_3_1[2] = { 'e', 'r' };
00059 static const symbol s_3_2[2] = { 's', 't' };
00060 static const symbol s_3_3[3] = { 'e', 's', 't' };
00061 
00062 static const struct among a_3[4] =
00063 {
00064 /*  0 */ { 2, s_3_0, -1, 1},
00065 /*  1 */ { 2, s_3_1, -1, 1},
00066 /*  2 */ { 2, s_3_2, -1, 2},
00067 /*  3 */ { 3, s_3_3, 2, 1}
00068 };
00069 
00070 static const symbol s_4_0[2] = { 'i', 'g' };
00071 static const symbol s_4_1[4] = { 'l', 'i', 'c', 'h' };
00072 
00073 static const struct among a_4[2] =
00074 {
00075 /*  0 */ { 2, s_4_0, -1, 1},
00076 /*  1 */ { 4, s_4_1, -1, 1}
00077 };
00078 
00079 static const symbol s_5_0[3] = { 'e', 'n', 'd' };
00080 static const symbol s_5_1[2] = { 'i', 'g' };
00081 static const symbol s_5_2[3] = { 'u', 'n', 'g' };
00082 static const symbol s_5_3[4] = { 'l', 'i', 'c', 'h' };
00083 static const symbol s_5_4[4] = { 'i', 's', 'c', 'h' };
00084 static const symbol s_5_5[2] = { 'i', 'k' };
00085 static const symbol s_5_6[4] = { 'h', 'e', 'i', 't' };
00086 static const symbol s_5_7[4] = { 'k', 'e', 'i', 't' };
00087 
00088 static const struct among a_5[8] =
00089 {
00090 /*  0 */ { 3, s_5_0, -1, 1},
00091 /*  1 */ { 2, s_5_1, -1, 2},
00092 /*  2 */ { 3, s_5_2, -1, 1},
00093 /*  3 */ { 4, s_5_3, -1, 3},
00094 /*  4 */ { 4, s_5_4, -1, 2},
00095 /*  5 */ { 2, s_5_5, -1, 2},
00096 /*  6 */ { 4, s_5_6, -1, 3},
00097 /*  7 */ { 4, s_5_7, -1, 4}
00098 };
00099 
00100 static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8 };
00101 
00102 static const unsigned char g_s_ending[] = { 117, 30, 5 };
00103 
00104 static const unsigned char g_st_ending[] = { 117, 30, 4 };
00105 
00106 static const symbol s_0[] = { 'U' };
00107 static const symbol s_1[] = { 'Y' };
00108 static const symbol s_2[] = { 's', 's' };
00109 static const symbol s_3[] = { 0xC3, 0xA4 };
00110 static const symbol s_4[] = { 0xC3, 0xB6 };
00111 static const symbol s_5[] = { 0xC3, 0xBC };
00112 static const symbol s_6[] = { 'y' };
00113 static const symbol s_7[] = { 'u' };
00114 static const symbol s_8[] = { 'a' };
00115 static const symbol s_9[] = { 'o' };
00116 static const symbol s_10[] = { 'u' };
00117 static const symbol s_11[] = { 'i', 'g' };
00118 static const symbol s_12[] = { 'e', 'r' };
00119 static const symbol s_13[] = { 'e', 'n' };
00120 
00121 int Xapian::InternalStemGerman2::r_prelude() { /* forwardmode */
00122     int among_var;
00123     {   int c_test1 = c; /* test, line 30 */
00124         while(1) { /* repeat, line 30 */
00125             int c2 = c;
00126             while(1) { /* goto, line 30 */
00127                 int c3 = c;
00128                 if (in_grouping_U(g_v, 97, 252, 0)) goto lab1; /* grouping v, line 31 */
00129                 bra = c; /* [, line 31 */
00130                 {   int c4 = c; /* or, line 31 */
00131                     if (c == l || p[c] != 'u') goto lab3;
00132                     c++;
00133                     ket = c; /* ], line 31 */
00134                     if (in_grouping_U(g_v, 97, 252, 0)) goto lab3; /* grouping v, line 31 */
00135                     {   int ret = slice_from_s(1, s_0); /* <-, line 31 */
00136                         if (ret < 0) return ret;
00137                     }
00138                     goto lab2;
00139                 lab3:
00140                     c = c4;
00141                     if (c == l || p[c] != 'y') goto lab1;
00142                     c++;
00143                     ket = c; /* ], line 32 */
00144                     if (in_grouping_U(g_v, 97, 252, 0)) goto lab1; /* grouping v, line 32 */
00145                     {   int ret = slice_from_s(1, s_1); /* <-, line 32 */
00146                         if (ret < 0) return ret;
00147                     }
00148                 }
00149             lab2:
00150                 c = c3;
00151                 break;
00152             lab1:
00153                 c = c3;
00154                 {   int ret = skip_utf8(p, c, 0, l, 1);
00155                     if (ret < 0) goto lab0;
00156                     c = ret; /* goto, line 30 */
00157                 }
00158             }
00159             continue;
00160         lab0:
00161             c = c2;
00162             break;
00163         }
00164         c = c_test1;
00165     }
00166     while(1) { /* repeat, line 35 */
00167         int c5 = c;
00168         bra = c; /* [, line 36 */
00169         among_var = find_among(a_0, 6, 0, 0); /* substring, line 36 */
00170         if (!(among_var)) goto lab4;
00171         ket = c; /* ], line 36 */
00172         switch(among_var) { /* among, line 36 */
00173             case 0: goto lab4;
00174             case 1:
00175                 {   int ret = slice_from_s(2, s_2); /* <-, line 37 */
00176                     if (ret < 0) return ret;
00177                 }
00178                 break;
00179             case 2:
00180                 {   int ret = slice_from_s(2, s_3); /* <-, line 38 */
00181                     if (ret < 0) return ret;
00182                 }
00183                 break;
00184             case 3:
00185                 {   int ret = slice_from_s(2, s_4); /* <-, line 39 */
00186                     if (ret < 0) return ret;
00187                 }
00188                 break;
00189             case 4:
00190                 {   int ret = slice_from_s(2, s_5); /* <-, line 40 */
00191                     if (ret < 0) return ret;
00192                 }
00193                 break;
00194             case 5:
00195                 {   int ret = skip_utf8(p, c, 0, l, + 2); /* hop, line 41 */
00196                     if (ret < 0) goto lab4;
00197                     c = ret;
00198                 }
00199                 break;
00200             case 6:
00201                 {   int ret = skip_utf8(p, c, 0, l, 1);
00202                     if (ret < 0) goto lab4;
00203                     c = ret; /* next, line 42 */
00204                 }
00205                 break;
00206         }
00207         continue;
00208     lab4:
00209         c = c5;
00210         break;
00211     }
00212     return 1;
00213 }
00214 
00215 int Xapian::InternalStemGerman2::r_mark_regions() { /* forwardmode */
00216     I_p1 = l; /* p1 = <integer expression>, line 50 */
00217     I_p2 = l; /* p2 = <integer expression>, line 51 */
00218     {   int c_test1 = c; /* test, line 53 */
00219         {   int ret = skip_utf8(p, c, 0, l, + 3); /* hop, line 53 */
00220             if (ret < 0) return 0;
00221             c = ret;
00222         }
00223         I_x = c; /* setmark x, line 53 */
00224         c = c_test1;
00225     }
00226     {   int ret = out_grouping_U(g_v, 97, 252, 1); /* gopast */ /* grouping v, line 55 */
00227         if (ret < 0) return 0;
00228         c += ret;
00229     }
00230     {   int ret = in_grouping_U(g_v, 97, 252, 1); /* gopast */ /* non v, line 55 */
00231         if (ret < 0) return 0;
00232         c += ret;
00233     }
00234     I_p1 = c; /* setmark p1, line 55 */
00235     /* try, line 56 */
00236     if (!(I_p1 < I_x)) goto lab0; /* p1 < <integer expression>, line 56 */
00237     I_p1 = I_x; /* p1 = <integer expression>, line 56 */
00238 lab0:
00239     {   int ret = out_grouping_U(g_v, 97, 252, 1); /* gopast */ /* grouping v, line 57 */
00240         if (ret < 0) return 0;
00241         c += ret;
00242     }
00243     {   int ret = in_grouping_U(g_v, 97, 252, 1); /* gopast */ /* non v, line 57 */
00244         if (ret < 0) return 0;
00245         c += ret;
00246     }
00247     I_p2 = c; /* setmark p2, line 57 */
00248     return 1;
00249 }
00250 
00251 int Xapian::InternalStemGerman2::r_postlude() { /* forwardmode */
00252     int among_var;
00253     while(1) { /* repeat, line 61 */
00254         int c1 = c;
00255         bra = c; /* [, line 63 */
00256         among_var = find_among(a_1, 6, 0, 0); /* substring, line 63 */
00257         if (!(among_var)) goto lab0;
00258         ket = c; /* ], line 63 */
00259         switch(among_var) { /* among, line 63 */
00260             case 0: goto lab0;
00261             case 1:
00262                 {   int ret = slice_from_s(1, s_6); /* <-, line 64 */
00263                     if (ret < 0) return ret;
00264                 }
00265                 break;
00266             case 2:
00267                 {   int ret = slice_from_s(1, s_7); /* <-, line 65 */
00268                     if (ret < 0) return ret;
00269                 }
00270                 break;
00271             case 3:
00272                 {   int ret = slice_from_s(1, s_8); /* <-, line 66 */
00273                     if (ret < 0) return ret;
00274                 }
00275                 break;
00276             case 4:
00277                 {   int ret = slice_from_s(1, s_9); /* <-, line 67 */
00278                     if (ret < 0) return ret;
00279                 }
00280                 break;
00281             case 5:
00282                 {   int ret = slice_from_s(1, s_10); /* <-, line 68 */
00283                     if (ret < 0) return ret;
00284                 }
00285                 break;
00286             case 6:
00287                 {   int ret = skip_utf8(p, c, 0, l, 1);
00288                     if (ret < 0) goto lab0;
00289                     c = ret; /* next, line 69 */
00290                 }
00291                 break;
00292         }
00293         continue;
00294     lab0:
00295         c = c1;
00296         break;
00297     }
00298     return 1;
00299 }
00300 
00301 int Xapian::InternalStemGerman2::r_R1() { /* backwardmode */
00302     if (!(I_p1 <= c)) return 0; /* p1 <= <integer expression>, line 76 */
00303     return 1;
00304 }
00305 
00306 int Xapian::InternalStemGerman2::r_R2() { /* backwardmode */
00307     if (!(I_p2 <= c)) return 0; /* p2 <= <integer expression>, line 77 */
00308     return 1;
00309 }
00310 
00311 int Xapian::InternalStemGerman2::r_standard_suffix() { /* backwardmode */
00312     int among_var;
00313     {   int m1 = l - c; (void)m1; /* do, line 80 */
00314         ket = c; /* [, line 81 */
00315         if (c <= lb || p[c - 1] >> 5 != 3 || !((811040 >> (p[c - 1] & 0x1f)) & 1)) goto lab0; /* substring, line 81 */
00316         among_var = find_among_b(a_2, 7, 0, 0);
00317         if (!(among_var)) goto lab0;
00318         bra = c; /* ], line 81 */
00319         {   int ret = r_R1(); /* call R1, line 81 */
00320             if (ret == 0) goto lab0;
00321             if (ret < 0) return ret;
00322         }
00323         switch(among_var) { /* among, line 81 */
00324             case 0: goto lab0;
00325             case 1:
00326                 if (slice_del() == -1) return -1; /* delete, line 83 */
00327                 break;
00328             case 2:
00329                 if (in_grouping_b_U(g_s_ending, 98, 116, 0)) goto lab0; /* grouping s_ending, line 86 */
00330                 if (slice_del() == -1) return -1; /* delete, line 86 */
00331                 break;
00332         }
00333     lab0:
00334         c = l - m1;
00335     }
00336     {   int m2 = l - c; (void)m2; /* do, line 90 */
00337         ket = c; /* [, line 91 */
00338         if (c - 1 <= lb || p[c - 1] >> 5 != 3 || !((1327104 >> (p[c - 1] & 0x1f)) & 1)) goto lab1; /* substring, line 91 */
00339         among_var = find_among_b(a_3, 4, 0, 0);
00340         if (!(among_var)) goto lab1;
00341         bra = c; /* ], line 91 */
00342         {   int ret = r_R1(); /* call R1, line 91 */
00343             if (ret == 0) goto lab1;
00344             if (ret < 0) return ret;
00345         }
00346         switch(among_var) { /* among, line 91 */
00347             case 0: goto lab1;
00348             case 1:
00349                 if (slice_del() == -1) return -1; /* delete, line 93 */
00350                 break;
00351             case 2:
00352                 if (in_grouping_b_U(g_st_ending, 98, 116, 0)) goto lab1; /* grouping st_ending, line 96 */
00353                 {   int ret = skip_utf8(p, c, lb, l, - 3); /* hop, line 96 */
00354                     if (ret < 0) goto lab1;
00355                     c = ret;
00356                 }
00357                 if (slice_del() == -1) return -1; /* delete, line 96 */
00358                 break;
00359         }
00360     lab1:
00361         c = l - m2;
00362     }
00363     {   int m3 = l - c; (void)m3; /* do, line 100 */
00364         ket = c; /* [, line 101 */
00365         if (c - 1 <= lb || p[c - 1] >> 5 != 3 || !((1051024 >> (p[c - 1] & 0x1f)) & 1)) goto lab2; /* substring, line 101 */
00366         among_var = find_among_b(a_5, 8, 0, 0);
00367         if (!(among_var)) goto lab2;
00368         bra = c; /* ], line 101 */
00369         {   int ret = r_R2(); /* call R2, line 101 */
00370             if (ret == 0) goto lab2;
00371             if (ret < 0) return ret;
00372         }
00373         switch(among_var) { /* among, line 101 */
00374             case 0: goto lab2;
00375             case 1:
00376                 if (slice_del() == -1) return -1; /* delete, line 103 */
00377                 {   int m4 = l - c; (void)m4; /* try, line 104 */
00378                     ket = c; /* [, line 104 */
00379                     if (!(eq_s_b(2, s_11))) { c = l - m4; goto lab3; } /* literal, line 104 */
00380                     bra = c; /* ], line 104 */
00381                     {   int m5 = l - c; (void)m5; /* not, line 104 */
00382                         if (c <= lb || p[c - 1] != 'e') goto lab4;
00383                         c--;
00384                         { c = l - m4; goto lab3; }
00385                     lab4:
00386                         c = l - m5;
00387                     }
00388                     {   int ret = r_R2(); /* call R2, line 104 */
00389                         if (ret == 0) { c = l - m4; goto lab3; }
00390                         if (ret < 0) return ret;
00391                     }
00392                     if (slice_del() == -1) return -1; /* delete, line 104 */
00393                 lab3:
00394                     ;
00395                 }
00396                 break;
00397             case 2:
00398                 {   int m6 = l - c; (void)m6; /* not, line 107 */
00399                     if (c <= lb || p[c - 1] != 'e') goto lab5;
00400                     c--;
00401                     goto lab2;
00402                 lab5:
00403                     c = l - m6;
00404                 }
00405                 if (slice_del() == -1) return -1; /* delete, line 107 */
00406                 break;
00407             case 3:
00408                 if (slice_del() == -1) return -1; /* delete, line 110 */
00409                 {   int m7 = l - c; (void)m7; /* try, line 111 */
00410                     ket = c; /* [, line 112 */
00411                     {   int m8 = l - c; (void)m8; /* or, line 112 */
00412                         if (!(eq_s_b(2, s_12))) goto lab8; /* literal, line 112 */
00413                         goto lab7;
00414                     lab8:
00415                         c = l - m8;
00416                         if (!(eq_s_b(2, s_13))) { c = l - m7; goto lab6; } /* literal, line 112 */
00417                     }
00418                 lab7:
00419                     bra = c; /* ], line 112 */
00420                     {   int ret = r_R1(); /* call R1, line 112 */
00421                         if (ret == 0) { c = l - m7; goto lab6; }
00422                         if (ret < 0) return ret;
00423                     }
00424                     if (slice_del() == -1) return -1; /* delete, line 112 */
00425                 lab6:
00426                     ;
00427                 }
00428                 break;
00429             case 4:
00430                 if (slice_del() == -1) return -1; /* delete, line 116 */
00431                 {   int m9 = l - c; (void)m9; /* try, line 117 */
00432                     ket = c; /* [, line 118 */
00433                     if (c - 1 <= lb || (p[c - 1] != 103 && p[c - 1] != 104)) { c = l - m9; goto lab9; } /* substring, line 118 */
00434                     among_var = find_among_b(a_4, 2, 0, 0);
00435                     if (!(among_var)) { c = l - m9; goto lab9; }
00436                     bra = c; /* ], line 118 */
00437                     {   int ret = r_R2(); /* call R2, line 118 */
00438                         if (ret == 0) { c = l - m9; goto lab9; }
00439                         if (ret < 0) return ret;
00440                     }
00441                     switch(among_var) { /* among, line 118 */
00442                         case 0: { c = l - m9; goto lab9; }
00443                         case 1:
00444                             if (slice_del() == -1) return -1; /* delete, line 120 */
00445                             break;
00446                     }
00447                 lab9:
00448                     ;
00449                 }
00450                 break;
00451         }
00452     lab2:
00453         c = l - m3;
00454     }
00455     return 1;
00456 }
00457 
00458 int Xapian::InternalStemGerman2::stem() { /* forwardmode */
00459     {   int c1 = c; /* do, line 131 */
00460         {   int ret = r_prelude(); /* call prelude, line 131 */
00461             if (ret == 0) goto lab0;
00462             if (ret < 0) return ret;
00463         }
00464     lab0:
00465         c = c1;
00466     }
00467     {   int c2 = c; /* do, line 132 */
00468         {   int ret = r_mark_regions(); /* call mark_regions, line 132 */
00469             if (ret == 0) goto lab1;
00470             if (ret < 0) return ret;
00471         }
00472     lab1:
00473         c = c2;
00474     }
00475     lb = c; c = l; /* backwards, line 133 */
00476 
00477     {   int m3 = l - c; (void)m3; /* do, line 134 */
00478         {   int ret = r_standard_suffix(); /* call standard_suffix, line 134 */
00479             if (ret == 0) goto lab2;
00480             if (ret < 0) return ret;
00481         }
00482     lab2:
00483         c = l - m3;
00484     }
00485     c = lb;
00486     {   int c4 = c; /* do, line 135 */
00487         {   int ret = r_postlude(); /* call postlude, line 135 */
00488             if (ret == 0) goto lab3;
00489             if (ret < 0) return ret;
00490         }
00491     lab3:
00492         c = c4;
00493     }
00494     return 1;
00495 }
00496 
00497 Xapian::InternalStemGerman2::InternalStemGerman2()
00498     : I_x(0), I_p2(0), I_p1(0)
00499 {
00500 }
00501 
00502 Xapian::InternalStemGerman2::~InternalStemGerman2()
00503 {
00504 }
00505 
00506 const char *
00507 Xapian::InternalStemGerman2::get_description() const
00508 {
00509     return "german2";
00510 }

Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.