PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
stem_UTF_8_finnish.c
Go to the documentation of this file.
1/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
2
3#include "header.h"
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8extern int finnish_UTF_8_stem(struct SN_env * z);
9#ifdef __cplusplus
10}
11#endif
12static int r_tidy(struct SN_env * z);
13static int r_other_endings(struct SN_env * z);
14static int r_t_plural(struct SN_env * z);
15static int r_i_plural(struct SN_env * z);
16static int r_case_ending(struct SN_env * z);
17static int r_VI(struct SN_env * z);
18static int r_LONG(struct SN_env * z);
19static int r_possessive(struct SN_env * z);
20static int r_particle_etc(struct SN_env * z);
21static int r_R2(struct SN_env * z);
22static int r_mark_regions(struct SN_env * z);
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27
28extern struct SN_env * finnish_UTF_8_create_env(void);
29extern void finnish_UTF_8_close_env(struct SN_env * z);
30
31
32#ifdef __cplusplus
33}
34#endif
35static const symbol s_0_0[2] = { 'p', 'a' };
36static const symbol s_0_1[3] = { 's', 't', 'i' };
37static const symbol s_0_2[4] = { 'k', 'a', 'a', 'n' };
38static const symbol s_0_3[3] = { 'h', 'a', 'n' };
39static const symbol s_0_4[3] = { 'k', 'i', 'n' };
40static const symbol s_0_5[4] = { 'h', 0xC3, 0xA4, 'n' };
41static const symbol s_0_6[6] = { 'k', 0xC3, 0xA4, 0xC3, 0xA4, 'n' };
42static const symbol s_0_7[2] = { 'k', 'o' };
43static const symbol s_0_8[3] = { 'p', 0xC3, 0xA4 };
44static const symbol s_0_9[3] = { 'k', 0xC3, 0xB6 };
45
46static const struct among a_0[10] =
47{
48{ 2, s_0_0, -1, 1, 0},
49{ 3, s_0_1, -1, 2, 0},
50{ 4, s_0_2, -1, 1, 0},
51{ 3, s_0_3, -1, 1, 0},
52{ 3, s_0_4, -1, 1, 0},
53{ 4, s_0_5, -1, 1, 0},
54{ 6, s_0_6, -1, 1, 0},
55{ 2, s_0_7, -1, 1, 0},
56{ 3, s_0_8, -1, 1, 0},
57{ 3, s_0_9, -1, 1, 0}
58};
59
60static const symbol s_1_0[3] = { 'l', 'l', 'a' };
61static const symbol s_1_1[2] = { 'n', 'a' };
62static const symbol s_1_2[3] = { 's', 's', 'a' };
63static const symbol s_1_3[2] = { 't', 'a' };
64static const symbol s_1_4[3] = { 'l', 't', 'a' };
65static const symbol s_1_5[3] = { 's', 't', 'a' };
66
67static const struct among a_1[6] =
68{
69{ 3, s_1_0, -1, -1, 0},
70{ 2, s_1_1, -1, -1, 0},
71{ 3, s_1_2, -1, -1, 0},
72{ 2, s_1_3, -1, -1, 0},
73{ 3, s_1_4, 3, -1, 0},
74{ 3, s_1_5, 3, -1, 0}
75};
76
77static const symbol s_2_0[4] = { 'l', 'l', 0xC3, 0xA4 };
78static const symbol s_2_1[3] = { 'n', 0xC3, 0xA4 };
79static const symbol s_2_2[4] = { 's', 's', 0xC3, 0xA4 };
80static const symbol s_2_3[3] = { 't', 0xC3, 0xA4 };
81static const symbol s_2_4[4] = { 'l', 't', 0xC3, 0xA4 };
82static const symbol s_2_5[4] = { 's', 't', 0xC3, 0xA4 };
83
84static const struct among a_2[6] =
85{
86{ 4, s_2_0, -1, -1, 0},
87{ 3, s_2_1, -1, -1, 0},
88{ 4, s_2_2, -1, -1, 0},
89{ 3, s_2_3, -1, -1, 0},
90{ 4, s_2_4, 3, -1, 0},
91{ 4, s_2_5, 3, -1, 0}
92};
93
94static const symbol s_3_0[3] = { 'l', 'l', 'e' };
95static const symbol s_3_1[3] = { 'i', 'n', 'e' };
96
97static const struct among a_3[2] =
98{
99{ 3, s_3_0, -1, -1, 0},
100{ 3, s_3_1, -1, -1, 0}
101};
102
103static const symbol s_4_0[3] = { 'n', 's', 'a' };
104static const symbol s_4_1[3] = { 'm', 'm', 'e' };
105static const symbol s_4_2[3] = { 'n', 'n', 'e' };
106static const symbol s_4_3[2] = { 'n', 'i' };
107static const symbol s_4_4[2] = { 's', 'i' };
108static const symbol s_4_5[2] = { 'a', 'n' };
109static const symbol s_4_6[2] = { 'e', 'n' };
110static const symbol s_4_7[3] = { 0xC3, 0xA4, 'n' };
111static const symbol s_4_8[4] = { 'n', 's', 0xC3, 0xA4 };
112
113static const struct among a_4[9] =
114{
115{ 3, s_4_0, -1, 3, 0},
116{ 3, s_4_1, -1, 3, 0},
117{ 3, s_4_2, -1, 3, 0},
118{ 2, s_4_3, -1, 2, 0},
119{ 2, s_4_4, -1, 1, 0},
120{ 2, s_4_5, -1, 4, 0},
121{ 2, s_4_6, -1, 6, 0},
122{ 3, s_4_7, -1, 5, 0},
123{ 4, s_4_8, -1, 3, 0}
124};
125
126static const symbol s_5_0[2] = { 'a', 'a' };
127static const symbol s_5_1[2] = { 'e', 'e' };
128static const symbol s_5_2[2] = { 'i', 'i' };
129static const symbol s_5_3[2] = { 'o', 'o' };
130static const symbol s_5_4[2] = { 'u', 'u' };
131static const symbol s_5_5[4] = { 0xC3, 0xA4, 0xC3, 0xA4 };
132static const symbol s_5_6[4] = { 0xC3, 0xB6, 0xC3, 0xB6 };
133
134static const struct among a_5[7] =
135{
136{ 2, s_5_0, -1, -1, 0},
137{ 2, s_5_1, -1, -1, 0},
138{ 2, s_5_2, -1, -1, 0},
139{ 2, s_5_3, -1, -1, 0},
140{ 2, s_5_4, -1, -1, 0},
141{ 4, s_5_5, -1, -1, 0},
142{ 4, s_5_6, -1, -1, 0}
143};
144
145static const symbol s_6_0[1] = { 'a' };
146static const symbol s_6_1[3] = { 'l', 'l', 'a' };
147static const symbol s_6_2[2] = { 'n', 'a' };
148static const symbol s_6_3[3] = { 's', 's', 'a' };
149static const symbol s_6_4[2] = { 't', 'a' };
150static const symbol s_6_5[3] = { 'l', 't', 'a' };
151static const symbol s_6_6[3] = { 's', 't', 'a' };
152static const symbol s_6_7[3] = { 't', 't', 'a' };
153static const symbol s_6_8[3] = { 'l', 'l', 'e' };
154static const symbol s_6_9[3] = { 'i', 'n', 'e' };
155static const symbol s_6_10[3] = { 'k', 's', 'i' };
156static const symbol s_6_11[1] = { 'n' };
157static const symbol s_6_12[3] = { 'h', 'a', 'n' };
158static const symbol s_6_13[3] = { 'd', 'e', 'n' };
159static const symbol s_6_14[4] = { 's', 'e', 'e', 'n' };
160static const symbol s_6_15[3] = { 'h', 'e', 'n' };
161static const symbol s_6_16[4] = { 't', 't', 'e', 'n' };
162static const symbol s_6_17[3] = { 'h', 'i', 'n' };
163static const symbol s_6_18[4] = { 's', 'i', 'i', 'n' };
164static const symbol s_6_19[3] = { 'h', 'o', 'n' };
165static const symbol s_6_20[4] = { 'h', 0xC3, 0xA4, 'n' };
166static const symbol s_6_21[4] = { 'h', 0xC3, 0xB6, 'n' };
167static const symbol s_6_22[2] = { 0xC3, 0xA4 };
168static const symbol s_6_23[4] = { 'l', 'l', 0xC3, 0xA4 };
169static const symbol s_6_24[3] = { 'n', 0xC3, 0xA4 };
170static const symbol s_6_25[4] = { 's', 's', 0xC3, 0xA4 };
171static const symbol s_6_26[3] = { 't', 0xC3, 0xA4 };
172static const symbol s_6_27[4] = { 'l', 't', 0xC3, 0xA4 };
173static const symbol s_6_28[4] = { 's', 't', 0xC3, 0xA4 };
174static const symbol s_6_29[4] = { 't', 't', 0xC3, 0xA4 };
175
176static const struct among a_6[30] =
177{
178{ 1, s_6_0, -1, 8, 0},
179{ 3, s_6_1, 0, -1, 0},
180{ 2, s_6_2, 0, -1, 0},
181{ 3, s_6_3, 0, -1, 0},
182{ 2, s_6_4, 0, -1, 0},
183{ 3, s_6_5, 4, -1, 0},
184{ 3, s_6_6, 4, -1, 0},
185{ 3, s_6_7, 4, 2, 0},
186{ 3, s_6_8, -1, -1, 0},
187{ 3, s_6_9, -1, -1, 0},
188{ 3, s_6_10, -1, -1, 0},
189{ 1, s_6_11, -1, 7, 0},
190{ 3, s_6_12, 11, 1, 0},
191{ 3, s_6_13, 11, -1, r_VI},
192{ 4, s_6_14, 11, -1, r_LONG},
193{ 3, s_6_15, 11, 2, 0},
194{ 4, s_6_16, 11, -1, r_VI},
195{ 3, s_6_17, 11, 3, 0},
196{ 4, s_6_18, 11, -1, r_VI},
197{ 3, s_6_19, 11, 4, 0},
198{ 4, s_6_20, 11, 5, 0},
199{ 4, s_6_21, 11, 6, 0},
200{ 2, s_6_22, -1, 8, 0},
201{ 4, s_6_23, 22, -1, 0},
202{ 3, s_6_24, 22, -1, 0},
203{ 4, s_6_25, 22, -1, 0},
204{ 3, s_6_26, 22, -1, 0},
205{ 4, s_6_27, 26, -1, 0},
206{ 4, s_6_28, 26, -1, 0},
207{ 4, s_6_29, 26, 2, 0}
208};
209
210static const symbol s_7_0[3] = { 'e', 'j', 'a' };
211static const symbol s_7_1[3] = { 'm', 'm', 'a' };
212static const symbol s_7_2[4] = { 'i', 'm', 'm', 'a' };
213static const symbol s_7_3[3] = { 'm', 'p', 'a' };
214static const symbol s_7_4[4] = { 'i', 'm', 'p', 'a' };
215static const symbol s_7_5[3] = { 'm', 'm', 'i' };
216static const symbol s_7_6[4] = { 'i', 'm', 'm', 'i' };
217static const symbol s_7_7[3] = { 'm', 'p', 'i' };
218static const symbol s_7_8[4] = { 'i', 'm', 'p', 'i' };
219static const symbol s_7_9[4] = { 'e', 'j', 0xC3, 0xA4 };
220static const symbol s_7_10[4] = { 'm', 'm', 0xC3, 0xA4 };
221static const symbol s_7_11[5] = { 'i', 'm', 'm', 0xC3, 0xA4 };
222static const symbol s_7_12[4] = { 'm', 'p', 0xC3, 0xA4 };
223static const symbol s_7_13[5] = { 'i', 'm', 'p', 0xC3, 0xA4 };
224
225static const struct among a_7[14] =
226{
227{ 3, s_7_0, -1, -1, 0},
228{ 3, s_7_1, -1, 1, 0},
229{ 4, s_7_2, 1, -1, 0},
230{ 3, s_7_3, -1, 1, 0},
231{ 4, s_7_4, 3, -1, 0},
232{ 3, s_7_5, -1, 1, 0},
233{ 4, s_7_6, 5, -1, 0},
234{ 3, s_7_7, -1, 1, 0},
235{ 4, s_7_8, 7, -1, 0},
236{ 4, s_7_9, -1, -1, 0},
237{ 4, s_7_10, -1, 1, 0},
238{ 5, s_7_11, 10, -1, 0},
239{ 4, s_7_12, -1, 1, 0},
240{ 5, s_7_13, 12, -1, 0}
241};
242
243static const symbol s_8_0[1] = { 'i' };
244static const symbol s_8_1[1] = { 'j' };
245
246static const struct among a_8[2] =
247{
248{ 1, s_8_0, -1, -1, 0},
249{ 1, s_8_1, -1, -1, 0}
250};
251
252static const symbol s_9_0[3] = { 'm', 'm', 'a' };
253static const symbol s_9_1[4] = { 'i', 'm', 'm', 'a' };
254
255static const struct among a_9[2] =
256{
257{ 3, s_9_0, -1, 1, 0},
258{ 4, s_9_1, 0, -1, 0}
259};
260
261static const unsigned char g_AEI[] = { 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8 };
262
263static const unsigned char g_C[] = { 119, 223, 119, 1 };
264
265static const unsigned char g_V1[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
266
267static const unsigned char g_V2[] = { 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
268
269static const unsigned char g_particle_end[] = { 17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
270
271static const symbol s_0[] = { 'k', 's', 'e' };
272static const symbol s_1[] = { 'k', 's', 'i' };
273static const symbol s_2[] = { 0xC3, 0xA4 };
274static const symbol s_3[] = { 0xC3, 0xB6 };
275static const symbol s_4[] = { 'i', 'e' };
276static const symbol s_5[] = { 'p', 'o' };
277static const symbol s_6[] = { 'p', 'o' };
278
279static int r_mark_regions(struct SN_env * z) {
280 z->I[1] = z->l;
281 z->I[0] = z->l;
282
283 if (out_grouping_U(z, g_V1, 97, 246, 1) < 0) return 0;
284
285 {
286 int ret = in_grouping_U(z, g_V1, 97, 246, 1);
287 if (ret < 0) return 0;
288 z->c += ret;
289 }
290 z->I[1] = z->c;
291
292 if (out_grouping_U(z, g_V1, 97, 246, 1) < 0) return 0;
293
294 {
295 int ret = in_grouping_U(z, g_V1, 97, 246, 1);
296 if (ret < 0) return 0;
297 z->c += ret;
298 }
299 z->I[0] = z->c;
300 return 1;
301}
302
303static int r_R2(struct SN_env * z) {
304 return z->I[0] <= z->c;
305}
306
307static int r_particle_etc(struct SN_env * z) {
308 int among_var;
309
310 { int mlimit1;
311 if (z->c < z->I[1]) return 0;
312 mlimit1 = z->lb; z->lb = z->I[1];
313 z->ket = z->c;
314 among_var = find_among_b(z, a_0, 10);
315 if (!among_var) { z->lb = mlimit1; return 0; }
316 z->bra = z->c;
317 z->lb = mlimit1;
318 }
319 switch (among_var) {
320 case 1:
321 if (in_grouping_b_U(z, g_particle_end, 97, 246, 0)) return 0;
322 break;
323 case 2:
324 { int ret = r_R2(z);
325 if (ret <= 0) return ret;
326 }
327 break;
328 }
329 { int ret = slice_del(z);
330 if (ret < 0) return ret;
331 }
332 return 1;
333}
334
335static int r_possessive(struct SN_env * z) {
336 int among_var;
337
338 { int mlimit1;
339 if (z->c < z->I[1]) return 0;
340 mlimit1 = z->lb; z->lb = z->I[1];
341 z->ket = z->c;
342 among_var = find_among_b(z, a_4, 9);
343 if (!among_var) { z->lb = mlimit1; return 0; }
344 z->bra = z->c;
345 z->lb = mlimit1;
346 }
347 switch (among_var) {
348 case 1:
349 { int m2 = z->l - z->c; (void)m2;
350 if (z->c <= z->lb || z->p[z->c - 1] != 'k') goto lab0;
351 z->c--;
352 return 0;
353 lab0:
354 z->c = z->l - m2;
355 }
356 { int ret = slice_del(z);
357 if (ret < 0) return ret;
358 }
359 break;
360 case 2:
361 { int ret = slice_del(z);
362 if (ret < 0) return ret;
363 }
364 z->ket = z->c;
365 if (!(eq_s_b(z, 3, s_0))) return 0;
366 z->bra = z->c;
367 { int ret = slice_from_s(z, 3, s_1);
368 if (ret < 0) return ret;
369 }
370 break;
371 case 3:
372 { int ret = slice_del(z);
373 if (ret < 0) return ret;
374 }
375 break;
376 case 4:
377 if (z->c - 1 <= z->lb || z->p[z->c - 1] != 97) return 0;
378 if (!find_among_b(z, a_1, 6)) return 0;
379 { int ret = slice_del(z);
380 if (ret < 0) return ret;
381 }
382 break;
383 case 5:
384 if (z->c - 2 <= z->lb || z->p[z->c - 1] != 164) return 0;
385 if (!find_among_b(z, a_2, 6)) return 0;
386 { int ret = slice_del(z);
387 if (ret < 0) return ret;
388 }
389 break;
390 case 6:
391 if (z->c - 2 <= z->lb || z->p[z->c - 1] != 101) return 0;
392 if (!find_among_b(z, a_3, 2)) return 0;
393 { int ret = slice_del(z);
394 if (ret < 0) return ret;
395 }
396 break;
397 }
398 return 1;
399}
400
401static int r_LONG(struct SN_env * z) {
402 if (!find_among_b(z, a_5, 7)) return 0;
403 return 1;
404}
405
406static int r_VI(struct SN_env * z) {
407 if (z->c <= z->lb || z->p[z->c - 1] != 'i') return 0;
408 z->c--;
409 if (in_grouping_b_U(z, g_V2, 97, 246, 0)) return 0;
410 return 1;
411}
412
413static int r_case_ending(struct SN_env * z) {
414 int among_var;
415
416 { int mlimit1;
417 if (z->c < z->I[1]) return 0;
418 mlimit1 = z->lb; z->lb = z->I[1];
419 z->ket = z->c;
420 among_var = find_among_b(z, a_6, 30);
421 if (!among_var) { z->lb = mlimit1; return 0; }
422 z->bra = z->c;
423 z->lb = mlimit1;
424 }
425 switch (among_var) {
426 case 1:
427 if (z->c <= z->lb || z->p[z->c - 1] != 'a') return 0;
428 z->c--;
429 break;
430 case 2:
431 if (z->c <= z->lb || z->p[z->c - 1] != 'e') return 0;
432 z->c--;
433 break;
434 case 3:
435 if (z->c <= z->lb || z->p[z->c - 1] != 'i') return 0;
436 z->c--;
437 break;
438 case 4:
439 if (z->c <= z->lb || z->p[z->c - 1] != 'o') return 0;
440 z->c--;
441 break;
442 case 5:
443 if (!(eq_s_b(z, 2, s_2))) return 0;
444 break;
445 case 6:
446 if (!(eq_s_b(z, 2, s_3))) return 0;
447 break;
448 case 7:
449 { int m2 = z->l - z->c; (void)m2;
450 { int m3 = z->l - z->c; (void)m3;
451 { int m4 = z->l - z->c; (void)m4;
452 { int ret = r_LONG(z);
453 if (ret == 0) goto lab2;
454 if (ret < 0) return ret;
455 }
456 goto lab1;
457 lab2:
458 z->c = z->l - m4;
459 if (!(eq_s_b(z, 2, s_4))) { z->c = z->l - m2; goto lab0; }
460 }
461 lab1:
462 z->c = z->l - m3;
463 { int ret = skip_b_utf8(z->p, z->c, z->lb, 1);
464 if (ret < 0) { z->c = z->l - m2; goto lab0; }
465 z->c = ret;
466 }
467 }
468 z->bra = z->c;
469 lab0:
470 ;
471 }
472 break;
473 case 8:
474 if (in_grouping_b_U(z, g_V1, 97, 246, 0)) return 0;
475 if (in_grouping_b_U(z, g_C, 98, 122, 0)) return 0;
476 break;
477 }
478 { int ret = slice_del(z);
479 if (ret < 0) return ret;
480 }
481 z->I[2] = 1;
482 return 1;
483}
484
485static int r_other_endings(struct SN_env * z) {
486 int among_var;
487
488 { int mlimit1;
489 if (z->c < z->I[0]) return 0;
490 mlimit1 = z->lb; z->lb = z->I[0];
491 z->ket = z->c;
492 among_var = find_among_b(z, a_7, 14);
493 if (!among_var) { z->lb = mlimit1; return 0; }
494 z->bra = z->c;
495 z->lb = mlimit1;
496 }
497 switch (among_var) {
498 case 1:
499 { int m2 = z->l - z->c; (void)m2;
500 if (!(eq_s_b(z, 2, s_5))) goto lab0;
501 return 0;
502 lab0:
503 z->c = z->l - m2;
504 }
505 break;
506 }
507 { int ret = slice_del(z);
508 if (ret < 0) return ret;
509 }
510 return 1;
511}
512
513static int r_i_plural(struct SN_env * z) {
514
515 { int mlimit1;
516 if (z->c < z->I[1]) return 0;
517 mlimit1 = z->lb; z->lb = z->I[1];
518 z->ket = z->c;
519 if (z->c <= z->lb || (z->p[z->c - 1] != 105 && z->p[z->c - 1] != 106)) { z->lb = mlimit1; return 0; }
520 if (!find_among_b(z, a_8, 2)) { z->lb = mlimit1; return 0; }
521 z->bra = z->c;
522 z->lb = mlimit1;
523 }
524 { int ret = slice_del(z);
525 if (ret < 0) return ret;
526 }
527 return 1;
528}
529
530static int r_t_plural(struct SN_env * z) {
531 int among_var;
532
533 { int mlimit1;
534 if (z->c < z->I[1]) return 0;
535 mlimit1 = z->lb; z->lb = z->I[1];
536 z->ket = z->c;
537 if (z->c <= z->lb || z->p[z->c - 1] != 't') { z->lb = mlimit1; return 0; }
538 z->c--;
539 z->bra = z->c;
540 { int m_test2 = z->l - z->c;
541 if (in_grouping_b_U(z, g_V1, 97, 246, 0)) { z->lb = mlimit1; return 0; }
542 z->c = z->l - m_test2;
543 }
544 { int ret = slice_del(z);
545 if (ret < 0) return ret;
546 }
547 z->lb = mlimit1;
548 }
549
550 { int mlimit3;
551 if (z->c < z->I[0]) return 0;
552 mlimit3 = z->lb; z->lb = z->I[0];
553 z->ket = z->c;
554 if (z->c - 2 <= z->lb || z->p[z->c - 1] != 97) { z->lb = mlimit3; return 0; }
555 among_var = find_among_b(z, a_9, 2);
556 if (!among_var) { z->lb = mlimit3; return 0; }
557 z->bra = z->c;
558 z->lb = mlimit3;
559 }
560 switch (among_var) {
561 case 1:
562 { int m4 = z->l - z->c; (void)m4;
563 if (!(eq_s_b(z, 2, s_6))) goto lab0;
564 return 0;
565 lab0:
566 z->c = z->l - m4;
567 }
568 break;
569 }
570 { int ret = slice_del(z);
571 if (ret < 0) return ret;
572 }
573 return 1;
574}
575
576static int r_tidy(struct SN_env * z) {
577
578 { int mlimit1;
579 if (z->c < z->I[1]) return 0;
580 mlimit1 = z->lb; z->lb = z->I[1];
581 { int m2 = z->l - z->c; (void)m2;
582 { int m3 = z->l - z->c; (void)m3;
583 { int ret = r_LONG(z);
584 if (ret == 0) goto lab0;
585 if (ret < 0) return ret;
586 }
587 z->c = z->l - m3;
588 z->ket = z->c;
589 { int ret = skip_b_utf8(z->p, z->c, z->lb, 1);
590 if (ret < 0) goto lab0;
591 z->c = ret;
592 }
593 z->bra = z->c;
594 { int ret = slice_del(z);
595 if (ret < 0) return ret;
596 }
597 }
598 lab0:
599 z->c = z->l - m2;
600 }
601 { int m4 = z->l - z->c; (void)m4;
602 z->ket = z->c;
603 if (in_grouping_b_U(z, g_AEI, 97, 228, 0)) goto lab1;
604 z->bra = z->c;
605 if (in_grouping_b_U(z, g_C, 98, 122, 0)) goto lab1;
606 { int ret = slice_del(z);
607 if (ret < 0) return ret;
608 }
609 lab1:
610 z->c = z->l - m4;
611 }
612 { int m5 = z->l - z->c; (void)m5;
613 z->ket = z->c;
614 if (z->c <= z->lb || z->p[z->c - 1] != 'j') goto lab2;
615 z->c--;
616 z->bra = z->c;
617 { int m6 = z->l - z->c; (void)m6;
618 if (z->c <= z->lb || z->p[z->c - 1] != 'o') goto lab4;
619 z->c--;
620 goto lab3;
621 lab4:
622 z->c = z->l - m6;
623 if (z->c <= z->lb || z->p[z->c - 1] != 'u') goto lab2;
624 z->c--;
625 }
626 lab3:
627 { int ret = slice_del(z);
628 if (ret < 0) return ret;
629 }
630 lab2:
631 z->c = z->l - m5;
632 }
633 { int m7 = z->l - z->c; (void)m7;
634 z->ket = z->c;
635 if (z->c <= z->lb || z->p[z->c - 1] != 'o') goto lab5;
636 z->c--;
637 z->bra = z->c;
638 if (z->c <= z->lb || z->p[z->c - 1] != 'j') goto lab5;
639 z->c--;
640 { int ret = slice_del(z);
641 if (ret < 0) return ret;
642 }
643 lab5:
644 z->c = z->l - m7;
645 }
646 z->lb = mlimit1;
647 }
648
649 if (in_grouping_b_U(z, g_V1, 97, 246, 1) < 0) return 0;
650 z->ket = z->c;
651 if (in_grouping_b_U(z, g_C, 98, 122, 0)) return 0;
652 z->bra = z->c;
653 z->S[0] = slice_to(z, z->S[0]);
654 if (z->S[0] == 0) return -1;
655 if (!(eq_v_b(z, z->S[0]))) return 0;
656 { int ret = slice_del(z);
657 if (ret < 0) return ret;
658 }
659 return 1;
660}
661
662extern int finnish_UTF_8_stem(struct SN_env * z) {
663 { int c1 = z->c;
664 { int ret = r_mark_regions(z);
665 if (ret < 0) return ret;
666 }
667 z->c = c1;
668 }
669 z->I[2] = 0;
670 z->lb = z->c; z->c = z->l;
671
672 { int m2 = z->l - z->c; (void)m2;
673 { int ret = r_particle_etc(z);
674 if (ret < 0) return ret;
675 }
676 z->c = z->l - m2;
677 }
678 { int m3 = z->l - z->c; (void)m3;
679 { int ret = r_possessive(z);
680 if (ret < 0) return ret;
681 }
682 z->c = z->l - m3;
683 }
684 { int m4 = z->l - z->c; (void)m4;
685 { int ret = r_case_ending(z);
686 if (ret < 0) return ret;
687 }
688 z->c = z->l - m4;
689 }
690 { int m5 = z->l - z->c; (void)m5;
691 { int ret = r_other_endings(z);
692 if (ret < 0) return ret;
693 }
694 z->c = z->l - m5;
695 }
696
697 if (!(z->I[2])) goto lab1;
698 { int m6 = z->l - z->c; (void)m6;
699 { int ret = r_i_plural(z);
700 if (ret < 0) return ret;
701 }
702 z->c = z->l - m6;
703 }
704 goto lab0;
705lab1:
706 { int m7 = z->l - z->c; (void)m7;
707 { int ret = r_t_plural(z);
708 if (ret < 0) return ret;
709 }
710 z->c = z->l - m7;
711 }
712lab0:
713 { int m8 = z->l - z->c; (void)m8;
714 { int ret = r_tidy(z);
715 if (ret < 0) return ret;
716 }
717 z->c = z->l - m8;
718 }
719 z->c = z->lb;
720 return 1;
721}
722
723extern struct SN_env * finnish_UTF_8_create_env(void) { return SN_create_env(1, 3); }
724
725extern void finnish_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 1); }
726
void SN_close_env(struct SN_env *z, int S_size)
Definition: api.c:34
struct SN_env * SN_create_env(int S_size, int I_size)
Definition: api.c:3
unsigned char symbol
Definition: api.h:2
struct SN_env * finnish_UTF_8_create_env(void)
static const symbol s_0_2[4]
static int r_case_ending(struct SN_env *z)
static const symbol s_2[]
static const unsigned char g_C[]
static const symbol s_6_24[3]
static const struct among a_3[2]
static const symbol s_6_21[4]
static const symbol s_4[]
static const symbol s_8_1[1]
static const symbol s_7_13[5]
static const struct among a_7[14]
static const unsigned char g_V1[]
static const symbol s_4_1[3]
static const symbol s_5_6[4]
static const symbol s_1_5[3]
static const symbol s_7_7[3]
static const symbol s_6_17[3]
static const symbol s_0_3[3]
static const symbol s_9_0[3]
static const symbol s_5_3[2]
static const unsigned char g_particle_end[]
static const symbol s_6_1[3]
static const struct among a_5[7]
static const symbol s_5_0[2]
static const symbol s_2_3[3]
static int r_tidy(struct SN_env *z)
static const struct among a_2[6]
static const symbol s_6_15[3]
static const symbol s_1_3[2]
static const symbol s_2_1[3]
static const symbol s_6_12[3]
static const symbol s_6[]
static const symbol s_0_0[2]
static const symbol s_0_5[4]
static const symbol s_6_20[4]
static const symbol s_6_29[4]
static const symbol s_3[]
static const symbol s_2_2[4]
static const symbol s_4_6[2]
static const symbol s_6_6[3]
static const symbol s_3_0[3]
static const symbol s_4_4[2]
static const symbol s_7_1[3]
static const symbol s_0_7[2]
static const symbol s_2_4[4]
static const symbol s_7_12[4]
static const symbol s_7_9[4]
static const symbol s_6_5[3]
static int r_R2(struct SN_env *z)
static const symbol s_7_6[4]
static const symbol s_6_4[2]
static const symbol s_0_8[3]
static const symbol s_6_19[3]
static const symbol s_6_10[3]
static const symbol s_7_5[3]
static const symbol s_6_27[4]
static const symbol s_3_1[3]
static const symbol s_6_13[3]
static const symbol s_1_1[2]
static const symbol s_7_8[4]
static const symbol s_6_18[4]
static const symbol s_6_9[3]
static int r_other_endings(struct SN_env *z)
static int r_t_plural(struct SN_env *z)
static const unsigned char g_V2[]
static const symbol s_7_0[3]
static const symbol s_0_1[3]
static const symbol s_6_2[2]
static int r_VI(struct SN_env *z)
int finnish_UTF_8_stem(struct SN_env *z)
static const symbol s_6_7[3]
static const struct among a_4[9]
static const symbol s_5_4[2]
static const symbol s_6_22[2]
static int r_LONG(struct SN_env *z)
static const symbol s_6_16[4]
static const symbol s_0_9[3]
static const symbol s_7_2[4]
static const struct among a_6[30]
static int r_i_plural(struct SN_env *z)
static const symbol s_6_11[1]
static const symbol s_7_4[4]
static const struct among a_1[6]
static const symbol s_1[]
static const symbol s_5_5[4]
static const symbol s_9_1[4]
static const symbol s_1_2[3]
static const symbol s_6_8[3]
static const symbol s_5_2[2]
static const struct among a_9[2]
static int r_possessive(struct SN_env *z)
static const symbol s_6_14[4]
static int r_mark_regions(struct SN_env *z)
static const symbol s_7_3[3]
static const unsigned char g_AEI[]
static const symbol s_2_0[4]
static const symbol s_6_23[4]
static const symbol s_1_0[3]
static const symbol s_6_0[1]
static const symbol s_6_3[3]
static const symbol s_0_6[6]
static const struct among a_0[10]
static const symbol s_4_3[2]
static const symbol s_4_8[4]
static const symbol s_5_1[2]
static const symbol s_1_4[3]
static const symbol s_6_25[4]
static const symbol s_6_26[3]
static const symbol s_2_5[4]
static int r_particle_etc(struct SN_env *z)
void finnish_UTF_8_close_env(struct SN_env *z)
static const symbol s_6_28[4]
static const symbol s_7_10[4]
static const symbol s_4_7[3]
static const symbol s_5[]
static const symbol s_8_0[1]
static const symbol s_4_2[3]
static const symbol s_4_0[3]
static const symbol s_7_11[5]
static const symbol s_4_5[2]
static const symbol s_0[]
static const struct among a_8[2]
static const symbol s_0_4[3]
Definition: api.h:14
int lb
Definition: api.h:16
symbol * p
Definition: api.h:15
int * I
Definition: api.h:18
int ket
Definition: api.h:16
int c
Definition: api.h:16
int bra
Definition: api.h:16
int l
Definition: api.h:16
symbol ** S
Definition: api.h:17
Definition: header.h:16
int find_among_b(struct SN_env *z, const struct among *v, int v_size)
Definition: utilities.c:298
int out_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:141
int slice_del(struct SN_env *z)
Definition: utilities.c:431
int in_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:117
int eq_v_b(struct SN_env *z, const symbol *p)
Definition: utilities.c:229
int in_grouping_b_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:129
int skip_b_utf8(const symbol *p, int c, int limit, int n)
Definition: utilities.c:52
int eq_s_b(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:220
symbol * slice_to(struct SN_env *z, symbol *p)
Definition: utilities.c:448
int slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:422