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