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