YAZ 5.35.1
stem_UTF_8_finnish.c
Go to the documentation of this file.
1
2/* This file was generated automatically by the Snowball to ANSI C compiler */
3
4#include "../runtime/header.h"
5
6#ifdef __cplusplus
7extern "C"
8{
9#endif
10 extern int finnish_UTF_8_stem (struct SN_env *z);
11#ifdef __cplusplus
12}
13#endif
14static int r_tidy (struct SN_env *z);
15static int r_other_endings (struct SN_env *z);
16static int r_t_plural (struct SN_env *z);
17static int r_i_plural (struct SN_env *z);
18static int r_case_ending (struct SN_env *z);
19static int r_VI (struct SN_env *z);
20static int r_LONG (struct SN_env *z);
21static int r_possessive (struct SN_env *z);
22static int r_particle_etc (struct SN_env *z);
23static int r_R2 (struct SN_env *z);
24static int r_mark_regions (struct SN_env *z);
25#ifdef __cplusplus
26extern "C"
27{
28#endif
29
30
31 extern struct SN_env *finnish_UTF_8_create_env (void);
32 extern void finnish_UTF_8_close_env (struct SN_env *z);
33
34
35#ifdef __cplusplus
36}
37#endif
38static const symbol s_0_0[2] = { 'p', 'a' };
39static const symbol s_0_1[3] = { 's', 't', 'i' };
40static const symbol s_0_2[4] = { 'k', 'a', 'a', 'n' };
41static const symbol s_0_3[3] = { 'h', 'a', 'n' };
42static const symbol s_0_4[3] = { 'k', 'i', 'n' };
43static const symbol s_0_5[4] = { 'h', 0xC3, 0xA4, 'n' };
44static const symbol s_0_6[6] = { 'k', 0xC3, 0xA4, 0xC3, 0xA4, 'n' };
45static const symbol s_0_7[2] = { 'k', 'o' };
46static const symbol s_0_8[3] = { 'p', 0xC3, 0xA4 };
47static const symbol s_0_9[3] = { 'k', 0xC3, 0xB6 };
48
49static const struct among a_0[10] = {
50/* 0 */ {2, s_0_0, -1, 1, 0},
51/* 1 */ {3, s_0_1, -1, 2, 0},
52/* 2 */ {4, s_0_2, -1, 1, 0},
53/* 3 */ {3, s_0_3, -1, 1, 0},
54/* 4 */ {3, s_0_4, -1, 1, 0},
55/* 5 */ {4, s_0_5, -1, 1, 0},
56/* 6 */ {6, s_0_6, -1, 1, 0},
57/* 7 */ {2, s_0_7, -1, 1, 0},
58/* 8 */ {3, s_0_8, -1, 1, 0},
59/* 9 */ {3, s_0_9, -1, 1, 0}
60};
61
62static const symbol s_1_0[3] = { 'l', 'l', 'a' };
63static const symbol s_1_1[2] = { 'n', 'a' };
64static const symbol s_1_2[3] = { 's', 's', 'a' };
65static const symbol s_1_3[2] = { 't', 'a' };
66static const symbol s_1_4[3] = { 'l', 't', 'a' };
67static const symbol s_1_5[3] = { 's', 't', 'a' };
68
69static const struct among a_1[6] = {
70/* 0 */ {3, s_1_0, -1, -1, 0},
71/* 1 */ {2, s_1_1, -1, -1, 0},
72/* 2 */ {3, s_1_2, -1, -1, 0},
73/* 3 */ {2, s_1_3, -1, -1, 0},
74/* 4 */ {3, s_1_4, 3, -1, 0},
75/* 5 */ {3, s_1_5, 3, -1, 0}
76};
77
78static const symbol s_2_0[4] = { 'l', 'l', 0xC3, 0xA4 };
79static const symbol s_2_1[3] = { 'n', 0xC3, 0xA4 };
80static const symbol s_2_2[4] = { 's', 's', 0xC3, 0xA4 };
81static const symbol s_2_3[3] = { 't', 0xC3, 0xA4 };
82static const symbol s_2_4[4] = { 'l', 't', 0xC3, 0xA4 };
83static const symbol s_2_5[4] = { 's', 't', 0xC3, 0xA4 };
84
85static const struct among a_2[6] = {
86/* 0 */ {4, s_2_0, -1, -1, 0},
87/* 1 */ {3, s_2_1, -1, -1, 0},
88/* 2 */ {4, s_2_2, -1, -1, 0},
89/* 3 */ {3, s_2_3, -1, -1, 0},
90/* 4 */ {4, s_2_4, 3, -1, 0},
91/* 5 */ {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/* 0 */ {3, s_3_0, -1, -1, 0},
99/* 1 */ {3, s_3_1, -1, -1, 0}
100};
101
102static const symbol s_4_0[3] = { 'n', 's', 'a' };
103static const symbol s_4_1[3] = { 'm', 'm', 'e' };
104static const symbol s_4_2[3] = { 'n', 'n', 'e' };
105static const symbol s_4_3[2] = { 'n', 'i' };
106static const symbol s_4_4[2] = { 's', 'i' };
107static const symbol s_4_5[2] = { 'a', 'n' };
108static const symbol s_4_6[2] = { 'e', 'n' };
109static const symbol s_4_7[3] = { 0xC3, 0xA4, 'n' };
110static const symbol s_4_8[4] = { 'n', 's', 0xC3, 0xA4 };
111
112static const struct among a_4[9] = {
113/* 0 */ {3, s_4_0, -1, 3, 0},
114/* 1 */ {3, s_4_1, -1, 3, 0},
115/* 2 */ {3, s_4_2, -1, 3, 0},
116/* 3 */ {2, s_4_3, -1, 2, 0},
117/* 4 */ {2, s_4_4, -1, 1, 0},
118/* 5 */ {2, s_4_5, -1, 4, 0},
119/* 6 */ {2, s_4_6, -1, 6, 0},
120/* 7 */ {3, s_4_7, -1, 5, 0},
121/* 8 */ {4, s_4_8, -1, 3, 0}
122};
123
124static const symbol s_5_0[2] = { 'a', 'a' };
125static const symbol s_5_1[2] = { 'e', 'e' };
126static const symbol s_5_2[2] = { 'i', 'i' };
127static const symbol s_5_3[2] = { 'o', 'o' };
128static const symbol s_5_4[2] = { 'u', 'u' };
129static const symbol s_5_5[4] = { 0xC3, 0xA4, 0xC3, 0xA4 };
130static const symbol s_5_6[4] = { 0xC3, 0xB6, 0xC3, 0xB6 };
131
132static const struct among a_5[7] = {
133/* 0 */ {2, s_5_0, -1, -1, 0},
134/* 1 */ {2, s_5_1, -1, -1, 0},
135/* 2 */ {2, s_5_2, -1, -1, 0},
136/* 3 */ {2, s_5_3, -1, -1, 0},
137/* 4 */ {2, s_5_4, -1, -1, 0},
138/* 5 */ {4, s_5_5, -1, -1, 0},
139/* 6 */ {4, s_5_6, -1, -1, 0}
140};
141
142static const symbol s_6_0[1] = { 'a' };
143static const symbol s_6_1[3] = { 'l', 'l', 'a' };
144static const symbol s_6_2[2] = { 'n', 'a' };
145static const symbol s_6_3[3] = { 's', 's', 'a' };
146static const symbol s_6_4[2] = { 't', 'a' };
147static const symbol s_6_5[3] = { 'l', 't', 'a' };
148static const symbol s_6_6[3] = { 's', 't', 'a' };
149static const symbol s_6_7[3] = { 't', 't', 'a' };
150static const symbol s_6_8[3] = { 'l', 'l', 'e' };
151static const symbol s_6_9[3] = { 'i', 'n', 'e' };
152static const symbol s_6_10[3] = { 'k', 's', 'i' };
153static const symbol s_6_11[1] = { 'n' };
154static const symbol s_6_12[3] = { 'h', 'a', 'n' };
155static const symbol s_6_13[3] = { 'd', 'e', 'n' };
156static const symbol s_6_14[4] = { 's', 'e', 'e', 'n' };
157static const symbol s_6_15[3] = { 'h', 'e', 'n' };
158static const symbol s_6_16[4] = { 't', 't', 'e', 'n' };
159static const symbol s_6_17[3] = { 'h', 'i', 'n' };
160static const symbol s_6_18[4] = { 's', 'i', 'i', 'n' };
161static const symbol s_6_19[3] = { 'h', 'o', 'n' };
162static const symbol s_6_20[4] = { 'h', 0xC3, 0xA4, 'n' };
163static const symbol s_6_21[4] = { 'h', 0xC3, 0xB6, 'n' };
164static const symbol s_6_22[2] = { 0xC3, 0xA4 };
165static const symbol s_6_23[4] = { 'l', 'l', 0xC3, 0xA4 };
166static const symbol s_6_24[3] = { 'n', 0xC3, 0xA4 };
167static const symbol s_6_25[4] = { 's', 's', 0xC3, 0xA4 };
168static const symbol s_6_26[3] = { 't', 0xC3, 0xA4 };
169static const symbol s_6_27[4] = { 'l', 't', 0xC3, 0xA4 };
170static const symbol s_6_28[4] = { 's', 't', 0xC3, 0xA4 };
171static const symbol s_6_29[4] = { 't', 't', 0xC3, 0xA4 };
172
173static const struct among a_6[30] = {
174/* 0 */ {1, s_6_0, -1, 8, 0},
175/* 1 */ {3, s_6_1, 0, -1, 0},
176/* 2 */ {2, s_6_2, 0, -1, 0},
177/* 3 */ {3, s_6_3, 0, -1, 0},
178/* 4 */ {2, s_6_4, 0, -1, 0},
179/* 5 */ {3, s_6_5, 4, -1, 0},
180/* 6 */ {3, s_6_6, 4, -1, 0},
181/* 7 */ {3, s_6_7, 4, 9, 0},
182/* 8 */ {3, s_6_8, -1, -1, 0},
183/* 9 */ {3, s_6_9, -1, -1, 0},
184/* 10 */ {3, s_6_10, -1, -1, 0},
185/* 11 */ {1, s_6_11, -1, 7, 0},
186/* 12 */ {3, s_6_12, 11, 1, 0},
187/* 13 */ {3, s_6_13, 11, -1, r_VI},
188/* 14 */ {4, s_6_14, 11, -1, r_LONG},
189/* 15 */ {3, s_6_15, 11, 2, 0},
190/* 16 */ {4, s_6_16, 11, -1, r_VI},
191/* 17 */ {3, s_6_17, 11, 3, 0},
192/* 18 */ {4, s_6_18, 11, -1, r_VI},
193/* 19 */ {3, s_6_19, 11, 4, 0},
194/* 20 */ {4, s_6_20, 11, 5, 0},
195/* 21 */ {4, s_6_21, 11, 6, 0},
196/* 22 */ {2, s_6_22, -1, 8, 0},
197/* 23 */ {4, s_6_23, 22, -1, 0},
198/* 24 */ {3, s_6_24, 22, -1, 0},
199/* 25 */ {4, s_6_25, 22, -1, 0},
200/* 26 */ {3, s_6_26, 22, -1, 0},
201/* 27 */ {4, s_6_27, 26, -1, 0},
202/* 28 */ {4, s_6_28, 26, -1, 0},
203/* 29 */ {4, s_6_29, 26, 9, 0}
204};
205
206static const symbol s_7_0[3] = { 'e', 'j', 'a' };
207static const symbol s_7_1[3] = { 'm', 'm', 'a' };
208static const symbol s_7_2[4] = { 'i', 'm', 'm', 'a' };
209static const symbol s_7_3[3] = { 'm', 'p', 'a' };
210static const symbol s_7_4[4] = { 'i', 'm', 'p', 'a' };
211static const symbol s_7_5[3] = { 'm', 'm', 'i' };
212static const symbol s_7_6[4] = { 'i', 'm', 'm', 'i' };
213static const symbol s_7_7[3] = { 'm', 'p', 'i' };
214static const symbol s_7_8[4] = { 'i', 'm', 'p', 'i' };
215static const symbol s_7_9[4] = { 'e', 'j', 0xC3, 0xA4 };
216static const symbol s_7_10[4] = { 'm', 'm', 0xC3, 0xA4 };
217static const symbol s_7_11[5] = { 'i', 'm', 'm', 0xC3, 0xA4 };
218static const symbol s_7_12[4] = { 'm', 'p', 0xC3, 0xA4 };
219static const symbol s_7_13[5] = { 'i', 'm', 'p', 0xC3, 0xA4 };
220
221static const struct among a_7[14] = {
222/* 0 */ {3, s_7_0, -1, -1, 0},
223/* 1 */ {3, s_7_1, -1, 1, 0},
224/* 2 */ {4, s_7_2, 1, -1, 0},
225/* 3 */ {3, s_7_3, -1, 1, 0},
226/* 4 */ {4, s_7_4, 3, -1, 0},
227/* 5 */ {3, s_7_5, -1, 1, 0},
228/* 6 */ {4, s_7_6, 5, -1, 0},
229/* 7 */ {3, s_7_7, -1, 1, 0},
230/* 8 */ {4, s_7_8, 7, -1, 0},
231/* 9 */ {4, s_7_9, -1, -1, 0},
232/* 10 */ {4, s_7_10, -1, 1, 0},
233/* 11 */ {5, s_7_11, 10, -1, 0},
234/* 12 */ {4, s_7_12, -1, 1, 0},
235/* 13 */ {5, s_7_13, 12, -1, 0}
236};
237
238static const symbol s_8_0[1] = { 'i' };
239static const symbol s_8_1[1] = { 'j' };
240
241static const struct among a_8[2] = {
242/* 0 */ {1, s_8_0, -1, -1, 0},
243/* 1 */ {1, s_8_1, -1, -1, 0}
244};
245
246static const symbol s_9_0[3] = { 'm', 'm', 'a' };
247static const symbol s_9_1[4] = { 'i', 'm', 'm', 'a' };
248
249static const struct among a_9[2] = {
250/* 0 */ {3, s_9_0, -1, 1, 0},
251/* 1 */ {4, s_9_1, 0, -1, 0}
252};
253
254static const unsigned char g_AEI[] =
255 { 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8 };
256
257static const unsigned char g_V1[] =
258 { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
259
260static const unsigned char g_V2[] =
261 { 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
262
263static const unsigned char g_particle_end[] =
264 { 17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
265
266static const symbol s_0[] = { 'k' };
267static const symbol s_1[] = { 'k', 's', 'e' };
268static const symbol s_2[] = { 'k', 's', 'i' };
269static const symbol s_3[] = { 'i' };
270static const symbol s_4[] = { 'a' };
271static const symbol s_5[] = { 'e' };
272static const symbol s_6[] = { 'i' };
273static const symbol s_7[] = { 'o' };
274static const symbol s_8[] = { 0xC3, 0xA4 };
275static const symbol s_9[] = { 0xC3, 0xB6 };
276static const symbol s_10[] = { 'i', 'e' };
277static const symbol s_11[] = { 'e' };
278static const symbol s_12[] = { 'p', 'o' };
279static const symbol s_13[] = { 't' };
280static const symbol s_14[] = { 'p', 'o' };
281static const symbol s_15[] = { 'j' };
282static const symbol s_16[] = { 'o' };
283static const symbol s_17[] = { 'u' };
284static const symbol s_18[] = { 'o' };
285static const symbol s_19[] = { 'j' };
286
287static int
289{
290 z->I[0] = z->l;
291 z->I[1] = z->l;
292 if (out_grouping_U (z, g_V1, 97, 246, 1) < 0)
293 return 0; /* goto *//* grouping V1, line 46 */
294 { /* gopast *//* non V1, line 46 */
295 int ret = in_grouping_U (z, g_V1, 97, 246, 1);
296 if (ret < 0)
297 return 0;
298 z->c += ret;
299 }
300 z->I[0] = z->c; /* setmark p1, line 46 */
301 if (out_grouping_U (z, g_V1, 97, 246, 1) < 0)
302 return 0; /* goto *//* grouping V1, line 47 */
303 { /* gopast *//* non V1, line 47 */
304 int ret = in_grouping_U (z, g_V1, 97, 246, 1);
305 if (ret < 0)
306 return 0;
307 z->c += ret;
308 }
309 z->I[1] = z->c; /* setmark p2, line 47 */
310 return 1;
311}
312
313static int
314r_R2 (struct SN_env *z)
315{
316 if (!(z->I[1] <= z->c))
317 return 0;
318 return 1;
319}
320
321static int
323{
324 int among_var;
325 {
326 int mlimit; /* setlimit, line 55 */
327 int m1 = z->l - z->c;
328 (void) m1;
329 if (z->c < z->I[0])
330 return 0;
331 z->c = z->I[0]; /* tomark, line 55 */
332 mlimit = z->lb;
333 z->lb = z->c;
334 z->c = z->l - m1;
335 z->ket = z->c; /* [, line 55 */
336 among_var = find_among_b (z, a_0, 10); /* substring, line 55 */
337 if (!(among_var))
338 {
339 z->lb = mlimit;
340 return 0;
341 }
342 z->bra = z->c; /* ], line 55 */
343 z->lb = mlimit;
344 }
345 switch (among_var)
346 {
347 case 0:
348 return 0;
349 case 1:
350 if (in_grouping_b_U (z, g_particle_end, 97, 246, 0))
351 return 0;
352 break;
353 case 2:
354 {
355 int ret = r_R2 (z);
356 if (ret == 0)
357 return 0; /* call R2, line 64 */
358 if (ret < 0)
359 return ret;
360 }
361 break;
362 }
363 {
364 int ret = slice_del (z); /* delete, line 66 */
365 if (ret < 0)
366 return ret;
367 }
368 return 1;
369}
370
371static int
373{
374 int among_var;
375 {
376 int mlimit; /* setlimit, line 69 */
377 int m1 = z->l - z->c;
378 (void) m1;
379 if (z->c < z->I[0])
380 return 0;
381 z->c = z->I[0]; /* tomark, line 69 */
382 mlimit = z->lb;
383 z->lb = z->c;
384 z->c = z->l - m1;
385 z->ket = z->c; /* [, line 69 */
386 among_var = find_among_b (z, a_4, 9); /* substring, line 69 */
387 if (!(among_var))
388 {
389 z->lb = mlimit;
390 return 0;
391 }
392 z->bra = z->c; /* ], line 69 */
393 z->lb = mlimit;
394 }
395 switch (among_var)
396 {
397 case 0:
398 return 0;
399 case 1:
400 {
401 int m2 = z->l - z->c;
402 (void) m2; /* not, line 72 */
403 if (!(eq_s_b (z, 1, s_0)))
404 goto lab0;
405 return 0;
406 lab0:
407 z->c = z->l - m2;
408 }
409 {
410 int ret = slice_del (z); /* delete, line 72 */
411 if (ret < 0)
412 return ret;
413 }
414 break;
415 case 2:
416 {
417 int ret = slice_del (z); /* delete, line 74 */
418 if (ret < 0)
419 return ret;
420 }
421 z->ket = z->c; /* [, line 74 */
422 if (!(eq_s_b (z, 3, s_1)))
423 return 0;
424 z->bra = z->c; /* ], line 74 */
425 {
426 int ret = slice_from_s (z, 3, s_2); /* <-, line 74 */
427 if (ret < 0)
428 return ret;
429 }
430 break;
431 case 3:
432 {
433 int ret = slice_del (z); /* delete, line 78 */
434 if (ret < 0)
435 return ret;
436 }
437 break;
438 case 4:
439 if (z->c - 1 <= z->lb || z->p[z->c - 1] != 97)
440 return 0;
441 if (!(find_among_b (z, a_1, 6)))
442 return 0; /* among, line 81 */
443 {
444 int ret = slice_del (z); /* delete, line 81 */
445 if (ret < 0)
446 return ret;
447 }
448 break;
449 case 5:
450 if (z->c - 2 <= z->lb || z->p[z->c - 1] != 164)
451 return 0;
452 if (!(find_among_b (z, a_2, 6)))
453 return 0; /* among, line 83 */
454 {
455 int ret = slice_del (z); /* delete, line 84 */
456 if (ret < 0)
457 return ret;
458 }
459 break;
460 case 6:
461 if (z->c - 2 <= z->lb || z->p[z->c - 1] != 101)
462 return 0;
463 if (!(find_among_b (z, a_3, 2)))
464 return 0; /* among, line 86 */
465 {
466 int ret = slice_del (z); /* delete, line 86 */
467 if (ret < 0)
468 return ret;
469 }
470 break;
471 }
472 return 1;
473}
474
475static int
476r_LONG (struct SN_env *z)
477{
478 if (!(find_among_b (z, a_5, 7)))
479 return 0; /* among, line 91 */
480 return 1;
481}
482
483static int
484r_VI (struct SN_env *z)
485{
486 if (!(eq_s_b (z, 1, s_3)))
487 return 0;
488 if (in_grouping_b_U (z, g_V2, 97, 246, 0))
489 return 0;
490 return 1;
491}
492
493static int
495{
496 int among_var;
497 {
498 int mlimit; /* setlimit, line 96 */
499 int m1 = z->l - z->c;
500 (void) m1;
501 if (z->c < z->I[0])
502 return 0;
503 z->c = z->I[0]; /* tomark, line 96 */
504 mlimit = z->lb;
505 z->lb = z->c;
506 z->c = z->l - m1;
507 z->ket = z->c; /* [, line 96 */
508 among_var = find_among_b (z, a_6, 30); /* substring, line 96 */
509 if (!(among_var))
510 {
511 z->lb = mlimit;
512 return 0;
513 }
514 z->bra = z->c; /* ], line 96 */
515 z->lb = mlimit;
516 }
517 switch (among_var)
518 {
519 case 0:
520 return 0;
521 case 1:
522 if (!(eq_s_b (z, 1, s_4)))
523 return 0;
524 break;
525 case 2:
526 if (!(eq_s_b (z, 1, s_5)))
527 return 0;
528 break;
529 case 3:
530 if (!(eq_s_b (z, 1, s_6)))
531 return 0;
532 break;
533 case 4:
534 if (!(eq_s_b (z, 1, s_7)))
535 return 0;
536 break;
537 case 5:
538 if (!(eq_s_b (z, 2, s_8)))
539 return 0;
540 break;
541 case 6:
542 if (!(eq_s_b (z, 2, s_9)))
543 return 0;
544 break;
545 case 7:
546 {
547 int m_keep = z->l - z->c; /* (void) m_keep; *//* try, line 111 */
548 {
549 int m2 = z->l - z->c;
550 (void) m2; /* and, line 113 */
551 {
552 int m3 = z->l - z->c;
553 (void) m3; /* or, line 112 */
554 {
555 int ret = r_LONG (z);
556 if (ret == 0)
557 goto lab2; /* call LONG, line 111 */
558 if (ret < 0)
559 return ret;
560 }
561 goto lab1;
562 lab2:
563 z->c = z->l - m3;
564 if (!(eq_s_b (z, 2, s_10)))
565 {
566 z->c = z->l - m_keep;
567 goto lab0;
568 }
569 }
570 lab1:
571 z->c = z->l - m2;
572 {
573 int ret = skip_utf8 (z->p, z->c, z->lb, 0, -1);
574 if (ret < 0)
575 {
576 z->c = z->l - m_keep;
577 goto lab0;
578 }
579 z->c = ret; /* next, line 113 */
580 }
581 }
582 z->bra = z->c; /* ], line 113 */
583 lab0:
584 ;
585 }
586 break;
587 case 8:
588 if (in_grouping_b_U (z, g_V1, 97, 246, 0))
589 return 0;
590 if (out_grouping_b_U (z, g_V1, 97, 246, 0))
591 return 0;
592 break;
593 case 9:
594 if (!(eq_s_b (z, 1, s_11)))
595 return 0;
596 break;
597 }
598 {
599 int ret = slice_del (z); /* delete, line 138 */
600 if (ret < 0)
601 return ret;
602 }
603 z->B[0] = 1; /* set ending_removed, line 139 */
604 return 1;
605}
606
607static int
609{
610 int among_var;
611 {
612 int mlimit; /* setlimit, line 142 */
613 int m1 = z->l - z->c;
614 (void) m1;
615 if (z->c < z->I[1])
616 return 0;
617 z->c = z->I[1]; /* tomark, line 142 */
618 mlimit = z->lb;
619 z->lb = z->c;
620 z->c = z->l - m1;
621 z->ket = z->c; /* [, line 142 */
622 among_var = find_among_b (z, a_7, 14); /* substring, line 142 */
623 if (!(among_var))
624 {
625 z->lb = mlimit;
626 return 0;
627 }
628 z->bra = z->c; /* ], line 142 */
629 z->lb = mlimit;
630 }
631 switch (among_var)
632 {
633 case 0:
634 return 0;
635 case 1:
636 {
637 int m2 = z->l - z->c;
638 (void) m2; /* not, line 146 */
639 if (!(eq_s_b (z, 2, s_12)))
640 goto lab0;
641 return 0;
642 lab0:
643 z->c = z->l - m2;
644 }
645 break;
646 }
647 {
648 int ret = slice_del (z); /* delete, line 151 */
649 if (ret < 0)
650 return ret;
651 }
652 return 1;
653}
654
655static int
657{
658 {
659 int mlimit; /* setlimit, line 154 */
660 int m1 = z->l - z->c;
661 (void) m1;
662 if (z->c < z->I[0])
663 return 0;
664 z->c = z->I[0]; /* tomark, line 154 */
665 mlimit = z->lb;
666 z->lb = z->c;
667 z->c = z->l - m1;
668 z->ket = z->c; /* [, line 154 */
669 if (z->c <= z->lb || (z->p[z->c - 1] != 105 && z->p[z->c - 1] != 106))
670 {
671 z->lb = mlimit;
672 return 0;
673 }
674 if (!(find_among_b (z, a_8, 2)))
675 {
676 z->lb = mlimit;
677 return 0;
678 } /* substring, line 154 */
679 z->bra = z->c; /* ], line 154 */
680 z->lb = mlimit;
681 }
682 {
683 int ret = slice_del (z); /* delete, line 158 */
684 if (ret < 0)
685 return ret;
686 }
687 return 1;
688}
689
690static int
692{
693 int among_var;
694 {
695 int mlimit; /* setlimit, line 161 */
696 int m1 = z->l - z->c;
697 (void) m1;
698 if (z->c < z->I[0])
699 return 0;
700 z->c = z->I[0]; /* tomark, line 161 */
701 mlimit = z->lb;
702 z->lb = z->c;
703 z->c = z->l - m1;
704 z->ket = z->c; /* [, line 162 */
705 if (!(eq_s_b (z, 1, s_13)))
706 {
707 z->lb = mlimit;
708 return 0;
709 }
710 z->bra = z->c; /* ], line 162 */
711 {
712 int m_test = z->l - z->c; /* test, line 162 */
713 if (in_grouping_b_U (z, g_V1, 97, 246, 0))
714 {
715 z->lb = mlimit;
716 return 0;
717 }
718 z->c = z->l - m_test;
719 }
720 {
721 int ret = slice_del (z); /* delete, line 163 */
722 if (ret < 0)
723 return ret;
724 }
725 z->lb = mlimit;
726 }
727 {
728 int mlimit; /* setlimit, line 165 */
729 int m2 = z->l - z->c;
730 (void) m2;
731 if (z->c < z->I[1])
732 return 0;
733 z->c = z->I[1]; /* tomark, line 165 */
734 mlimit = z->lb;
735 z->lb = z->c;
736 z->c = z->l - m2;
737 z->ket = z->c; /* [, line 165 */
738 if (z->c - 2 <= z->lb || z->p[z->c - 1] != 97)
739 {
740 z->lb = mlimit;
741 return 0;
742 }
743 among_var = find_among_b (z, a_9, 2); /* substring, line 165 */
744 if (!(among_var))
745 {
746 z->lb = mlimit;
747 return 0;
748 }
749 z->bra = z->c; /* ], line 165 */
750 z->lb = mlimit;
751 }
752 switch (among_var)
753 {
754 case 0:
755 return 0;
756 case 1:
757 {
758 int m3 = z->l - z->c;
759 (void) m3; /* not, line 167 */
760 if (!(eq_s_b (z, 2, s_14)))
761 goto lab0;
762 return 0;
763 lab0:
764 z->c = z->l - m3;
765 }
766 break;
767 }
768 {
769 int ret = slice_del (z); /* delete, line 170 */
770 if (ret < 0)
771 return ret;
772 }
773 return 1;
774}
775
776static int
777r_tidy (struct SN_env *z)
778{
779 {
780 int mlimit; /* setlimit, line 173 */
781 int m1 = z->l - z->c;
782 (void) m1;
783 if (z->c < z->I[0])
784 return 0;
785 z->c = z->I[0]; /* tomark, line 173 */
786 mlimit = z->lb;
787 z->lb = z->c;
788 z->c = z->l - m1;
789 {
790 int m2 = z->l - z->c;
791 (void) m2; /* do, line 174 */
792 {
793 int m3 = z->l - z->c;
794 (void) m3; /* and, line 174 */
795 {
796 int ret = r_LONG (z);
797 if (ret == 0)
798 goto lab0; /* call LONG, line 174 */
799 if (ret < 0)
800 return ret;
801 }
802 z->c = z->l - m3;
803 z->ket = z->c; /* [, line 174 */
804 {
805 int ret = skip_utf8 (z->p, z->c, z->lb, 0, -1);
806 if (ret < 0)
807 goto lab0;
808 z->c = ret; /* next, line 174 */
809 }
810 z->bra = z->c; /* ], line 174 */
811 {
812 int ret = slice_del (z); /* delete, line 174 */
813 if (ret < 0)
814 return ret;
815 }
816 }
817 lab0:
818 z->c = z->l - m2;
819 }
820 {
821 int m4 = z->l - z->c;
822 (void) m4; /* do, line 175 */
823 z->ket = z->c; /* [, line 175 */
824 if (in_grouping_b_U (z, g_AEI, 97, 228, 0))
825 goto lab1;
826 z->bra = z->c; /* ], line 175 */
827 if (out_grouping_b_U (z, g_V1, 97, 246, 0))
828 goto lab1;
829 {
830 int ret = slice_del (z); /* delete, line 175 */
831 if (ret < 0)
832 return ret;
833 }
834 lab1:
835 z->c = z->l - m4;
836 }
837 {
838 int m5 = z->l - z->c;
839 (void) m5; /* do, line 176 */
840 z->ket = z->c; /* [, line 176 */
841 if (!(eq_s_b (z, 1, s_15)))
842 goto lab2;
843 z->bra = z->c; /* ], line 176 */
844 {
845 int m6 = z->l - z->c;
846 (void) m6; /* or, line 176 */
847 if (!(eq_s_b (z, 1, s_16)))
848 goto lab4;
849 goto lab3;
850 lab4:
851 z->c = z->l - m6;
852 if (!(eq_s_b (z, 1, s_17)))
853 goto lab2;
854 }
855 lab3:
856 {
857 int ret = slice_del (z); /* delete, line 176 */
858 if (ret < 0)
859 return ret;
860 }
861 lab2:
862 z->c = z->l - m5;
863 }
864 {
865 int m7 = z->l - z->c;
866 (void) m7; /* do, line 177 */
867 z->ket = z->c; /* [, line 177 */
868 if (!(eq_s_b (z, 1, s_18)))
869 goto lab5;
870 z->bra = z->c; /* ], line 177 */
871 if (!(eq_s_b (z, 1, s_19)))
872 goto lab5;
873 {
874 int ret = slice_del (z); /* delete, line 177 */
875 if (ret < 0)
876 return ret;
877 }
878 lab5:
879 z->c = z->l - m7;
880 }
881 z->lb = mlimit;
882 }
883 if (in_grouping_b_U (z, g_V1, 97, 246, 1) < 0)
884 return 0; /* goto *//* non V1, line 179 */
885 z->ket = z->c; /* [, line 179 */
886 {
887 int ret = skip_utf8 (z->p, z->c, z->lb, 0, -1);
888 if (ret < 0)
889 return 0;
890 z->c = ret; /* next, line 179 */
891 }
892 z->bra = z->c; /* ], line 179 */
893 z->S[0] = slice_to (z, z->S[0]); /* -> x, line 179 */
894 if (z->S[0] == 0)
895 return -1; /* -> x, line 179 */
896 if (!(eq_v_b (z, z->S[0])))
897 return 0; /* name x, line 179 */
898 {
899 int ret = slice_del (z); /* delete, line 179 */
900 if (ret < 0)
901 return ret;
902 }
903 return 1;
904}
905
906extern int
908{
909 {
910 int c1 = z->c; /* do, line 185 */
911 {
912 int ret = r_mark_regions (z);
913 if (ret == 0)
914 goto lab0; /* call mark_regions, line 185 */
915 if (ret < 0)
916 return ret;
917 }
918 lab0:
919 z->c = c1;
920 }
921 z->B[0] = 0; /* unset ending_removed, line 186 */
922 z->lb = z->c;
923 z->c = z->l; /* backwards, line 187 */
924
925 {
926 int m2 = z->l - z->c;
927 (void) m2; /* do, line 188 */
928 {
929 int ret = r_particle_etc (z);
930 if (ret == 0)
931 goto lab1; /* call particle_etc, line 188 */
932 if (ret < 0)
933 return ret;
934 }
935 lab1:
936 z->c = z->l - m2;
937 }
938 {
939 int m3 = z->l - z->c;
940 (void) m3; /* do, line 189 */
941 {
942 int ret = r_possessive (z);
943 if (ret == 0)
944 goto lab2; /* call possessive, line 189 */
945 if (ret < 0)
946 return ret;
947 }
948 lab2:
949 z->c = z->l - m3;
950 }
951 {
952 int m4 = z->l - z->c;
953 (void) m4; /* do, line 190 */
954 {
955 int ret = r_case_ending (z);
956 if (ret == 0)
957 goto lab3; /* call case_ending, line 190 */
958 if (ret < 0)
959 return ret;
960 }
961 lab3:
962 z->c = z->l - m4;
963 }
964 {
965 int m5 = z->l - z->c;
966 (void) m5; /* do, line 191 */
967 {
968 int ret = r_other_endings (z);
969 if (ret == 0)
970 goto lab4; /* call other_endings, line 191 */
971 if (ret < 0)
972 return ret;
973 }
974 lab4:
975 z->c = z->l - m5;
976 }
977 {
978 int m6 = z->l - z->c;
979 (void) m6; /* or, line 192 */
980 if (!(z->B[0]))
981 goto lab6; /* Boolean test ending_removed, line 192 */
982 {
983 int m7 = z->l - z->c;
984 (void) m7; /* do, line 192 */
985 {
986 int ret = r_i_plural (z);
987 if (ret == 0)
988 goto lab7; /* call i_plural, line 192 */
989 if (ret < 0)
990 return ret;
991 }
992 lab7:
993 z->c = z->l - m7;
994 }
995 goto lab5;
996 lab6:
997 z->c = z->l - m6;
998 {
999 int m8 = z->l - z->c;
1000 (void) m8; /* do, line 192 */
1001 {
1002 int ret = r_t_plural (z);
1003 if (ret == 0)
1004 goto lab8; /* call t_plural, line 192 */
1005 if (ret < 0)
1006 return ret;
1007 }
1008 lab8:
1009 z->c = z->l - m8;
1010 }
1011 }
1012lab5:
1013 {
1014 int m9 = z->l - z->c;
1015 (void) m9; /* do, line 193 */
1016 {
1017 int ret = r_tidy (z);
1018 if (ret == 0)
1019 goto lab9; /* call tidy, line 193 */
1020 if (ret < 0)
1021 return ret;
1022 }
1023 lab9:
1024 z->c = z->l - m9;
1025 }
1026 z->c = z->lb;
1027 return 1;
1028}
1029
1030extern struct SN_env *
1032{
1033 return SN_create_env (1, 2, 1);
1034}
1035
1036extern void
1038{
1039 SN_close_env (z, 1);
1040}
struct SN_env * SN_create_env(int S_size, int I_size, int B_size)
Definition api.c:6
void SN_close_env(struct SN_env *z, int S_size)
Definition api.c:50
unsigned char symbol
Definition api.h:2
int find_among_b(struct SN_env *z, const struct among *v, int v_size)
Definition utilities.c:400
int out_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition utilities.c:170
int slice_del(struct SN_env *z)
Definition utilities.c:573
int in_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition utilities.c:134
int eq_v_b(struct SN_env *z, const symbol *p)
Definition utilities.c:306
int skip_utf8(const symbol *p, int c, int lb, int l, int n)
Definition utilities.c:42
int in_grouping_b_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition utilities.c:152
int eq_s_b(struct SN_env *z, int s_size, const symbol *s)
Definition utilities.c:290
int out_grouping_b_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition utilities.c:187
symbol * slice_to(struct SN_env *z, symbol *p)
Definition utilities.c:605
int slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition utilities.c:559
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 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_7[]
static const symbol s_0_8[3]
static const symbol s_13[]
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_19[]
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 const symbol s_16[]
static const symbol s_14[]
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 symbol s_10[]
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_11[]
static const symbol s_12[]
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_18[]
static const symbol s_17[]
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_8[]
static const symbol s_9[]
static const symbol s_5[]
static const symbol s_8_0[1]
static const symbol s_15[]
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
unsigned char * B
Definition api.h:19
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