PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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[1] = { 'U' };
31static const symbol s_0_2[1] = { 'Y' };
32static const symbol s_0_3[1] = { 0xE4 };
33static const symbol s_0_4[1] = { 0xF6 };
34static const symbol s_0_5[1] = { 0xFC };
35
36static const struct among a_0[6] =
37{
38{ 0, 0, -1, 5, 0},
39{ 1, s_0_1, 0, 2, 0},
40{ 1, s_0_2, 0, 1, 0},
41{ 1, s_0_3, 0, 3, 0},
42{ 1, s_0_4, 0, 4, 0},
43{ 1, s_0_5, 0, 2, 0}
44};
45
46static const symbol s_1_0[1] = { 'e' };
47static const symbol s_1_1[2] = { 'e', 'm' };
48static const symbol s_1_2[2] = { 'e', 'n' };
49static const symbol s_1_3[3] = { 'e', 'r', 'n' };
50static const symbol s_1_4[2] = { 'e', 'r' };
51static const symbol s_1_5[1] = { 's' };
52static const symbol s_1_6[2] = { 'e', 's' };
53
54static const struct among a_1[7] =
55{
56{ 1, s_1_0, -1, 2, 0},
57{ 2, s_1_1, -1, 1, 0},
58{ 2, s_1_2, -1, 2, 0},
59{ 3, s_1_3, -1, 1, 0},
60{ 2, s_1_4, -1, 1, 0},
61{ 1, s_1_5, -1, 3, 0},
62{ 2, s_1_6, 5, 2, 0}
63};
64
65static const symbol s_2_0[2] = { 'e', 'n' };
66static const symbol s_2_1[2] = { 'e', 'r' };
67static const symbol s_2_2[2] = { 's', 't' };
68static const symbol s_2_3[3] = { 'e', 's', 't' };
69
70static const struct among a_2[4] =
71{
72{ 2, s_2_0, -1, 1, 0},
73{ 2, s_2_1, -1, 1, 0},
74{ 2, s_2_2, -1, 2, 0},
75{ 3, s_2_3, 2, 1, 0}
76};
77
78static const symbol s_3_0[2] = { 'i', 'g' };
79static const symbol s_3_1[4] = { 'l', 'i', 'c', 'h' };
80
81static const struct among a_3[2] =
82{
83{ 2, s_3_0, -1, 1, 0},
84{ 4, s_3_1, -1, 1, 0}
85};
86
87static const symbol s_4_0[3] = { 'e', 'n', 'd' };
88static const symbol s_4_1[2] = { 'i', 'g' };
89static const symbol s_4_2[3] = { 'u', 'n', 'g' };
90static const symbol s_4_3[4] = { 'l', 'i', 'c', 'h' };
91static const symbol s_4_4[4] = { 'i', 's', 'c', 'h' };
92static const symbol s_4_5[2] = { 'i', 'k' };
93static const symbol s_4_6[4] = { 'h', 'e', 'i', 't' };
94static const symbol s_4_7[4] = { 'k', 'e', 'i', 't' };
95
96static const struct among a_4[8] =
97{
98{ 3, s_4_0, -1, 1, 0},
99{ 2, s_4_1, -1, 2, 0},
100{ 3, s_4_2, -1, 1, 0},
101{ 4, s_4_3, -1, 3, 0},
102{ 4, s_4_4, -1, 2, 0},
103{ 2, s_4_5, -1, 2, 0},
104{ 4, s_4_6, -1, 3, 0},
105{ 4, s_4_7, -1, 4, 0}
106};
107
108static 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 };
109
110static const unsigned char g_s_ending[] = { 117, 30, 5 };
111
112static const unsigned char g_st_ending[] = { 117, 30, 4 };
113
114static const symbol s_0[] = { 's', 's' };
115static const symbol s_1[] = { 'U' };
116static const symbol s_2[] = { 'Y' };
117static const symbol s_3[] = { 'y' };
118static const symbol s_4[] = { 'u' };
119static const symbol s_5[] = { 'a' };
120static const symbol s_6[] = { 'o' };
121static const symbol s_7[] = { 'n', 'i', 's' };
122static const symbol s_8[] = { 'i', 'g' };
123static const symbol s_9[] = { 'e', 'r' };
124static const symbol s_10[] = { 'e', 'n' };
125
126static int r_prelude(struct SN_env * z) {
127 { int c_test1 = z->c;
128 while(1) {
129 int c2 = z->c;
130 { int c3 = z->c;
131 z->bra = z->c;
132 if (z->c == z->l || z->p[z->c] != 0xDF) goto lab2;
133 z->c++;
134 z->ket = z->c;
135 { int ret = slice_from_s(z, 2, s_0);
136 if (ret < 0) return ret;
137 }
138 goto lab1;
139 lab2:
140 z->c = c3;
141 if (z->c >= z->l) goto lab0;
142 z->c++;
143 }
144 lab1:
145 continue;
146 lab0:
147 z->c = c2;
148 break;
149 }
150 z->c = c_test1;
151 }
152 while(1) {
153 int c4 = z->c;
154 while(1) {
155 int c5 = z->c;
156 if (in_grouping(z, g_v, 97, 252, 0)) goto lab4;
157 z->bra = z->c;
158 { int c6 = z->c;
159 if (z->c == z->l || z->p[z->c] != 'u') goto lab6;
160 z->c++;
161 z->ket = z->c;
162 if (in_grouping(z, g_v, 97, 252, 0)) goto lab6;
163 { int ret = slice_from_s(z, 1, s_1);
164 if (ret < 0) return ret;
165 }
166 goto lab5;
167 lab6:
168 z->c = c6;
169 if (z->c == z->l || z->p[z->c] != 'y') goto lab4;
170 z->c++;
171 z->ket = z->c;
172 if (in_grouping(z, g_v, 97, 252, 0)) goto lab4;
173 { int ret = slice_from_s(z, 1, s_2);
174 if (ret < 0) return ret;
175 }
176 }
177 lab5:
178 z->c = c5;
179 break;
180 lab4:
181 z->c = c5;
182 if (z->c >= z->l) goto lab3;
183 z->c++;
184 }
185 continue;
186 lab3:
187 z->c = c4;
188 break;
189 }
190 return 1;
191}
192
193static int r_mark_regions(struct SN_env * z) {
194 z->I[2] = z->l;
195 z->I[1] = z->l;
196 { int c_test1 = z->c;
197z->c = z->c + 3;
198 if (z->c > z->l) return 0;
199 z->I[0] = z->c;
200 z->c = c_test1;
201 }
202 {
203 int ret = out_grouping(z, g_v, 97, 252, 1);
204 if (ret < 0) return 0;
205 z->c += ret;
206 }
207 {
208 int ret = in_grouping(z, g_v, 97, 252, 1);
209 if (ret < 0) return 0;
210 z->c += ret;
211 }
212 z->I[2] = z->c;
213
214 if (!(z->I[2] < z->I[0])) goto lab0;
215 z->I[2] = z->I[0];
216lab0:
217 {
218 int ret = out_grouping(z, g_v, 97, 252, 1);
219 if (ret < 0) return 0;
220 z->c += ret;
221 }
222 {
223 int ret = in_grouping(z, g_v, 97, 252, 1);
224 if (ret < 0) return 0;
225 z->c += ret;
226 }
227 z->I[1] = z->c;
228 return 1;
229}
230
231static int r_postlude(struct SN_env * z) {
232 int among_var;
233 while(1) {
234 int c1 = z->c;
235 z->bra = z->c;
236 among_var = find_among(z, a_0, 6);
237 if (!(among_var)) goto lab0;
238 z->ket = z->c;
239 switch (among_var) {
240 case 1:
241 { int ret = slice_from_s(z, 1, s_3);
242 if (ret < 0) return ret;
243 }
244 break;
245 case 2:
246 { int ret = slice_from_s(z, 1, s_4);
247 if (ret < 0) return ret;
248 }
249 break;
250 case 3:
251 { int ret = slice_from_s(z, 1, s_5);
252 if (ret < 0) return ret;
253 }
254 break;
255 case 4:
256 { int ret = slice_from_s(z, 1, s_6);
257 if (ret < 0) return ret;
258 }
259 break;
260 case 5:
261 if (z->c >= z->l) goto lab0;
262 z->c++;
263 break;
264 }
265 continue;
266 lab0:
267 z->c = c1;
268 break;
269 }
270 return 1;
271}
272
273static int r_R1(struct SN_env * z) {
274 if (!(z->I[2] <= z->c)) return 0;
275 return 1;
276}
277
278static int r_R2(struct SN_env * z) {
279 if (!(z->I[1] <= z->c)) return 0;
280 return 1;
281}
282
283static int r_standard_suffix(struct SN_env * z) {
284 int among_var;
285 { int m1 = z->l - z->c; (void)m1;
286 z->ket = z->c;
287 if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((811040 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab0;
288 among_var = find_among_b(z, a_1, 7);
289 if (!(among_var)) goto lab0;
290 z->bra = z->c;
291 { int ret = r_R1(z);
292 if (ret == 0) goto lab0;
293 if (ret < 0) return ret;
294 }
295 switch (among_var) {
296 case 1:
297 { int ret = slice_del(z);
298 if (ret < 0) return ret;
299 }
300 break;
301 case 2:
302 { int ret = slice_del(z);
303 if (ret < 0) return ret;
304 }
305 { int m2 = z->l - z->c; (void)m2;
306 z->ket = z->c;
307 if (z->c <= z->lb || z->p[z->c - 1] != 's') { z->c = z->l - m2; goto lab1; }
308 z->c--;
309 z->bra = z->c;
310 if (!(eq_s_b(z, 3, s_7))) { z->c = z->l - m2; goto lab1; }
311 { int ret = slice_del(z);
312 if (ret < 0) return ret;
313 }
314 lab1:
315 ;
316 }
317 break;
318 case 3:
319 if (in_grouping_b(z, g_s_ending, 98, 116, 0)) goto lab0;
320 { int ret = slice_del(z);
321 if (ret < 0) return ret;
322 }
323 break;
324 }
325 lab0:
326 z->c = z->l - m1;
327 }
328 { int m3 = z->l - z->c; (void)m3;
329 z->ket = z->c;
330 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1327104 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab2;
331 among_var = find_among_b(z, a_2, 4);
332 if (!(among_var)) goto lab2;
333 z->bra = z->c;
334 { int ret = r_R1(z);
335 if (ret == 0) goto lab2;
336 if (ret < 0) return ret;
337 }
338 switch (among_var) {
339 case 1:
340 { int ret = slice_del(z);
341 if (ret < 0) return ret;
342 }
343 break;
344 case 2:
345 if (in_grouping_b(z, g_st_ending, 98, 116, 0)) goto lab2;
346z->c = z->c - 3;
347 if (z->c < z->lb) goto lab2;
348 { int ret = slice_del(z);
349 if (ret < 0) return ret;
350 }
351 break;
352 }
353 lab2:
354 z->c = z->l - m3;
355 }
356 { int m4 = z->l - z->c; (void)m4;
357 z->ket = z->c;
358 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1051024 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab3;
359 among_var = find_among_b(z, a_4, 8);
360 if (!(among_var)) goto lab3;
361 z->bra = z->c;
362 { int ret = r_R2(z);
363 if (ret == 0) goto lab3;
364 if (ret < 0) return ret;
365 }
366 switch (among_var) {
367 case 1:
368 { int ret = slice_del(z);
369 if (ret < 0) return ret;
370 }
371 { int m5 = z->l - z->c; (void)m5;
372 z->ket = z->c;
373 if (!(eq_s_b(z, 2, s_8))) { z->c = z->l - m5; goto lab4; }
374 z->bra = z->c;
375 { int m6 = z->l - z->c; (void)m6;
376 if (z->c <= z->lb || z->p[z->c - 1] != 'e') goto lab5;
377 z->c--;
378 { z->c = z->l - m5; goto lab4; }
379 lab5:
380 z->c = z->l - m6;
381 }
382 { int ret = r_R2(z);
383 if (ret == 0) { z->c = z->l - m5; goto lab4; }
384 if (ret < 0) return ret;
385 }
386 { int ret = slice_del(z);
387 if (ret < 0) return ret;
388 }
389 lab4:
390 ;
391 }
392 break;
393 case 2:
394 { int m7 = z->l - z->c; (void)m7;
395 if (z->c <= z->lb || z->p[z->c - 1] != 'e') goto lab6;
396 z->c--;
397 goto lab3;
398 lab6:
399 z->c = z->l - m7;
400 }
401 { int ret = slice_del(z);
402 if (ret < 0) return ret;
403 }
404 break;
405 case 3:
406 { int ret = slice_del(z);
407 if (ret < 0) return ret;
408 }
409 { int m8 = z->l - z->c; (void)m8;
410 z->ket = z->c;
411 { int m9 = z->l - z->c; (void)m9;
412 if (!(eq_s_b(z, 2, s_9))) goto lab9;
413 goto lab8;
414 lab9:
415 z->c = z->l - m9;
416 if (!(eq_s_b(z, 2, s_10))) { z->c = z->l - m8; goto lab7; }
417 }
418 lab8:
419 z->bra = z->c;
420 { int ret = r_R1(z);
421 if (ret == 0) { z->c = z->l - m8; goto lab7; }
422 if (ret < 0) return ret;
423 }
424 { int ret = slice_del(z);
425 if (ret < 0) return ret;
426 }
427 lab7:
428 ;
429 }
430 break;
431 case 4:
432 { int ret = slice_del(z);
433 if (ret < 0) return ret;
434 }
435 { int m10 = z->l - z->c; (void)m10;
436 z->ket = z->c;
437 if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 103 && z->p[z->c - 1] != 104)) { z->c = z->l - m10; goto lab10; }
438 if (!(find_among_b(z, a_3, 2))) { z->c = z->l - m10; goto lab10; }
439 z->bra = z->c;
440 { int ret = r_R2(z);
441 if (ret == 0) { z->c = z->l - m10; goto lab10; }
442 if (ret < 0) return ret;
443 }
444 { int ret = slice_del(z);
445 if (ret < 0) return ret;
446 }
447 lab10:
448 ;
449 }
450 break;
451 }
452 lab3:
453 z->c = z->l - m4;
454 }
455 return 1;
456}
457
458extern int german_ISO_8859_1_stem(struct SN_env * z) {
459 { int c1 = z->c;
460 { int ret = r_prelude(z);
461 if (ret < 0) return ret;
462 }
463 z->c = c1;
464 }
465 { int c2 = z->c;
466 { int ret = r_mark_regions(z);
467 if (ret < 0) return ret;
468 }
469 z->c = c2;
470 }
471 z->lb = z->c; z->c = z->l;
472
473
474 { int ret = r_standard_suffix(z);
475 if (ret < 0) return ret;
476 }
477 z->c = z->lb;
478 { int c3 = z->c;
479 { int ret = r_postlude(z);
480 if (ret < 0) return ret;
481 }
482 z->c = c3;
483 }
484 return 1;
485}
486
487extern struct SN_env * german_ISO_8859_1_create_env(void) { return SN_create_env(0, 3); }
488
489extern void german_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 0); }
490
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 struct among a_3[2]
static const symbol s_4_7[4]
static const symbol s_2_2[2]
static const symbol s_4[]
static const symbol s_1_6[2]
static const symbol s_4_6[4]
static const symbol s_1_2[2]
static const symbol s_4_3[4]
int german_ISO_8859_1_stem(struct SN_env *z)
static const symbol s_0_2[1]
static int r_standard_suffix(struct SN_env *z)
static const struct among a_1[7]
static const symbol s_2_3[3]
static const symbol s_4_1[2]
static const symbol s_4_4[4]
static const symbol s_2_0[2]
static const unsigned char g_st_ending[]
struct SN_env * german_ISO_8859_1_create_env(void)
static const symbol s_6[]
static const symbol s_3[]
void german_ISO_8859_1_close_env(struct SN_env *z)
static const symbol s_3_0[2]
static int r_R2(struct SN_env *z)
static const symbol s_7[]
static const symbol s_1_1[2]
static const symbol s_0_4[1]
static const symbol s_1_5[1]
static const symbol s_1_3[3]
static int r_R1(struct SN_env *z)
static int r_postlude(struct SN_env *z)
static const struct among a_4[8]
static int r_prelude(struct SN_env *z)
static const symbol s_10[]
static const struct among a_2[4]
static const symbol s_1[]
static const symbol s_0_5[1]
static const struct among a_0[6]
static const symbol s_3_1[4]
static const symbol s_1_4[2]
static const symbol s_1_0[1]
static int r_mark_regions(struct SN_env *z)
static const symbol s_0_3[1]
static const symbol s_0_1[1]
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_5[]
static const symbol s_4_2[3]
static const symbol s_4_0[3]
static const symbol s_4_5[2]
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