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