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