00001
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, -1, 6},
00015 { 2, s_0_1, 0, 2},
00016 { 2, s_0_2, 0, 3},
00017 { 2, s_0_3, 0, 5},
00018 { 2, s_0_4, 0, 4},
00019 { 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, -1, 6},
00031 { 1, s_1_1, 0, 2},
00032 { 1, s_1_2, 0, 1},
00033 { 2, s_1_3, 0, 3},
00034 { 2, s_1_4, 0, 4},
00035 { 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 { 1, s_2_0, -1, 1},
00049 { 2, s_2_1, -1, 1},
00050 { 2, s_2_2, -1, 1},
00051 { 3, s_2_3, -1, 1},
00052 { 2, s_2_4, -1, 1},
00053 { 1, s_2_5, -1, 2},
00054 { 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 { 2, s_3_0, -1, 1},
00065 { 2, s_3_1, -1, 1},
00066 { 2, s_3_2, -1, 2},
00067 { 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 { 2, s_4_0, -1, 1},
00076 { 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 { 3, s_5_0, -1, 1},
00091 { 2, s_5_1, -1, 2},
00092 { 3, s_5_2, -1, 1},
00093 { 4, s_5_3, -1, 3},
00094 { 4, s_5_4, -1, 2},
00095 { 2, s_5_5, -1, 2},
00096 { 4, s_5_6, -1, 3},
00097 { 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() {
00122 int among_var;
00123 { int c_test1 = c;
00124 while(1) {
00125 int c2 = c;
00126 while(1) {
00127 int c3 = c;
00128 if (in_grouping_U(g_v, 97, 252, 0)) goto lab1;
00129 bra = c;
00130 { int c4 = c;
00131 if (c == l || p[c] != 'u') goto lab3;
00132 c++;
00133 ket = c;
00134 if (in_grouping_U(g_v, 97, 252, 0)) goto lab3;
00135 { int ret = slice_from_s(1, s_0);
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;
00144 if (in_grouping_U(g_v, 97, 252, 0)) goto lab1;
00145 { int ret = slice_from_s(1, s_1);
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;
00157 }
00158 }
00159 continue;
00160 lab0:
00161 c = c2;
00162 break;
00163 }
00164 c = c_test1;
00165 }
00166 while(1) {
00167 int c5 = c;
00168 bra = c;
00169 among_var = find_among(a_0, 6, 0, 0);
00170 if (!(among_var)) goto lab4;
00171 ket = c;
00172 switch(among_var) {
00173 case 0: goto lab4;
00174 case 1:
00175 { int ret = slice_from_s(2, s_2);
00176 if (ret < 0) return ret;
00177 }
00178 break;
00179 case 2:
00180 { int ret = slice_from_s(2, s_3);
00181 if (ret < 0) return ret;
00182 }
00183 break;
00184 case 3:
00185 { int ret = slice_from_s(2, s_4);
00186 if (ret < 0) return ret;
00187 }
00188 break;
00189 case 4:
00190 { int ret = slice_from_s(2, s_5);
00191 if (ret < 0) return ret;
00192 }
00193 break;
00194 case 5:
00195 { int ret = skip_utf8(p, c, 0, l, + 2);
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;
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() {
00216 I_p1 = l;
00217 I_p2 = l;
00218 { int c_test1 = c;
00219 { int ret = skip_utf8(p, c, 0, l, + 3);
00220 if (ret < 0) return 0;
00221 c = ret;
00222 }
00223 I_x = c;
00224 c = c_test1;
00225 }
00226 { int ret = out_grouping_U(g_v, 97, 252, 1);
00227 if (ret < 0) return 0;
00228 c += ret;
00229 }
00230 { int ret = in_grouping_U(g_v, 97, 252, 1);
00231 if (ret < 0) return 0;
00232 c += ret;
00233 }
00234 I_p1 = c;
00235
00236 if (!(I_p1 < I_x)) goto lab0;
00237 I_p1 = I_x;
00238 lab0:
00239 { int ret = out_grouping_U(g_v, 97, 252, 1);
00240 if (ret < 0) return 0;
00241 c += ret;
00242 }
00243 { int ret = in_grouping_U(g_v, 97, 252, 1);
00244 if (ret < 0) return 0;
00245 c += ret;
00246 }
00247 I_p2 = c;
00248 return 1;
00249 }
00250
00251 int Xapian::InternalStemGerman2::r_postlude() {
00252 int among_var;
00253 while(1) {
00254 int c1 = c;
00255 bra = c;
00256 among_var = find_among(a_1, 6, 0, 0);
00257 if (!(among_var)) goto lab0;
00258 ket = c;
00259 switch(among_var) {
00260 case 0: goto lab0;
00261 case 1:
00262 { int ret = slice_from_s(1, s_6);
00263 if (ret < 0) return ret;
00264 }
00265 break;
00266 case 2:
00267 { int ret = slice_from_s(1, s_7);
00268 if (ret < 0) return ret;
00269 }
00270 break;
00271 case 3:
00272 { int ret = slice_from_s(1, s_8);
00273 if (ret < 0) return ret;
00274 }
00275 break;
00276 case 4:
00277 { int ret = slice_from_s(1, s_9);
00278 if (ret < 0) return ret;
00279 }
00280 break;
00281 case 5:
00282 { int ret = slice_from_s(1, s_10);
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;
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() {
00302 if (!(I_p1 <= c)) return 0;
00303 return 1;
00304 }
00305
00306 int Xapian::InternalStemGerman2::r_R2() {
00307 if (!(I_p2 <= c)) return 0;
00308 return 1;
00309 }
00310
00311 int Xapian::InternalStemGerman2::r_standard_suffix() {
00312 int among_var;
00313 { int m1 = l - c; (void)m1;
00314 ket = c;
00315 if (c <= lb || p[c - 1] >> 5 != 3 || !((811040 >> (p[c - 1] & 0x1f)) & 1)) goto lab0;
00316 among_var = find_among_b(a_2, 7, 0, 0);
00317 if (!(among_var)) goto lab0;
00318 bra = c;
00319 { int ret = r_R1();
00320 if (ret == 0) goto lab0;
00321 if (ret < 0) return ret;
00322 }
00323 switch(among_var) {
00324 case 0: goto lab0;
00325 case 1:
00326 if (slice_del() == -1) return -1;
00327 break;
00328 case 2:
00329 if (in_grouping_b_U(g_s_ending, 98, 116, 0)) goto lab0;
00330 if (slice_del() == -1) return -1;
00331 break;
00332 }
00333 lab0:
00334 c = l - m1;
00335 }
00336 { int m2 = l - c; (void)m2;
00337 ket = c;
00338 if (c - 1 <= lb || p[c - 1] >> 5 != 3 || !((1327104 >> (p[c - 1] & 0x1f)) & 1)) goto lab1;
00339 among_var = find_among_b(a_3, 4, 0, 0);
00340 if (!(among_var)) goto lab1;
00341 bra = c;
00342 { int ret = r_R1();
00343 if (ret == 0) goto lab1;
00344 if (ret < 0) return ret;
00345 }
00346 switch(among_var) {
00347 case 0: goto lab1;
00348 case 1:
00349 if (slice_del() == -1) return -1;
00350 break;
00351 case 2:
00352 if (in_grouping_b_U(g_st_ending, 98, 116, 0)) goto lab1;
00353 { int ret = skip_utf8(p, c, lb, l, - 3);
00354 if (ret < 0) goto lab1;
00355 c = ret;
00356 }
00357 if (slice_del() == -1) return -1;
00358 break;
00359 }
00360 lab1:
00361 c = l - m2;
00362 }
00363 { int m3 = l - c; (void)m3;
00364 ket = c;
00365 if (c - 1 <= lb || p[c - 1] >> 5 != 3 || !((1051024 >> (p[c - 1] & 0x1f)) & 1)) goto lab2;
00366 among_var = find_among_b(a_5, 8, 0, 0);
00367 if (!(among_var)) goto lab2;
00368 bra = c;
00369 { int ret = r_R2();
00370 if (ret == 0) goto lab2;
00371 if (ret < 0) return ret;
00372 }
00373 switch(among_var) {
00374 case 0: goto lab2;
00375 case 1:
00376 if (slice_del() == -1) return -1;
00377 { int m4 = l - c; (void)m4;
00378 ket = c;
00379 if (!(eq_s_b(2, s_11))) { c = l - m4; goto lab3; }
00380 bra = c;
00381 { int m5 = l - c; (void)m5;
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();
00389 if (ret == 0) { c = l - m4; goto lab3; }
00390 if (ret < 0) return ret;
00391 }
00392 if (slice_del() == -1) return -1;
00393 lab3:
00394 ;
00395 }
00396 break;
00397 case 2:
00398 { int m6 = l - c; (void)m6;
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;
00406 break;
00407 case 3:
00408 if (slice_del() == -1) return -1;
00409 { int m7 = l - c; (void)m7;
00410 ket = c;
00411 { int m8 = l - c; (void)m8;
00412 if (!(eq_s_b(2, s_12))) goto lab8;
00413 goto lab7;
00414 lab8:
00415 c = l - m8;
00416 if (!(eq_s_b(2, s_13))) { c = l - m7; goto lab6; }
00417 }
00418 lab7:
00419 bra = c;
00420 { int ret = r_R1();
00421 if (ret == 0) { c = l - m7; goto lab6; }
00422 if (ret < 0) return ret;
00423 }
00424 if (slice_del() == -1) return -1;
00425 lab6:
00426 ;
00427 }
00428 break;
00429 case 4:
00430 if (slice_del() == -1) return -1;
00431 { int m9 = l - c; (void)m9;
00432 ket = c;
00433 if (c - 1 <= lb || (p[c - 1] != 103 && p[c - 1] != 104)) { c = l - m9; goto lab9; }
00434 among_var = find_among_b(a_4, 2, 0, 0);
00435 if (!(among_var)) { c = l - m9; goto lab9; }
00436 bra = c;
00437 { int ret = r_R2();
00438 if (ret == 0) { c = l - m9; goto lab9; }
00439 if (ret < 0) return ret;
00440 }
00441 switch(among_var) {
00442 case 0: { c = l - m9; goto lab9; }
00443 case 1:
00444 if (slice_del() == -1) return -1;
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() {
00459 { int c1 = c;
00460 { int ret = r_prelude();
00461 if (ret == 0) goto lab0;
00462 if (ret < 0) return ret;
00463 }
00464 lab0:
00465 c = c1;
00466 }
00467 { int c2 = c;
00468 { int ret = r_mark_regions();
00469 if (ret == 0) goto lab1;
00470 if (ret < 0) return ret;
00471 }
00472 lab1:
00473 c = c2;
00474 }
00475 lb = c; c = l;
00476
00477 { int m3 = l - c; (void)m3;
00478 { int ret = r_standard_suffix();
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;
00487 { int ret = r_postlude();
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 }