Debian Codegraph @

src/backend/snowball/libstemmer/stem_UTF_8_german.c

raw
1 /* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
2
3 #include "header.h"
4
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 extern int german_UTF_8_stem(struct SN_env * z);
9 #ifdef __cplusplus
10 }
11 #endif
12 static int r_standard_suffix(struct SN_env * z);
13 static int r_R2(struct SN_env * z);
14 static int r_R1(struct SN_env * z);
15 static int r_mark_regions(struct SN_env * z);
16 static int r_postlude(struct SN_env * z);
17 static int r_prelude(struct SN_env * z);
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22
23 extern struct SN_env * german_UTF_8_create_env(void);
24 extern void german_UTF_8_close_env(struct SN_env * z);
25
26
27 #ifdef __cplusplus
28 }
29 #endif
30 static const symbol s_0_1[2] = { 'a', 'e' };
31 static const symbol s_0_2[2] = { 'o', 'e' };
32 static const symbol s_0_3[2] = { 'q', 'u' };
33 static const symbol s_0_4[2] = { 'u', 'e' };
34 static const symbol s_0_5[2] = { 0xC3, 0x9F };
35
36 static const struct among a_0[6] =
37 {
38 { 0, 0, -1, 5, 0},
39 { 2, s_0_1, 0, 2, 0},
40 { 2, s_0_2, 0, 3, 0},
41 { 2, s_0_3, 0, -1, 0},
42 { 2, s_0_4, 0, 4, 0},
43 { 2, s_0_5, 0, 1, 0}
44 };
45
46 static const symbol s_1_1[1] = { 'U' };
47 static const symbol s_1_2[1] = { 'Y' };
48 static const symbol s_1_3[2] = { 0xC3, 0xA4 };
49 static const symbol s_1_4[2] = { 0xC3, 0xB6 };
50 static const symbol s_1_5[2] = { 0xC3, 0xBC };
51
52 static const struct among a_1[6] =
53 {
54 { 0, 0, -1, 5, 0},
55 { 1, s_1_1, 0, 2, 0},
56 { 1, s_1_2, 0, 1, 0},
57 { 2, s_1_3, 0, 3, 0},
58 { 2, s_1_4, 0, 4, 0},
59 { 2, s_1_5, 0, 2, 0}
60 };
61
62 static const symbol s_2_0[1] = { 'e' };
63 static const symbol s_2_1[2] = { 'e', 'm' };
64 static const symbol s_2_2[2] = { 'e', 'n' };
65 static const symbol s_2_3[7] = { 'e', 'r', 'i', 'n', 'n', 'e', 'n' };
66 static const symbol s_2_4[4] = { 'e', 'r', 'i', 'n' };
67 static const symbol s_2_5[2] = { 'l', 'n' };
68 static const symbol s_2_6[3] = { 'e', 'r', 'n' };
69 static const symbol s_2_7[2] = { 'e', 'r' };
70 static const symbol s_2_8[1] = { 's' };
71 static const symbol s_2_9[2] = { 'e', 's' };
72 static const symbol s_2_10[3] = { 'l', 'n', 's' };
73
74 static const struct among a_2[11] =
75 {
76 { 1, s_2_0, -1, 3, 0},
77 { 2, s_2_1, -1, 1, 0},
78 { 2, s_2_2, -1, 3, 0},
79 { 7, s_2_3, 2, 2, 0},
80 { 4, s_2_4, -1, 2, 0},
81 { 2, s_2_5, -1, 5, 0},
82 { 3, s_2_6, -1, 2, 0},
83 { 2, s_2_7, -1, 2, 0},
84 { 1, s_2_8, -1, 4, 0},
85 { 2, s_2_9, 8, 3, 0},
86 { 3, s_2_10, 8, 5, 0}
87 };
88
89 static const symbol s_3_0[2] = { 'e', 'n' };
90 static const symbol s_3_1[2] = { 'e', 'r' };
91 static const symbol s_3_2[2] = { 's', 't' };
92 static const symbol s_3_3[3] = { 'e', 's', 't' };
93
94 static const struct among a_3[4] =
95 {
96 { 2, s_3_0, -1, 1, 0},
97 { 2, s_3_1, -1, 1, 0},
98 { 2, s_3_2, -1, 2, 0},
99 { 3, s_3_3, 2, 1, 0}
100 };
101
102 static const symbol s_4_0[2] = { 'i', 'g' };
103 static const symbol s_4_1[4] = { 'l', 'i', 'c', 'h' };
104
105 static const struct among a_4[2] =
106 {
107 { 2, s_4_0, -1, 1, 0},
108 { 4, s_4_1, -1, 1, 0}
109 };
110
111 static const symbol s_5_0[3] = { 'e', 'n', 'd' };
112 static const symbol s_5_1[2] = { 'i', 'g' };
113 static const symbol s_5_2[3] = { 'u', 'n', 'g' };
114 static const symbol s_5_3[4] = { 'l', 'i', 'c', 'h' };
115 static const symbol s_5_4[4] = { 'i', 's', 'c', 'h' };
116 static const symbol s_5_5[2] = { 'i', 'k' };
117 static const symbol s_5_6[4] = { 'h', 'e', 'i', 't' };
118 static const symbol s_5_7[4] = { 'k', 'e', 'i', 't' };
119
120 static const struct among a_5[8] =
121 {
122 { 3, s_5_0, -1, 1, 0},
123 { 2, s_5_1, -1, 2, 0},
124 { 3, s_5_2, -1, 1, 0},
125 { 4, s_5_3, -1, 3, 0},
126 { 4, s_5_4, -1, 2, 0},
127 { 2, s_5_5, -1, 2, 0},
128 { 4, s_5_6, -1, 3, 0},
129 { 4, s_5_7, -1, 4, 0}
130 };
131
132 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 };
133
134 static const unsigned char g_s_ending[] = { 117, 30, 5 };
135
136 static const unsigned char g_st_ending[] = { 117, 30, 4 };
137
138 static const symbol s_0[] = { 'U' };
139 static const symbol s_1[] = { 'Y' };
140 static const symbol s_2[] = { 's', 's' };
141 static const symbol s_3[] = { 0xC3, 0xA4 };
142 static const symbol s_4[] = { 0xC3, 0xB6 };
143 static const symbol s_5[] = { 0xC3, 0xBC };
144 static const symbol s_6[] = { 'y' };
145 static const symbol s_7[] = { 'u' };
146 static const symbol s_8[] = { 'a' };
147 static const symbol s_9[] = { 'o' };
148 static const symbol s_10[] = { 's', 'y', 's', 't' };
149 static const symbol s_11[] = { 'n', 'i', 's' };
150 static const symbol s_12[] = { 'l' };
151 static const symbol s_13[] = { 'i', 'g' };
152 static const symbol s_14[] = { 'e', 'r' };
153 static const symbol s_15[] = { 'e', 'n' };
154
155 static int r_prelude(struct SN_env * z) {
156 int among_var;
157 { int c_test1 = z->c;
158 while(1) {
159 int c2 = z->c;
160 while(1) {
161 int c3 = z->c;
162 if (in_grouping_U(z, g_v, 97, 252, 0)) goto lab1;
163 z->bra = z->c;
164 { int c4 = z->c;
165 if (z->c == z->l || z->p[z->c] != 'u') goto lab3;
166 z->c++;
167 z->ket = z->c;
168 if (in_grouping_U(z, g_v, 97, 252, 0)) goto lab3;
169 { int ret = slice_from_s(z, 1, s_0);
170 if (ret < 0) return ret;
171 }
172 goto lab2;
173 lab3:
174 z->c = c4;
175 if (z->c == z->l || z->p[z->c] != 'y') goto lab1;
176 z->c++;
177 z->ket = z->c;
178 if (in_grouping_U(z, g_v, 97, 252, 0)) goto lab1;
179 { int ret = slice_from_s(z, 1, s_1);
180 if (ret < 0) return ret;
181 }
182 }
183 lab2:
184 z->c = c3;
185 break;
186 lab1:
187 z->c = c3;
188 { int ret = skip_utf8(z->p, z->c, z->l, 1);
189 if (ret < 0) goto lab0;
190 z->c = ret;
191 }
192 }
193 continue;
194 lab0:
195 z->c = c2;
196 break;
197 }
198 z->c = c_test1;
199 }
200 while(1) {
201 int c5 = z->c;
202 z->bra = z->c;
203 among_var = find_among(z, a_0, 6);
204 z->ket = z->c;
205 switch (among_var) {
206 case 1:
207 { int ret = slice_from_s(z, 2, s_2);
208 if (ret < 0) return ret;
209 }
210 break;
211 case 2:
212 { int ret = slice_from_s(z, 2, s_3);
213 if (ret < 0) return ret;
214 }
215 break;
216 case 3:
217 { int ret = slice_from_s(z, 2, s_4);
218 if (ret < 0) return ret;
219 }
220 break;
221 case 4:
222 { int ret = slice_from_s(z, 2, s_5);
223 if (ret < 0) return ret;
224 }
225 break;
226 case 5:
227 { int ret = skip_utf8(z->p, z->c, z->l, 1);
228 if (ret < 0) goto lab4;
229 z->c = ret;
230 }
231 break;
232 }
233 continue;
234 lab4:
235 z->c = c5;
236 break;
237 }
238 return 1;
239 }
240
241 static int r_mark_regions(struct SN_env * z) {
242 z->I[2] = z->l;
243 z->I[1] = z->l;
244 { int c_test1 = z->c;
245 { int ret = skip_utf8(z->p, z->c, z->l, 3);
246 if (ret < 0) return 0;
247 z->c = ret;
248 }
249 z->I[0] = z->c;
250 z->c = c_test1;
251 }
252
253 {
254 int ret = out_grouping_U(z, g_v, 97, 252, 1);
255 if (ret < 0) return 0;
256 z->c += ret;
257 }
258
259 {
260 int ret = in_grouping_U(z, g_v, 97, 252, 1);
261 if (ret < 0) return 0;
262 z->c += ret;
263 }
264 z->I[2] = z->c;
265
266 if (z->I[2] >= z->I[0]) goto lab0;
267 z->I[2] = z->I[0];
268 lab0:
269
270 {
271 int ret = out_grouping_U(z, g_v, 97, 252, 1);
272 if (ret < 0) return 0;
273 z->c += ret;
274 }
275
276 {
277 int ret = in_grouping_U(z, g_v, 97, 252, 1);
278 if (ret < 0) return 0;
279 z->c += ret;
280 }
281 z->I[1] = z->c;
282 return 1;
283 }
284
285 static int r_postlude(struct SN_env * z) {
286 int among_var;
287 while(1) {
288 int c1 = z->c;
289 z->bra = z->c;
290 among_var = find_among(z, a_1, 6);
291 z->ket = z->c;
292 switch (among_var) {
293 case 1:
294 { int ret = slice_from_s(z, 1, s_6);
295 if (ret < 0) return ret;
296 }
297 break;
298 case 2:
299 { int ret = slice_from_s(z, 1, s_7);
300 if (ret < 0) return ret;
301 }
302 break;
303 case 3:
304 { int ret = slice_from_s(z, 1, s_8);
305 if (ret < 0) return ret;
306 }
307 break;
308 case 4:
309 { int ret = slice_from_s(z, 1, s_9);
310 if (ret < 0) return ret;
311 }
312 break;
313 case 5:
314 { int ret = skip_utf8(z->p, z->c, z->l, 1);
315 if (ret < 0) goto lab0;
316 z->c = ret;
317 }
318 break;
319 }
320 continue;
321 lab0:
322 z->c = c1;
323 break;
324 }
325 return 1;
326 }
327
328 static int r_R1(struct SN_env * z) {
329 return z->I[2] <= z->c;
330 }
331
332 static int r_R2(struct SN_env * z) {
333 return z->I[1] <= z->c;
334 }
335
336 static int r_standard_suffix(struct SN_env * z) {
337 int among_var;
338 { int m1 = z->l - z->c; (void)m1;
339 z->ket = z->c;
340 if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((811040 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab0;
341 among_var = find_among_b(z, a_2, 11);
342 if (!among_var) goto lab0;
343 z->bra = z->c;
344 { int ret = r_R1(z);
345 if (ret == 0) goto lab0;
346 if (ret < 0) return ret;
347 }
348 switch (among_var) {
349 case 1:
350 { int m2 = z->l - z->c; (void)m2;
351 if (!(eq_s_b(z, 4, s_10))) goto lab1;
352 goto lab0;
353 lab1:
354 z->c = z->l - m2;
355 }
356 { int ret = slice_del(z);
357 if (ret < 0) return ret;
358 }
359 break;
360 case 2:
361 { int ret = slice_del(z);
362 if (ret < 0) return ret;
363 }
364 break;
365 case 3:
366 { int ret = slice_del(z);
367 if (ret < 0) return ret;
368 }
369 { int m3 = z->l - z->c; (void)m3;
370 z->ket = z->c;
371 if (z->c <= z->lb || z->p[z->c - 1] != 's') { z->c = z->l - m3; goto lab2; }
372 z->c--;
373 z->bra = z->c;
374 if (!(eq_s_b(z, 3, s_11))) { z->c = z->l - m3; goto lab2; }
375 { int ret = slice_del(z);
376 if (ret < 0) return ret;
377 }
378 lab2:
379 ;
380 }
381 break;
382 case 4:
383 if (in_grouping_b_U(z, g_s_ending, 98, 116, 0)) goto lab0;
384 { int ret = slice_del(z);
385 if (ret < 0) return ret;
386 }
387 break;
388 case 5:
389 { int ret = slice_from_s(z, 1, s_12);
390 if (ret < 0) return ret;
391 }
392 break;
393 }
394 lab0:
395 z->c = z->l - m1;
396 }
397 { int m4 = z->l - z->c; (void)m4;
398 z->ket = z->c;
399 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1327104 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab3;
400 among_var = find_among_b(z, a_3, 4);
401 if (!among_var) goto lab3;
402 z->bra = z->c;
403 { int ret = r_R1(z);
404 if (ret == 0) goto lab3;
405 if (ret < 0) return ret;
406 }
407 switch (among_var) {
408 case 1:
409 { int ret = slice_del(z);
410 if (ret < 0) return ret;
411 }
412 break;
413 case 2:
414 if (in_grouping_b_U(z, g_st_ending, 98, 116, 0)) goto lab3;
415 { int ret = skip_b_utf8(z->p, z->c, z->lb, 3);
416 if (ret < 0) goto lab3;
417 z->c = ret;
418 }
419 { int ret = slice_del(z);
420 if (ret < 0) return ret;
421 }
422 break;
423 }
424 lab3:
425 z->c = z->l - m4;
426 }
427 { int m5 = z->l - z->c; (void)m5;
428 z->ket = z->c;
429 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1051024 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab4;
430 among_var = find_among_b(z, a_5, 8);
431 if (!among_var) goto lab4;
432 z->bra = z->c;
433 { int ret = r_R2(z);
434 if (ret == 0) goto lab4;
435 if (ret < 0) return ret;
436 }
437 switch (among_var) {
438 case 1:
439 { int ret = slice_del(z);
440 if (ret < 0) return ret;
441 }
442 { int m6 = z->l - z->c; (void)m6;
443 z->ket = z->c;
444 if (!(eq_s_b(z, 2, s_13))) { z->c = z->l - m6; goto lab5; }
445 z->bra = z->c;
446 { int m7 = z->l - z->c; (void)m7;
447 if (z->c <= z->lb || z->p[z->c - 1] != 'e') goto lab6;
448 z->c--;
449 { z->c = z->l - m6; goto lab5; }
450 lab6:
451 z->c = z->l - m7;
452 }
453 { int ret = r_R2(z);
454 if (ret == 0) { z->c = z->l - m6; goto lab5; }
455 if (ret < 0) return ret;
456 }
457 { int ret = slice_del(z);
458 if (ret < 0) return ret;
459 }
460 lab5:
461 ;
462 }
463 break;
464 case 2:
465 { int m8 = z->l - z->c; (void)m8;
466 if (z->c <= z->lb || z->p[z->c - 1] != 'e') goto lab7;
467 z->c--;
468 goto lab4;
469 lab7:
470 z->c = z->l - m8;
471 }
472 { int ret = slice_del(z);
473 if (ret < 0) return ret;
474 }
475 break;
476 case 3:
477 { int ret = slice_del(z);
478 if (ret < 0) return ret;
479 }
480 { int m9 = z->l - z->c; (void)m9;
481 z->ket = z->c;
482 { int m10 = z->l - z->c; (void)m10;
483 if (!(eq_s_b(z, 2, s_14))) goto lab10;
484 goto lab9;
485 lab10:
486 z->c = z->l - m10;
487 if (!(eq_s_b(z, 2, s_15))) { z->c = z->l - m9; goto lab8; }
488 }
489 lab9:
490 z->bra = z->c;
491 { int ret = r_R1(z);
492 if (ret == 0) { z->c = z->l - m9; goto lab8; }
493 if (ret < 0) return ret;
494 }
495 { int ret = slice_del(z);
496 if (ret < 0) return ret;
497 }
498 lab8:
499 ;
500 }
501 break;
502 case 4:
503 { int ret = slice_del(z);
504 if (ret < 0) return ret;
505 }
506 { int m11 = z->l - z->c; (void)m11;
507 z->ket = z->c;
508 if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 103 && z->p[z->c - 1] != 104)) { z->c = z->l - m11; goto lab11; }
509 if (!find_among_b(z, a_4, 2)) { z->c = z->l - m11; goto lab11; }
510 z->bra = z->c;
511 { int ret = r_R2(z);
512 if (ret == 0) { z->c = z->l - m11; goto lab11; }
513 if (ret < 0) return ret;
514 }
515 { int ret = slice_del(z);
516 if (ret < 0) return ret;
517 }
518 lab11:
519 ;
520 }
521 break;
522 }
523 lab4:
524 z->c = z->l - m5;
525 }
526 return 1;
527 }
528
529 extern int german_UTF_8_stem(struct SN_env * z) {
530 { int c1 = z->c;
531 { int ret = r_prelude(z);
532 if (ret < 0) return ret;
533 }
534 z->c = c1;
535 }
536 { int c2 = z->c;
537 { int ret = r_mark_regions(z);
538 if (ret < 0) return ret;
539 }
540 z->c = c2;
541 }
542 z->lb = z->c; z->c = z->l;
543
544
545 { int ret = r_standard_suffix(z);
546 if (ret < 0) return ret;
547 }
548 z->c = z->lb;
549 { int c3 = z->c;
550 { int ret = r_postlude(z);
551 if (ret < 0) return ret;
552 }
553 z->c = c3;
554 }
555 return 1;
556 }
557
558 extern struct SN_env * german_UTF_8_create_env(void) { return SN_create_env(0, 3); }
559
560 extern void german_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }
561