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 z->ket = z->c;
156 switch (among_var) {
157 case 1:
158 { int ret = slice_from_s(z, 1, s_0);
159 if (ret < 0) return ret;
160 }
161 break;
162 case 2:
163 { int ret = slice_from_s(z, 1, s_1);
164 if (ret < 0) return ret;
165 }
166 break;
167 case 3:
168 { int ret = slice_from_s(z, 1, s_2);
169 if (ret < 0) return ret;
170 }
171 break;
172 case 4:
173 { int ret = slice_from_s(z, 1, s_3);
174 if (ret < 0) return ret;
175 }
176 break;
177 case 5:
178 { int ret = slice_from_s(z, 1, s_4);
179 if (ret < 0) return ret;
180 }
181 break;
182 case 6:
183 if (z->c >= z->l) goto lab0;
184 z->c++;
185 break;
186 }
187 continue;
188 lab0:
189 z->c = c2;
190 break;
191 }
192 z->c = c_test1;
193 }
194 { int c3 = z->c;
195 z->bra = z->c;
196 if (z->c == z->l || z->p[z->c] != 'y') { z->c = c3; goto lab1; }
197 z->c++;
198 z->ket = z->c;
199 { int ret = slice_from_s(z, 1, s_5);
200 if (ret < 0) return ret;
201 }
202 lab1:
203 ;
204 }
205 while(1) {
206 int c4 = z->c;
207 while(1) {
208 int c5 = z->c;
209 if (in_grouping(z, g_v, 97, 232, 0)) goto lab3;
210 z->bra = z->c;
211 { int c6 = z->c;
212 if (z->c == z->l || z->p[z->c] != 'i') goto lab5;
213 z->c++;
214 z->ket = z->c;
215 if (in_grouping(z, g_v, 97, 232, 0)) goto lab5;
216 { int ret = slice_from_s(z, 1, s_6);
217 if (ret < 0) return ret;
218 }
219 goto lab4;
220 lab5:
221 z->c = c6;
222 if (z->c == z->l || z->p[z->c] != 'y') goto lab3;
223 z->c++;
224 z->ket = z->c;
225 { int ret = slice_from_s(z, 1, s_7);
226 if (ret < 0) return ret;
227 }
228 }
229 lab4:
230 z->c = c5;
231 break;
232 lab3:
233 z->c = c5;
234 if (z->c >= z->l) goto lab2;
235 z->c++;
236 }
237 continue;
238 lab2:
239 z->c = c4;
240 break;
241 }
242 return 1;
243}
244
245static int r_mark_regions(struct SN_env * z) {
246 z->I[2] = z->l;
247 z->I[1] = z->l;
248 { int c_test1 = z->c;
249z->c = z->c + 3;
250 if (z->c > z->l) return 0;
251 z->I[0] = z->c;
252 z->c = c_test1;
253 }
254
255 {
256 int ret = out_grouping(z, g_v, 97, 232, 1);
257 if (ret < 0) return 0;
258 z->c += ret;
259 }
260
261 {
262 int ret = in_grouping(z, g_v, 97, 232, 1);
263 if (ret < 0) return 0;
264 z->c += ret;
265 }
266 z->I[2] = z->c;
267
268 if (z->I[2] >= z->I[0]) goto lab0;
269 z->I[2] = z->I[0];
270lab0:
271
272 {
273 int ret = out_grouping(z, g_v, 97, 232, 1);
274 if (ret < 0) return 0;
275 z->c += ret;
276 }
277
278 {
279 int ret = in_grouping(z, g_v, 97, 232, 1);
280 if (ret < 0) return 0;
281 z->c += ret;
282 }
283 z->I[1] = z->c;
284 return 1;
285}
286
287static int r_postlude(struct SN_env * z) {
288 int among_var;
289 while(1) {
290 int c1 = z->c;
291 z->bra = z->c;
292 if (z->c >= z->l || (z->p[z->c + 0] != 73 && z->p[z->c + 0] != 89)) among_var = 3; else
293 among_var = find_among(z, a_1, 3);
294 z->ket = z->c;
295 switch (among_var) {
296 case 1:
297 { int ret = slice_from_s(z, 1, s_8);
298 if (ret < 0) return ret;
299 }
300 break;
301 case 2:
302 { int ret = slice_from_s(z, 1, s_9);
303 if (ret < 0) return ret;
304 }
305 break;
306 case 3:
307 if (z->c >= z->l) goto lab0;
308 z->c++;
309 break;
310 }
311 continue;
312 lab0:
313 z->c = c1;
314 break;
315 }
316 return 1;
317}
318
319static int r_R1(struct SN_env * z) {
320 return z->I[2] <= z->c;
321}
322
323static int r_R2(struct SN_env * z) {
324 return z->I[1] <= z->c;
325}
326
327static int r_undouble(struct SN_env * z) {
328 { int m_test1 = z->l - z->c;
329 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1050640 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
330 if (!find_among_b(z, a_2, 3)) return 0;
331 z->c = z->l - m_test1;
332 }
333 z->ket = z->c;
334 if (z->c <= z->lb) return 0;
335 z->c--;
336 z->bra = z->c;
337 { int ret = slice_del(z);
338 if (ret < 0) return ret;
339 }
340 return 1;
341}
342
343static int r_e_ending(struct SN_env * z) {
344 z->I[3] = 0;
345 z->ket = z->c;
346 if (z->c <= z->lb || z->p[z->c - 1] != 'e') return 0;
347 z->c--;
348 z->bra = z->c;
349 { int ret = r_R1(z);
350 if (ret <= 0) return ret;
351 }
352 { int m_test1 = z->l - z->c;
353 if (out_grouping_b(z, g_v, 97, 232, 0)) return 0;
354 z->c = z->l - m_test1;
355 }
356 { int ret = slice_del(z);
357 if (ret < 0) return ret;
358 }
359 z->I[3] = 1;
360 { int ret = r_undouble(z);
361 if (ret <= 0) return ret;
362 }
363 return 1;
364}
365
366static int r_en_ending(struct SN_env * z) {
367 { int ret = r_R1(z);
368 if (ret <= 0) return ret;
369 }
370 { int m1 = z->l - z->c; (void)m1;
371 if (out_grouping_b(z, g_v, 97, 232, 0)) return 0;
372 z->c = z->l - m1;
373 { int m2 = z->l - z->c; (void)m2;
374 if (!(eq_s_b(z, 3, s_10))) goto lab0;
375 return 0;
376 lab0:
377 z->c = z->l - m2;
378 }
379 }
380 { int ret = slice_del(z);
381 if (ret < 0) return ret;
382 }
383 { int ret = r_undouble(z);
384 if (ret <= 0) return ret;
385 }
386 return 1;
387}
388
389static int r_standard_suffix(struct SN_env * z) {
390 int among_var;
391 { int m1 = z->l - z->c; (void)m1;
392 z->ket = z->c;
393 if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((540704 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab0;
394 among_var = find_among_b(z, a_3, 5);
395 if (!among_var) goto lab0;
396 z->bra = z->c;
397 switch (among_var) {
398 case 1:
399 { int ret = r_R1(z);
400 if (ret == 0) goto lab0;
401 if (ret < 0) return ret;
402 }
403 { int ret = slice_from_s(z, 4, s_11);
404 if (ret < 0) return ret;
405 }
406 break;
407 case 2:
408 { int ret = r_en_ending(z);
409 if (ret == 0) goto lab0;
410 if (ret < 0) return ret;
411 }
412 break;
413 case 3:
414 { int ret = r_R1(z);
415 if (ret == 0) goto lab0;
416 if (ret < 0) return ret;
417 }
418 if (out_grouping_b(z, g_v_j, 97, 232, 0)) goto lab0;
419 { int ret = slice_del(z);
420 if (ret < 0) return ret;
421 }
422 break;
423 }
424 lab0:
425 z->c = z->l - m1;
426 }
427 { int m2 = z->l - z->c; (void)m2;
428 { int ret = r_e_ending(z);
429 if (ret < 0) return ret;
430 }
431 z->c = z->l - m2;
432 }
433 { int m3 = z->l - z->c; (void)m3;
434 z->ket = z->c;
435 if (!(eq_s_b(z, 4, s_12))) goto lab1;
436 z->bra = z->c;
437 { int ret = r_R2(z);
438 if (ret == 0) goto lab1;
439 if (ret < 0) return ret;
440 }
441 { int m4 = z->l - z->c; (void)m4;
442 if (z->c <= z->lb || z->p[z->c - 1] != 'c') goto lab2;
443 z->c--;
444 goto lab1;
445 lab2:
446 z->c = z->l - m4;
447 }
448 { int ret = slice_del(z);
449 if (ret < 0) return ret;
450 }
451 z->ket = z->c;
452 if (!(eq_s_b(z, 2, s_13))) goto lab1;
453 z->bra = z->c;
454 { int ret = r_en_ending(z);
455 if (ret == 0) goto lab1;
456 if (ret < 0) return ret;
457 }
458 lab1:
459 z->c = z->l - m3;
460 }
461 { int m5 = z->l - z->c; (void)m5;
462 z->ket = z->c;
463 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((264336 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab3;
464 among_var = find_among_b(z, a_4, 6);
465 if (!among_var) goto lab3;
466 z->bra = z->c;
467 switch (among_var) {
468 case 1:
469 { int ret = r_R2(z);
470 if (ret == 0) goto lab3;
471 if (ret < 0) return ret;
472 }
473 { int ret = slice_del(z);
474 if (ret < 0) return ret;
475 }
476 { int m6 = z->l - z->c; (void)m6;
477 z->ket = z->c;
478 if (!(eq_s_b(z, 2, s_14))) goto lab5;
479 z->bra = z->c;
480 { int ret = r_R2(z);
481 if (ret == 0) goto lab5;
482 if (ret < 0) return ret;
483 }
484 { int m7 = z->l - z->c; (void)m7;
485 if (z->c <= z->lb || z->p[z->c - 1] != 'e') goto lab6;
486 z->c--;
487 goto lab5;
488 lab6:
489 z->c = z->l - m7;
490 }
491 { int ret = slice_del(z);
492 if (ret < 0) return ret;
493 }
494 goto lab4;
495 lab5:
496 z->c = z->l - m6;
497 { int ret = r_undouble(z);
498 if (ret == 0) goto lab3;
499 if (ret < 0) return ret;
500 }
501 }
502 lab4:
503 break;
504 case 2:
505 { int ret = r_R2(z);
506 if (ret == 0) goto lab3;
507 if (ret < 0) return ret;
508 }
509 { int m8 = z->l - z->c; (void)m8;
510 if (z->c <= z->lb || z->p[z->c - 1] != 'e') goto lab7;
511 z->c--;
512 goto lab3;
513 lab7:
514 z->c = z->l - m8;
515 }
516 { int ret = slice_del(z);
517 if (ret < 0) return ret;
518 }
519 break;
520 case 3:
521 { int ret = r_R2(z);
522 if (ret == 0) goto lab3;
523 if (ret < 0) return ret;
524 }
525 { int ret = slice_del(z);
526 if (ret < 0) return ret;
527 }
528 { int ret = r_e_ending(z);
529 if (ret == 0) goto lab3;
530 if (ret < 0) return ret;
531 }
532 break;
533 case 4:
534 { int ret = r_R2(z);
535 if (ret == 0) goto lab3;
536 if (ret < 0) return ret;
537 }
538 { int ret = slice_del(z);
539 if (ret < 0) return ret;
540 }
541 break;
542 case 5:
543 { int ret = r_R2(z);
544 if (ret == 0) goto lab3;
545 if (ret < 0) return ret;
546 }
547 if (!(z->I[3])) goto lab3;
548 { int ret = slice_del(z);
549 if (ret < 0) return ret;
550 }
551 break;
552 }
553 lab3:
554 z->c = z->l - m5;
555 }
556 { int m9 = z->l - z->c; (void)m9;
557 if (out_grouping_b(z, g_v_I, 73, 232, 0)) goto lab8;
558 { int m_test10 = z->l - z->c;
559 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((2129954 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab8;
560 if (!find_among_b(z, a_5, 4)) goto lab8;
561 if (out_grouping_b(z, g_v, 97, 232, 0)) goto lab8;
562 z->c = z->l - m_test10;
563 }
564 z->ket = z->c;
565 if (z->c <= z->lb) goto lab8;
566 z->c--;
567 z->bra = z->c;
568 { int ret = slice_del(z);
569 if (ret < 0) return ret;
570 }
571 lab8:
572 z->c = z->l - m9;
573 }
574 return 1;
575}
576
577extern int dutch_ISO_8859_1_stem(struct SN_env * z) {
578 { int c1 = z->c;
579 { int ret = r_prelude(z);
580 if (ret < 0) return ret;
581 }
582 z->c = c1;
583 }
584 { int c2 = z->c;
585 { int ret = r_mark_regions(z);
586 if (ret < 0) return ret;
587 }
588 z->c = c2;
589 }
590 z->lb = z->c; z->c = z->l;
591
592
593 { int ret = r_standard_suffix(z);
594 if (ret < 0) return ret;
595 }
596 z->c = z->lb;
597 { int c3 = z->c;
598 { int ret = r_postlude(z);
599 if (ret < 0) return ret;
600 }
601 z->c = c3;
602 }
603 return 1;
604}
605
606extern struct SN_env * dutch_ISO_8859_1_create_env(void) { return SN_create_env(0, 4); }
607
608extern void dutch_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 0); }
609
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