PostgreSQL Source Code git master
stem_UTF_8_esperanto.c
Go to the documentation of this file.
1/* Generated from esperanto.sbl by Snowball 3.0.0 - https://snowballstem.org/ */
2
4
5#include <stddef.h>
6
7#include "snowball_runtime.h"
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12extern int esperanto_UTF_8_stem(struct SN_env * z);
13#ifdef __cplusplus
14}
15#endif
16
17static int r_uninflected(struct SN_env * z);
18static int r_ujn_suffix(struct SN_env * z);
19static int r_standard_suffix(struct SN_env * z);
20static int r_pronoun(struct SN_env * z);
21static int r_merged_numeral(struct SN_env * z);
22static int r_long_word(struct SN_env * z);
23static int r_initial_apostrophe(struct SN_env * z);
24static int r_final_apostrophe(struct SN_env * z);
25static int r_correlative(struct SN_env * z);
26static int r_canonical_form(struct SN_env * z);
27
28static const symbol s_0[] = { 0xC4, 0x89 };
29static const symbol s_1[] = { 0xC4, 0x9D };
30static const symbol s_2[] = { 0xC4, 0xA5 };
31static const symbol s_3[] = { 0xC4, 0xB5 };
32static const symbol s_4[] = { 0xC5, 0x9D };
33static const symbol s_5[] = { 0xC5, 0xAD };
34static const symbol s_6[] = { 'a' };
35static const symbol s_7[] = { 'e' };
36static const symbol s_8[] = { 'i' };
37static const symbol s_9[] = { 'o' };
38static const symbol s_10[] = { 'u' };
39static const symbol s_11[] = { 's', 't' };
40static const symbol s_12[] = { 'e' };
41static const symbol s_13[] = { 'a' };
42static const symbol s_14[] = { 'u', 'n' };
43static const symbol s_15[] = { 'u' };
44static const symbol s_16[] = { 'a', 0xC5, 0xAD };
45static const symbol s_17[] = { 'o' };
46
47static const symbol s_0_1[1] = { '-' };
48static const symbol s_0_2[2] = { 'c', 'x' };
49static const symbol s_0_3[2] = { 'g', 'x' };
50static const symbol s_0_4[2] = { 'h', 'x' };
51static const symbol s_0_5[2] = { 'j', 'x' };
52static const symbol s_0_6[1] = { 'q' };
53static const symbol s_0_7[2] = { 's', 'x' };
54static const symbol s_0_8[2] = { 'u', 'x' };
55static const symbol s_0_9[1] = { 'w' };
56static const symbol s_0_10[1] = { 'x' };
57static const symbol s_0_11[1] = { 'y' };
58static const symbol s_0_12[2] = { 0xC3, 0xA1 };
59static const symbol s_0_13[2] = { 0xC3, 0xA9 };
60static const symbol s_0_14[2] = { 0xC3, 0xAD };
61static const symbol s_0_15[2] = { 0xC3, 0xB3 };
62static const symbol s_0_16[2] = { 0xC3, 0xBA };
63static const struct among a_0[17] = {
64{ 0, 0, 0, 14, 0},
65{ 1, s_0_1, -1, 13, 0},
66{ 2, s_0_2, -2, 1, 0},
67{ 2, s_0_3, -3, 2, 0},
68{ 2, s_0_4, -4, 3, 0},
69{ 2, s_0_5, -5, 4, 0},
70{ 1, s_0_6, -6, 12, 0},
71{ 2, s_0_7, -7, 5, 0},
72{ 2, s_0_8, -8, 6, 0},
73{ 1, s_0_9, -9, 12, 0},
74{ 1, s_0_10, -10, 12, 0},
75{ 1, s_0_11, -11, 12, 0},
76{ 2, s_0_12, -12, 7, 0},
77{ 2, s_0_13, -13, 8, 0},
78{ 2, s_0_14, -14, 9, 0},
79{ 2, s_0_15, -15, 10, 0},
80{ 2, s_0_16, -16, 11, 0}
81};
82
83static const symbol s_1_0[2] = { 'a', 's' };
84static const symbol s_1_1[1] = { 'i' };
85static const symbol s_1_2[2] = { 'i', 's' };
86static const symbol s_1_3[2] = { 'o', 's' };
87static const symbol s_1_4[1] = { 'u' };
88static const symbol s_1_5[2] = { 'u', 's' };
89static const struct among a_1[6] = {
90{ 2, s_1_0, 0, -1, 0},
91{ 1, s_1_1, 0, -1, 0},
92{ 2, s_1_2, -1, -1, 0},
93{ 2, s_1_3, 0, -1, 0},
94{ 1, s_1_4, 0, -1, 0},
95{ 2, s_1_5, -1, -1, 0}
96};
97
98static const symbol s_2_0[2] = { 'c', 'i' };
99static const symbol s_2_1[2] = { 'g', 'i' };
100static const symbol s_2_2[2] = { 'h', 'i' };
101static const symbol s_2_3[2] = { 'l', 'i' };
102static const symbol s_2_4[3] = { 'i', 'l', 'i' };
103static const symbol s_2_5[4] = { 0xC5, 0x9D, 'l', 'i' };
104static const symbol s_2_6[2] = { 'm', 'i' };
105static const symbol s_2_7[2] = { 'n', 'i' };
106static const symbol s_2_8[3] = { 'o', 'n', 'i' };
107static const symbol s_2_9[2] = { 'r', 'i' };
108static const symbol s_2_10[2] = { 's', 'i' };
109static const symbol s_2_11[2] = { 'v', 'i' };
110static const symbol s_2_12[3] = { 'i', 'v', 'i' };
111static const symbol s_2_13[3] = { 0xC4, 0x9D, 'i' };
112static const symbol s_2_14[3] = { 0xC5, 0x9D, 'i' };
113static const symbol s_2_15[4] = { 'i', 0xC5, 0x9D, 'i' };
114static const symbol s_2_16[6] = { 'm', 'a', 'l', 0xC5, 0x9D, 'i' };
115static const struct among a_2[17] = {
116{ 2, s_2_0, 0, -1, 0},
117{ 2, s_2_1, 0, -1, 0},
118{ 2, s_2_2, 0, -1, 0},
119{ 2, s_2_3, 0, -1, 0},
120{ 3, s_2_4, -1, -1, 0},
121{ 4, s_2_5, -2, -1, 0},
122{ 2, s_2_6, 0, -1, 0},
123{ 2, s_2_7, 0, -1, 0},
124{ 3, s_2_8, -1, -1, 0},
125{ 2, s_2_9, 0, -1, 0},
126{ 2, s_2_10, 0, -1, 0},
127{ 2, s_2_11, 0, -1, 0},
128{ 3, s_2_12, -1, -1, 0},
129{ 3, s_2_13, 0, -1, 0},
130{ 3, s_2_14, 0, -1, 0},
131{ 4, s_2_15, -1, -1, 0},
132{ 6, s_2_16, -2, -1, 0}
133};
134
135static const symbol s_3_0[3] = { 'a', 'm', 'b' };
136static const symbol s_3_1[4] = { 'b', 'a', 'l', 'd' };
137static const symbol s_3_2[7] = { 'm', 'a', 'l', 'b', 'a', 'l', 'd' };
138static const symbol s_3_3[4] = { 'm', 'o', 'r', 'g' };
139static const symbol s_3_4[8] = { 'p', 'o', 's', 't', 'm', 'o', 'r', 'g' };
140static const symbol s_3_5[3] = { 'a', 'd', 'i' };
141static const symbol s_3_6[4] = { 'h', 'o', 'd', 'i' };
142static const symbol s_3_7[3] = { 'a', 'n', 'k' };
143static const symbol s_3_8[5] = { 0xC4, 0x89, 'i', 'r', 'k' };
144static const symbol s_3_9[8] = { 't', 'u', 't', 0xC4, 0x89, 'i', 'r', 'k' };
145static const symbol s_3_10[5] = { 'p', 'r', 'e', 's', 'k' };
146static const symbol s_3_11[5] = { 'a', 'l', 'm', 'e', 'n' };
147static const symbol s_3_12[4] = { 'a', 'p', 'e', 'n' };
148static const symbol s_3_13[4] = { 'h', 'i', 'e', 'r' };
149static const symbol s_3_14[10] = { 'a', 'n', 't', 'a', 0xC5, 0xAD, 'h', 'i', 'e', 'r' };
150static const symbol s_3_15[5] = { 'm', 'a', 'l', 'g', 'r' };
151static const symbol s_3_16[5] = { 'a', 'n', 'k', 'o', 'r' };
152static const symbol s_3_17[5] = { 'k', 'o', 'n', 't', 'r' };
153static const symbol s_3_18[6] = { 'a', 'n', 's', 't', 'a', 't' };
154static const symbol s_3_19[4] = { 'k', 'v', 'a', 'z' };
155static const struct among a_3[20] = {
156{ 3, s_3_0, 0, -1, 0},
157{ 4, s_3_1, 0, -1, 0},
158{ 7, s_3_2, -1, -1, 0},
159{ 4, s_3_3, 0, -1, 0},
160{ 8, s_3_4, -1, -1, 0},
161{ 3, s_3_5, 0, -1, 0},
162{ 4, s_3_6, 0, -1, 0},
163{ 3, s_3_7, 0, -1, 0},
164{ 5, s_3_8, 0, -1, 0},
165{ 8, s_3_9, -1, -1, 0},
166{ 5, s_3_10, 0, -1, 0},
167{ 5, s_3_11, 0, -1, 0},
168{ 4, s_3_12, 0, -1, 0},
169{ 4, s_3_13, 0, -1, 0},
170{ 10, s_3_14, -1, -1, 0},
171{ 5, s_3_15, 0, -1, 0},
172{ 5, s_3_16, 0, -1, 0},
173{ 5, s_3_17, 0, -1, 0},
174{ 6, s_3_18, 0, -1, 0},
175{ 4, s_3_19, 0, -1, 0}
176};
177
178static const symbol s_4_0[4] = { 'a', 'l', 'i', 'u' };
179static const symbol s_4_1[3] = { 'u', 'n', 'u' };
180static const struct among a_4[2] = {
181{ 4, s_4_0, 0, -1, 0},
182{ 3, s_4_1, 0, -1, 0}
183};
184
185static const symbol s_5_0[3] = { 'a', 'h', 'a' };
186static const symbol s_5_1[4] = { 'h', 'a', 'h', 'a' };
187static const symbol s_5_2[8] = { 'h', 'a', 'l', 'e', 'l', 'u', 'j', 'a' };
188static const symbol s_5_3[4] = { 'h', 'o', 'l', 'a' };
189static const symbol s_5_4[6] = { 'h', 'o', 's', 'a', 'n', 'a' };
190static const symbol s_5_5[6] = { 'm', 'a', 'l', 't', 'r', 'a' };
191static const symbol s_5_6[4] = { 'h', 'u', 'r', 'a' };
192static const symbol s_5_7[6] = { 0xC4, 0xA5, 'a', 0xC4, 0xA5, 'a' };
193static const symbol s_5_8[4] = { 'e', 'k', 'd', 'e' };
194static const symbol s_5_9[4] = { 'e', 'l', 'd', 'e' };
195static const symbol s_5_10[5] = { 'd', 'i', 's', 'd', 'e' };
196static const symbol s_5_11[3] = { 'e', 'h', 'e' };
197static const symbol s_5_12[6] = { 'm', 'a', 'l', 't', 'r', 'e' };
198static const symbol s_5_13[9] = { 'd', 'i', 'r', 'l', 'i', 'd', 'i', 'd', 'i' };
199static const symbol s_5_14[6] = { 'm', 'a', 'l', 'p', 'l', 'i' };
200static const symbol s_5_15[6] = { 'm', 'a', 'l', 0xC4, 0x89, 'i' };
201static const symbol s_5_16[6] = { 'm', 'a', 'l', 'k', 'a', 'j' };
202static const symbol s_5_17[4] = { 'a', 'm', 'e', 'n' };
203static const symbol s_5_18[5] = { 't', 'a', 'm', 'e', 'n' };
204static const symbol s_5_19[3] = { 'o', 'h', 'o' };
205static const symbol s_5_20[6] = { 'm', 'a', 'l', 't', 'r', 'o' };
206static const symbol s_5_21[5] = { 'm', 'i', 'n', 'u', 's' };
207static const symbol s_5_22[3] = { 'u', 'h', 'u' };
208static const symbol s_5_23[3] = { 'm', 'u', 'u' };
209static const struct among a_5[24] = {
210{ 3, s_5_0, 0, -1, 0},
211{ 4, s_5_1, -1, -1, 0},
212{ 8, s_5_2, 0, -1, 0},
213{ 4, s_5_3, 0, -1, 0},
214{ 6, s_5_4, 0, -1, 0},
215{ 6, s_5_5, 0, -1, 0},
216{ 4, s_5_6, 0, -1, 0},
217{ 6, s_5_7, 0, -1, 0},
218{ 4, s_5_8, 0, -1, 0},
219{ 4, s_5_9, 0, -1, 0},
220{ 5, s_5_10, 0, -1, 0},
221{ 3, s_5_11, 0, -1, 0},
222{ 6, s_5_12, 0, -1, 0},
223{ 9, s_5_13, 0, -1, 0},
224{ 6, s_5_14, 0, -1, 0},
225{ 6, s_5_15, 0, -1, 0},
226{ 6, s_5_16, 0, -1, 0},
227{ 4, s_5_17, 0, -1, 0},
228{ 5, s_5_18, -1, -1, 0},
229{ 3, s_5_19, 0, -1, 0},
230{ 6, s_5_20, 0, -1, 0},
231{ 5, s_5_21, 0, -1, 0},
232{ 3, s_5_22, 0, -1, 0},
233{ 3, s_5_23, 0, -1, 0}
234};
235
236static const symbol s_6_0[3] = { 't', 'r', 'i' };
237static const symbol s_6_1[2] = { 'd', 'u' };
238static const symbol s_6_2[3] = { 'u', 'n', 'u' };
239static const struct among a_6[3] = {
240{ 3, s_6_0, 0, -1, 0},
241{ 2, s_6_1, 0, -1, 0},
242{ 3, s_6_2, 0, -1, 0}
243};
244
245static const symbol s_7_0[3] = { 'd', 'e', 'k' };
246static const symbol s_7_1[4] = { 'c', 'e', 'n', 't' };
247static const struct among a_7[2] = {
248{ 3, s_7_0, 0, -1, 0},
249{ 4, s_7_1, 0, -1, 0}
250};
251
252static const symbol s_8_0[1] = { 'k' };
253static const symbol s_8_1[4] = { 'k', 'e', 'l', 'k' };
254static const symbol s_8_2[3] = { 'n', 'e', 'n' };
255static const symbol s_8_3[1] = { 't' };
256static const symbol s_8_4[4] = { 'm', 'u', 'l', 't' };
257static const symbol s_8_5[4] = { 's', 'a', 'm', 't' };
258static const symbol s_8_6[2] = { 0xC4, 0x89 };
259static const struct among a_8[7] = {
260{ 1, s_8_0, 0, -1, 0},
261{ 4, s_8_1, -1, -1, 0},
262{ 3, s_8_2, 0, -1, 0},
263{ 1, s_8_3, 0, -1, 0},
264{ 4, s_8_4, -1, -1, 0},
265{ 4, s_8_5, -2, -1, 0},
266{ 2, s_8_6, 0, -1, 0}
267};
268
269static const symbol s_9_0[1] = { 'a' };
270static const symbol s_9_1[1] = { 'e' };
271static const symbol s_9_2[1] = { 'i' };
272static const symbol s_9_3[1] = { 'j' };
273static const symbol s_9_4[2] = { 'a', 'j' };
274static const symbol s_9_5[2] = { 'o', 'j' };
275static const symbol s_9_6[1] = { 'n' };
276static const symbol s_9_7[2] = { 'a', 'n' };
277static const symbol s_9_8[2] = { 'e', 'n' };
278static const symbol s_9_9[2] = { 'j', 'n' };
279static const symbol s_9_10[3] = { 'a', 'j', 'n' };
280static const symbol s_9_11[3] = { 'o', 'j', 'n' };
281static const symbol s_9_12[2] = { 'o', 'n' };
282static const symbol s_9_13[1] = { 'o' };
283static const symbol s_9_14[2] = { 'a', 's' };
284static const symbol s_9_15[2] = { 'i', 's' };
285static const symbol s_9_16[2] = { 'o', 's' };
286static const symbol s_9_17[2] = { 'u', 's' };
287static const symbol s_9_18[1] = { 'u' };
288static const struct among a_9[19] = {
289{ 1, s_9_0, 0, -1, 0},
290{ 1, s_9_1, 0, -1, 0},
291{ 1, s_9_2, 0, -1, 0},
292{ 1, s_9_3, 0, 1, 0},
293{ 2, s_9_4, -1, -1, 0},
294{ 2, s_9_5, -2, -1, 0},
295{ 1, s_9_6, 0, 1, 0},
296{ 2, s_9_7, -1, -1, 0},
297{ 2, s_9_8, -2, -1, 0},
298{ 2, s_9_9, -3, 1, 0},
299{ 3, s_9_10, -1, -1, 0},
300{ 3, s_9_11, -2, -1, 0},
301{ 2, s_9_12, -6, -1, 0},
302{ 1, s_9_13, 0, -1, 0},
303{ 2, s_9_14, 0, -1, 0},
304{ 2, s_9_15, 0, -1, 0},
305{ 2, s_9_16, 0, -1, 0},
306{ 2, s_9_17, 0, -1, 0},
307{ 1, s_9_18, 0, -1, 0}
308};
309
310static const unsigned char g_vowel[] = { 17, 65, 16 };
311
312static const unsigned char g_aou[] = { 1, 64, 16 };
313
314static const unsigned char g_digit[] = { 255, 3 };
315
316static int r_canonical_form(struct SN_env * z) {
317 int among_var;
318 int b_foreign;
319 b_foreign = 0;
320 while (1) {
321 int v_1 = z->c;
322 z->bra = z->c;
323 among_var = find_among(z, a_0, 17, 0);
324 z->ket = z->c;
325 switch (among_var) {
326 case 1:
327 {
328 int ret = slice_from_s(z, 2, s_0);
329 if (ret < 0) return ret;
330 }
331 break;
332 case 2:
333 {
334 int ret = slice_from_s(z, 2, s_1);
335 if (ret < 0) return ret;
336 }
337 break;
338 case 3:
339 {
340 int ret = slice_from_s(z, 2, s_2);
341 if (ret < 0) return ret;
342 }
343 break;
344 case 4:
345 {
346 int ret = slice_from_s(z, 2, s_3);
347 if (ret < 0) return ret;
348 }
349 break;
350 case 5:
351 {
352 int ret = slice_from_s(z, 2, s_4);
353 if (ret < 0) return ret;
354 }
355 break;
356 case 6:
357 {
358 int ret = slice_from_s(z, 2, s_5);
359 if (ret < 0) return ret;
360 }
361 break;
362 case 7:
363 {
364 int ret = slice_from_s(z, 1, s_6);
365 if (ret < 0) return ret;
366 }
367 b_foreign = 1;
368 break;
369 case 8:
370 {
371 int ret = slice_from_s(z, 1, s_7);
372 if (ret < 0) return ret;
373 }
374 b_foreign = 1;
375 break;
376 case 9:
377 {
378 int ret = slice_from_s(z, 1, s_8);
379 if (ret < 0) return ret;
380 }
381 b_foreign = 1;
382 break;
383 case 10:
384 {
385 int ret = slice_from_s(z, 1, s_9);
386 if (ret < 0) return ret;
387 }
388 b_foreign = 1;
389 break;
390 case 11:
391 {
392 int ret = slice_from_s(z, 1, s_10);
393 if (ret < 0) return ret;
394 }
395 b_foreign = 1;
396 break;
397 case 12:
398 b_foreign = 1;
399 break;
400 case 13:
401 b_foreign = 0;
402 break;
403 case 14:
404 {
405 int ret = skip_utf8(z->p, z->c, z->l, 1);
406 if (ret < 0) goto lab0;
407 z->c = ret;
408 }
409 break;
410 }
411 continue;
412 lab0:
413 z->c = v_1;
414 break;
415 }
416 return !b_foreign;
417}
418
419static int r_initial_apostrophe(struct SN_env * z) {
420 z->bra = z->c;
421 if (z->c == z->l || z->p[z->c] != '\'') return 0;
422 z->c++;
423 z->ket = z->c;
424 if (!(eq_s(z, 2, s_11))) return 0;
425 if (z->c >= z->l || z->p[z->c + 0] >> 5 != 3 || !((2130434 >> (z->p[z->c + 0] & 0x1f)) & 1)) return 0;
426 if (!find_among(z, a_1, 6, 0)) return 0;
427 if (z->c < z->l) return 0;
428 {
429 int ret = slice_from_s(z, 1, s_12);
430 if (ret < 0) return ret;
431 }
432 return 1;
433}
434
435static int r_pronoun(struct SN_env * z) {
436 z->ket = z->c;
437 {
438 int v_1 = z->l - z->c;
439 if (z->c <= z->lb || z->p[z->c - 1] != 'n') { z->c = z->l - v_1; goto lab0; }
440 z->c--;
441 lab0:
442 ;
443 }
444 z->bra = z->c;
445 if (z->c - 1 <= z->lb || z->p[z->c - 1] != 105) return 0;
446 if (!find_among_b(z, a_2, 17, 0)) return 0;
447 do {
448 int v_2 = z->l - z->c;
449 if (z->c > z->lb) goto lab1;
450 break;
451 lab1:
452 z->c = z->l - v_2;
453 if (z->c <= z->lb || z->p[z->c - 1] != '-') return 0;
454 z->c--;
455 } while (0);
456 {
457 int ret = slice_del(z);
458 if (ret < 0) return ret;
459 }
460 return 1;
461}
462
463static int r_final_apostrophe(struct SN_env * z) {
464 z->ket = z->c;
465 if (z->c <= z->lb || z->p[z->c - 1] != '\'') return 0;
466 z->c--;
467 z->bra = z->c;
468 do {
469 int v_1 = z->l - z->c;
470 if (z->c <= z->lb || z->p[z->c - 1] != 'l') goto lab0;
471 z->c--;
472 if (z->c > z->lb) goto lab0;
473 {
474 int ret = slice_from_s(z, 1, s_13);
475 if (ret < 0) return ret;
476 }
477 break;
478 lab0:
479 z->c = z->l - v_1;
480 if (!(eq_s_b(z, 2, s_14))) goto lab1;
481 if (z->c > z->lb) goto lab1;
482 {
483 int ret = slice_from_s(z, 1, s_15);
484 if (ret < 0) return ret;
485 }
486 break;
487 lab1:
488 z->c = z->l - v_1;
489 if (z->c - 2 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((68438676 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab2;
490 if (!find_among_b(z, a_3, 20, 0)) goto lab2;
491 do {
492 int v_2 = z->l - z->c;
493 if (z->c > z->lb) goto lab3;
494 break;
495 lab3:
496 z->c = z->l - v_2;
497 if (z->c <= z->lb || z->p[z->c - 1] != '-') goto lab2;
498 z->c--;
499 } while (0);
500 {
501 int ret = slice_from_s(z, 3, s_16);
502 if (ret < 0) return ret;
503 }
504 break;
505 lab2:
506 z->c = z->l - v_1;
507 {
508 int ret = slice_from_s(z, 1, s_17);
509 if (ret < 0) return ret;
510 }
511 } while (0);
512 return 1;
513}
514
515static int r_ujn_suffix(struct SN_env * z) {
516 z->ket = z->c;
517 {
518 int v_1 = z->l - z->c;
519 if (z->c <= z->lb || z->p[z->c - 1] != 'n') { z->c = z->l - v_1; goto lab0; }
520 z->c--;
521 lab0:
522 ;
523 }
524 {
525 int v_2 = z->l - z->c;
526 if (z->c <= z->lb || z->p[z->c - 1] != 'j') { z->c = z->l - v_2; goto lab1; }
527 z->c--;
528 lab1:
529 ;
530 }
531 z->bra = z->c;
532 if (z->c - 2 <= z->lb || z->p[z->c - 1] != 117) return 0;
533 if (!find_among_b(z, a_4, 2, 0)) return 0;
534 do {
535 int v_3 = z->l - z->c;
536 if (z->c > z->lb) goto lab2;
537 break;
538 lab2:
539 z->c = z->l - v_3;
540 if (z->c <= z->lb || z->p[z->c - 1] != '-') return 0;
541 z->c--;
542 } while (0);
543 {
544 int ret = slice_del(z);
545 if (ret < 0) return ret;
546 }
547 return 1;
548}
549
550static int r_uninflected(struct SN_env * z) {
551 if (z->c - 2 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((2672162 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
552 if (!find_among_b(z, a_5, 24, 0)) return 0;
553 do {
554 int v_1 = z->l - z->c;
555 if (z->c > z->lb) goto lab0;
556 break;
557 lab0:
558 z->c = z->l - v_1;
559 if (z->c <= z->lb || z->p[z->c - 1] != '-') return 0;
560 z->c--;
561 } while (0);
562 return 1;
563}
564
565static int r_merged_numeral(struct SN_env * z) {
566 if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 105 && z->p[z->c - 1] != 117)) return 0;
567 if (!find_among_b(z, a_6, 3, 0)) return 0;
568 if (z->c - 2 <= z->lb || (z->p[z->c - 1] != 107 && z->p[z->c - 1] != 116)) return 0;
569 return find_among_b(z, a_7, 2, 0) != 0;
570}
571
572static int r_correlative(struct SN_env * z) {
573 z->ket = z->c;
574 z->bra = z->c;
575 {
576 int v_1 = z->l - z->c;
577 do {
578 int v_2 = z->l - z->c;
579 {
580 int v_3 = z->l - z->c;
581 if (z->c <= z->lb || z->p[z->c - 1] != 'n') { z->c = z->l - v_3; goto lab1; }
582 z->c--;
583 lab1:
584 ;
585 }
586 z->bra = z->c;
587 if (z->c <= z->lb || z->p[z->c - 1] != 'e') goto lab0;
588 z->c--;
589 break;
590 lab0:
591 z->c = z->l - v_2;
592 {
593 int v_4 = z->l - z->c;
594 if (z->c <= z->lb || z->p[z->c - 1] != 'n') { z->c = z->l - v_4; goto lab2; }
595 z->c--;
596 lab2:
597 ;
598 }
599 {
600 int v_5 = z->l - z->c;
601 if (z->c <= z->lb || z->p[z->c - 1] != 'j') { z->c = z->l - v_5; goto lab3; }
602 z->c--;
603 lab3:
604 ;
605 }
606 z->bra = z->c;
607 if (in_grouping_b_U(z, g_aou, 97, 117, 0)) return 0;
608 } while (0);
609 if (z->c <= z->lb || z->p[z->c - 1] != 'i') return 0;
610 z->c--;
611 {
612 int v_6 = z->l - z->c;
613 if (!find_among_b(z, a_8, 7, 0)) { z->c = z->l - v_6; goto lab4; }
614 lab4:
615 ;
616 }
617 do {
618 int v_7 = z->l - z->c;
619 if (z->c > z->lb) goto lab5;
620 break;
621 lab5:
622 z->c = z->l - v_7;
623 if (z->c <= z->lb || z->p[z->c - 1] != '-') return 0;
624 z->c--;
625 } while (0);
626 z->c = z->l - v_1;
627 }
628 {
629 int ret = slice_del(z);
630 if (ret < 0) return ret;
631 }
632 return 1;
633}
634
635static int r_long_word(struct SN_env * z) {
636 do {
637 int v_1 = z->l - z->c;
638 {
639 int i; for (i = 2; i > 0; i--) {
640 {
641 int ret = out_grouping_b_U(z, g_vowel, 97, 117, 1);
642 if (ret < 0) goto lab0;
643 z->c -= ret;
644 }
645 }
646 }
647 break;
648 lab0:
649 z->c = z->l - v_1;
650 while (1) {
651 if (z->c <= z->lb || z->p[z->c - 1] != '-') goto lab2;
652 z->c--;
653 break;
654 lab2:
655 {
656 int ret = skip_b_utf8(z->p, z->c, z->lb, 1);
657 if (ret < 0) goto lab1;
658 z->c = ret;
659 }
660 }
661 {
662 int ret = skip_b_utf8(z->p, z->c, z->lb, 1);
663 if (ret < 0) goto lab1;
664 z->c = ret;
665 }
666 break;
667 lab1:
668 z->c = z->l - v_1;
669 {
670 int ret = out_grouping_b_U(z, g_digit, 48, 57, 1);
671 if (ret < 0) return 0;
672 z->c -= ret;
673 }
674 } while (0);
675 return 1;
676}
677
678static int r_standard_suffix(struct SN_env * z) {
679 int among_var;
680 z->ket = z->c;
681 if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((2672162 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
682 among_var = find_among_b(z, a_9, 19, 0);
683 if (!among_var) return 0;
684 switch (among_var) {
685 case 1:
686 {
687 int v_1 = z->l - z->c;
688 do {
689 int v_2 = z->l - z->c;
690 if (z->c <= z->lb || z->p[z->c - 1] != '-') goto lab0;
691 z->c--;
692 break;
693 lab0:
694 z->c = z->l - v_2;
695 if (in_grouping_b_U(z, g_digit, 48, 57, 0)) return 0;
696 } while (0);
697 z->c = z->l - v_1;
698 }
699 break;
700 }
701 {
702 int v_3 = z->l - z->c;
703 if (z->c <= z->lb || z->p[z->c - 1] != '-') { z->c = z->l - v_3; goto lab1; }
704 z->c--;
705 lab1:
706 ;
707 }
708 z->bra = z->c;
709 {
710 int ret = slice_del(z);
711 if (ret < 0) return ret;
712 }
713 return 1;
714}
715
716extern int esperanto_UTF_8_stem(struct SN_env * z) {
717 {
718 int v_1 = z->c;
719 {
720 int ret = r_canonical_form(z);
721 if (ret <= 0) return ret;
722 }
723 z->c = v_1;
724 }
725 {
726 int v_2 = z->c;
727 {
728 int ret = r_initial_apostrophe(z);
729 if (ret < 0) return ret;
730 }
731 z->c = v_2;
732 }
733 z->lb = z->c; z->c = z->l;
734 {
735 int v_3 = z->l - z->c;
736 {
737 int ret = r_pronoun(z);
738 if (ret == 0) goto lab0;
739 if (ret < 0) return ret;
740 }
741 return 0;
742 lab0:
743 z->c = z->l - v_3;
744 }
745 {
746 int v_4 = z->l - z->c;
747 {
748 int ret = r_final_apostrophe(z);
749 if (ret < 0) return ret;
750 }
751 z->c = z->l - v_4;
752 }
753 {
754 int v_5 = z->l - z->c;
755 {
756 int ret = r_correlative(z);
757 if (ret == 0) goto lab1;
758 if (ret < 0) return ret;
759 }
760 return 0;
761 lab1:
762 z->c = z->l - v_5;
763 }
764 {
765 int v_6 = z->l - z->c;
766 {
767 int ret = r_uninflected(z);
768 if (ret == 0) goto lab2;
769 if (ret < 0) return ret;
770 }
771 return 0;
772 lab2:
773 z->c = z->l - v_6;
774 }
775 {
776 int v_7 = z->l - z->c;
777 {
778 int ret = r_merged_numeral(z);
779 if (ret == 0) goto lab3;
780 if (ret < 0) return ret;
781 }
782 return 0;
783 lab3:
784 z->c = z->l - v_7;
785 }
786 {
787 int v_8 = z->l - z->c;
788 {
789 int ret = r_ujn_suffix(z);
790 if (ret == 0) goto lab4;
791 if (ret < 0) return ret;
792 }
793 return 0;
794 lab4:
795 z->c = z->l - v_8;
796 }
797 {
798 int v_9 = z->l - z->c;
799 {
800 int ret = r_long_word(z);
801 if (ret <= 0) return ret;
802 }
803 z->c = z->l - v_9;
804 }
805 {
806 int ret = r_standard_suffix(z);
807 if (ret <= 0) return ret;
808 }
809 z->c = z->lb;
810 return 1;
811}
812
813extern struct SN_env * esperanto_UTF_8_create_env(void) {
814 return SN_new_env(sizeof(struct SN_env));
815}
816
817extern void esperanto_UTF_8_close_env(struct SN_env * z) {
818 SN_delete_env(z);
819}
820
void SN_delete_env(struct SN_env *z)
Definition: api.c:18
struct SN_env * SN_new_env(int alloc_size)
Definition: api.c:5
unsigned char symbol
Definition: api.h:4
int i
Definition: isn.c:77
static const symbol s_2_12[3]
static const symbol s_8_6[2]
static const symbol s_1_5[2]
static const symbol s_2[]
static const symbol s_0_4[2]
static const unsigned char g_aou[]
static const symbol s_5_20[6]
static const symbol s_9_17[2]
static const symbol s_3_2[7]
static const struct among a_3[20]
static const struct among a_6[3]
static const symbol s_2_2[2]
static const symbol s_3_10[5]
static const symbol s_0_5[2]
static const symbol s_4[]
static const struct among a_9[19]
static const symbol s_4_1[3]
static const symbol s_5_16[6]
static const symbol s_3_7[3]
static const symbol s_5_6[4]
static const symbol s_5_22[3]
static const symbol s_0_13[2]
static const symbol s_9_0[1]
static const symbol s_2_9[2]
static const symbol s_5_17[4]
static const symbol s_3_14[10]
static int r_pronoun(struct SN_env *z)
static const symbol s_0_11[1]
static const symbol s_3_17[5]
static const symbol s_0_8[2]
static const symbol s_1_2[2]
static const symbol s_9_6[1]
static const struct among a_7[2]
static int r_standard_suffix(struct SN_env *z)
static int r_merged_numeral(struct SN_env *z)
static int r_correlative(struct SN_env *z)
static const symbol s_2_0[2]
static const symbol s_5_2[8]
static const symbol s_1_3[2]
static const symbol s_9_12[2]
static int r_ujn_suffix(struct SN_env *z)
static const symbol s_1_0[2]
static const symbol s_5_10[5]
static const symbol s_6[]
static const symbol s_0_15[2]
static const symbol s_0_6[1]
static const symbol s_9_15[2]
static const symbol s_7_1[4]
static int r_final_apostrophe(struct SN_env *z)
static const symbol s_1_4[1]
static const symbol s_3[]
static const symbol s_2_15[4]
static const symbol s_5_12[6]
static const symbol s_3_0[3]
static const symbol s_9_10[3]
static const symbol s_9_7[2]
static const symbol s_0_7[2]
static const symbol s_9_18[1]
static const symbol s_0_16[2]
static const symbol s_3_4[8]
static const symbol s_5_19[3]
static const symbol s_5_8[4]
static const symbol s_5_0[3]
static const symbol s_2_11[2]
static const symbol s_7[]
static const symbol s_13[]
static const symbol s_8_2[3]
static int r_uninflected(struct SN_env *z)
static const symbol s_5_18[5]
static const symbol s_6_2[3]
static const symbol s_0_9[1]
static const symbol s_3_6[4]
static int r_long_word(struct SN_env *z)
static const symbol s_2_10[2]
static const symbol s_3_12[4]
static const symbol s_9_14[2]
static const symbol s_7_0[3]
static const symbol s_3_11[5]
static const symbol s_3_9[8]
static const symbol s_2_14[3]
static const symbol s_3_3[4]
static const symbol s_5_23[3]
static const symbol s_8_4[4]
static const symbol s_0_10[1]
static const symbol s_5_4[6]
static const symbol s_2_4[3]
static const symbol s_5_3[4]
static const symbol s_9_9[2]
static const symbol s_5_5[6]
static const symbol s_16[]
static const symbol s_14[]
static const symbol s_3_5[3]
static const symbol s_9_8[2]
static const symbol s_4_0[4]
static const symbol s_5_15[6]
static const symbol s_9_5[2]
static const struct among a_4[2]
static const symbol s_9_1[1]
static const symbol s_2_3[2]
struct SN_env * esperanto_UTF_8_create_env(void)
static const symbol s_2_7[2]
static const symbol s_9_11[3]
static const symbol s_10[]
static const symbol s_1_1[1]
static const symbol s_9_2[1]
static const struct among a_5[24]
static const struct among a_1[6]
static const symbol s_3_19[4]
static const symbol s_1[]
static const symbol s_9_13[1]
static const symbol s_3_1[4]
static const symbol s_0_14[2]
static const symbol s_5_21[5]
static const unsigned char g_digit[]
static const symbol s_9_3[1]
static const struct among a_8[7]
static const symbol s_9_4[2]
static const struct among a_2[17]
static const symbol s_11[]
static const symbol s_12[]
static const symbol s_3_15[5]
static const symbol s_6_1[2]
static const symbol s_3_18[6]
static const symbol s_3_13[4]
static const symbol s_2_8[3]
static const symbol s_5_13[9]
static const symbol s_8_3[1]
static const symbol s_0_1[1]
static const symbol s_6_0[3]
void esperanto_UTF_8_close_env(struct SN_env *z)
static const symbol s_5_11[3]
static const symbol s_5_7[6]
static const symbol s_0_12[2]
static const symbol s_0_2[2]
static const symbol s_17[]
static const symbol s_8_1[4]
static int r_initial_apostrophe(struct SN_env *z)
static const symbol s_2_5[4]
static const symbol s_0_3[2]
static const unsigned char g_vowel[]
static const symbol s_5_14[6]
static const symbol s_2_6[2]
static const symbol s_2_1[2]
static int r_canonical_form(struct SN_env *z)
static const symbol s_3_8[5]
static const symbol s_8_5[4]
static const symbol s_8[]
static const symbol s_9[]
static const struct among a_0[17]
static const symbol s_5[]
static const symbol s_5_9[4]
static const symbol s_8_0[1]
static const symbol s_9_16[2]
static const symbol s_15[]
static const symbol s_3_16[5]
static const symbol s_2_13[3]
static const symbol s_5_1[4]
static const symbol s_2_16[6]
static const symbol s_0[]
int esperanto_UTF_8_stem(struct SN_env *z)
Definition: api.h:15
int lb
Definition: api.h:17
symbol * p
Definition: api.h:16
int ket
Definition: api.h:17
int c
Definition: api.h:17
int bra
Definition: api.h:17
int l
Definition: api.h:17
SNOWBALL_ERR slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:432
int eq_s(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:231
int find_among_b(struct SN_env *z, const struct among *v, int v_size, int(*call_among_func)(struct SN_env *))
Definition: utilities.c:315
int in_grouping_b_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:145
int skip_b_utf8(const symbol *p, int c, int limit, int n)
Definition: utilities.c:68
int eq_s_b(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:236
SNOWBALL_ERR slice_del(struct SN_env *z)
Definition: utilities.c:443
int out_grouping_b_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:169
int skip_utf8(const symbol *p, int c, int limit, int n)
Definition: utilities.c:43
int find_among(struct SN_env *z, const struct among *v, int v_size, int(*call_among_func)(struct SN_env *))
Definition: utilities.c:249