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