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