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