00001
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, -1, 6},
00015 { 1, s_0_1, 0, 2},
00016 { 1, s_0_2, 0, 1},
00017 { 2, s_0_3, 0, 3},
00018 { 2, s_0_4, 0, 4},
00019 { 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 { 1, s_1_0, -1, 1},
00033 { 2, s_1_1, -1, 1},
00034 { 2, s_1_2, -1, 1},
00035 { 3, s_1_3, -1, 1},
00036 { 2, s_1_4, -1, 1},
00037 { 1, s_1_5, -1, 2},
00038 { 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 { 2, s_2_0, -1, 1},
00049 { 2, s_2_1, -1, 1},
00050 { 2, s_2_2, -1, 2},
00051 { 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 { 2, s_3_0, -1, 1},
00060 { 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 { 3, s_4_0, -1, 1},
00075 { 2, s_4_1, -1, 2},
00076 { 3, s_4_2, -1, 1},
00077 { 4, s_4_3, -1, 3},
00078 { 4, s_4_4, -1, 2},
00079 { 2, s_4_5, -1, 2},
00080 { 4, s_4_6, -1, 3},
00081 { 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() {
00104 { int c_test1 = c;
00105 while(1) {
00106 int c2 = c;
00107 { int c3 = c;
00108 bra = c;
00109 if (!(eq_s(2, s_0))) goto lab2;
00110 ket = c;
00111 { int ret = slice_from_s(2, s_1);
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;
00120 }
00121 }
00122 lab1:
00123 continue;
00124 lab0:
00125 c = c2;
00126 break;
00127 }
00128 c = c_test1;
00129 }
00130 while(1) {
00131 int c4 = c;
00132 while(1) {
00133 int c5 = c;
00134 if (in_grouping_U(g_v, 97, 252, 0)) goto lab4;
00135 bra = c;
00136 { int c6 = c;
00137 if (c == l || p[c] != 'u') goto lab6;
00138 c++;
00139 ket = c;
00140 if (in_grouping_U(g_v, 97, 252, 0)) goto lab6;
00141 { int ret = slice_from_s(1, s_2);
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;
00150 if (in_grouping_U(g_v, 97, 252, 0)) goto lab4;
00151 { int ret = slice_from_s(1, s_3);
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;
00163 }
00164 }
00165 continue;
00166 lab3:
00167 c = c4;
00168 break;
00169 }
00170 return 1;
00171 }
00172
00173 int Xapian::InternalStemGerman::r_mark_regions() {
00174 I_p1 = l;
00175 I_p2 = l;
00176 { int c_test1 = c;
00177 { int ret = skip_utf8(p, c, 0, l, + 3);
00178 if (ret < 0) return 0;
00179 c = ret;
00180 }
00181 I_x = c;
00182 c = c_test1;
00183 }
00184 { int ret = out_grouping_U(g_v, 97, 252, 1);
00185 if (ret < 0) return 0;
00186 c += ret;
00187 }
00188 { int ret = in_grouping_U(g_v, 97, 252, 1);
00189 if (ret < 0) return 0;
00190 c += ret;
00191 }
00192 I_p1 = c;
00193
00194 if (!(I_p1 < I_x)) goto lab0;
00195 I_p1 = I_x;
00196 lab0:
00197 { int ret = out_grouping_U(g_v, 97, 252, 1);
00198 if (ret < 0) return 0;
00199 c += ret;
00200 }
00201 { int ret = in_grouping_U(g_v, 97, 252, 1);
00202 if (ret < 0) return 0;
00203 c += ret;
00204 }
00205 I_p2 = c;
00206 return 1;
00207 }
00208
00209 int Xapian::InternalStemGerman::r_postlude() {
00210 int among_var;
00211 while(1) {
00212 int c1 = c;
00213 bra = c;
00214 among_var = find_among(a_0, 6, 0, 0);
00215 if (!(among_var)) goto lab0;
00216 ket = c;
00217 switch(among_var) {
00218 case 0: goto lab0;
00219 case 1:
00220 { int ret = slice_from_s(1, s_4);
00221 if (ret < 0) return ret;
00222 }
00223 break;
00224 case 2:
00225 { int ret = slice_from_s(1, s_5);
00226 if (ret < 0) return ret;
00227 }
00228 break;
00229 case 3:
00230 { int ret = slice_from_s(1, s_6);
00231 if (ret < 0) return ret;
00232 }
00233 break;
00234 case 4:
00235 { int ret = slice_from_s(1, s_7);
00236 if (ret < 0) return ret;
00237 }
00238 break;
00239 case 5:
00240 { int ret = slice_from_s(1, s_8);
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;
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() {
00260 if (!(I_p1 <= c)) return 0;
00261 return 1;
00262 }
00263
00264 int Xapian::InternalStemGerman::r_R2() {
00265 if (!(I_p2 <= c)) return 0;
00266 return 1;
00267 }
00268
00269 int Xapian::InternalStemGerman::r_standard_suffix() {
00270 int among_var;
00271 { int m1 = l - c; (void)m1;
00272 ket = c;
00273 if (c <= lb || p[c - 1] >> 5 != 3 || !((811040 >> (p[c - 1] & 0x1f)) & 1)) goto lab0;
00274 among_var = find_among_b(a_1, 7, 0, 0);
00275 if (!(among_var)) goto lab0;
00276 bra = c;
00277 { int ret = r_R1();
00278 if (ret == 0) goto lab0;
00279 if (ret < 0) return ret;
00280 }
00281 switch(among_var) {
00282 case 0: goto lab0;
00283 case 1:
00284 if (slice_del() == -1) return -1;
00285 break;
00286 case 2:
00287 if (in_grouping_b_U(g_s_ending, 98, 116, 0)) goto lab0;
00288 if (slice_del() == -1) return -1;
00289 break;
00290 }
00291 lab0:
00292 c = l - m1;
00293 }
00294 { int m2 = l - c; (void)m2;
00295 ket = c;
00296 if (c - 1 <= lb || p[c - 1] >> 5 != 3 || !((1327104 >> (p[c - 1] & 0x1f)) & 1)) goto lab1;
00297 among_var = find_among_b(a_2, 4, 0, 0);
00298 if (!(among_var)) goto lab1;
00299 bra = c;
00300 { int ret = r_R1();
00301 if (ret == 0) goto lab1;
00302 if (ret < 0) return ret;
00303 }
00304 switch(among_var) {
00305 case 0: goto lab1;
00306 case 1:
00307 if (slice_del() == -1) return -1;
00308 break;
00309 case 2:
00310 if (in_grouping_b_U(g_st_ending, 98, 116, 0)) goto lab1;
00311 { int ret = skip_utf8(p, c, lb, l, - 3);
00312 if (ret < 0) goto lab1;
00313 c = ret;
00314 }
00315 if (slice_del() == -1) return -1;
00316 break;
00317 }
00318 lab1:
00319 c = l - m2;
00320 }
00321 { int m3 = l - c; (void)m3;
00322 ket = c;
00323 if (c - 1 <= lb || p[c - 1] >> 5 != 3 || !((1051024 >> (p[c - 1] & 0x1f)) & 1)) goto lab2;
00324 among_var = find_among_b(a_4, 8, 0, 0);
00325 if (!(among_var)) goto lab2;
00326 bra = c;
00327 { int ret = r_R2();
00328 if (ret == 0) goto lab2;
00329 if (ret < 0) return ret;
00330 }
00331 switch(among_var) {
00332 case 0: goto lab2;
00333 case 1:
00334 if (slice_del() == -1) return -1;
00335 { int m4 = l - c; (void)m4;
00336 ket = c;
00337 if (!(eq_s_b(2, s_9))) { c = l - m4; goto lab3; }
00338 bra = c;
00339 { int m5 = l - c; (void)m5;
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();
00347 if (ret == 0) { c = l - m4; goto lab3; }
00348 if (ret < 0) return ret;
00349 }
00350 if (slice_del() == -1) return -1;
00351 lab3:
00352 ;
00353 }
00354 break;
00355 case 2:
00356 { int m6 = l - c; (void)m6;
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;
00364 break;
00365 case 3:
00366 if (slice_del() == -1) return -1;
00367 { int m7 = l - c; (void)m7;
00368 ket = c;
00369 { int m8 = l - c; (void)m8;
00370 if (!(eq_s_b(2, s_10))) goto lab8;
00371 goto lab7;
00372 lab8:
00373 c = l - m8;
00374 if (!(eq_s_b(2, s_11))) { c = l - m7; goto lab6; }
00375 }
00376 lab7:
00377 bra = c;
00378 { int ret = r_R1();
00379 if (ret == 0) { c = l - m7; goto lab6; }
00380 if (ret < 0) return ret;
00381 }
00382 if (slice_del() == -1) return -1;
00383 lab6:
00384 ;
00385 }
00386 break;
00387 case 4:
00388 if (slice_del() == -1) return -1;
00389 { int m9 = l - c; (void)m9;
00390 ket = c;
00391 if (c - 1 <= lb || (p[c - 1] != 103 && p[c - 1] != 104)) { c = l - m9; goto lab9; }
00392 among_var = find_among_b(a_3, 2, 0, 0);
00393 if (!(among_var)) { c = l - m9; goto lab9; }
00394 bra = c;
00395 { int ret = r_R2();
00396 if (ret == 0) { c = l - m9; goto lab9; }
00397 if (ret < 0) return ret;
00398 }
00399 switch(among_var) {
00400 case 0: { c = l - m9; goto lab9; }
00401 case 1:
00402 if (slice_del() == -1) return -1;
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() {
00417 { int c1 = c;
00418 { int ret = r_prelude();
00419 if (ret == 0) goto lab0;
00420 if (ret < 0) return ret;
00421 }
00422 lab0:
00423 c = c1;
00424 }
00425 { int c2 = c;
00426 { int ret = r_mark_regions();
00427 if (ret == 0) goto lab1;
00428 if (ret < 0) return ret;
00429 }
00430 lab1:
00431 c = c2;
00432 }
00433 lb = c; c = l;
00434
00435 { int m3 = l - c; (void)m3;
00436 { int ret = r_standard_suffix();
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;
00445 { int ret = r_postlude();
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 }