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

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