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