tracker-0.16.2/src/libstemmer/stem_UTF_8_finnish.c

No issues found

  1 /*
  2  * Copyright (c) 2001, Dr Martin Porter
  3  * All rights reserved.
  4  *
  5  * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  6  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  7  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  8  * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  9  *
 10  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 11  */
 12 
 13 
 14 
 15 /* This file was generated automatically by the Snowball to ANSI C compiler */
 16 
 17 #include "header.h"
 18 
 19 extern int finnish_UTF_8_stem(struct SN_env * z);
 20 static int r_tidy(struct SN_env * z);
 21 static int r_other_endings(struct SN_env * z);
 22 static int r_t_plural(struct SN_env * z);
 23 static int r_i_plural(struct SN_env * z);
 24 static int r_case_ending(struct SN_env * z);
 25 static int r_VI(struct SN_env * z);
 26 static int r_LONG(struct SN_env * z);
 27 static int r_possessive(struct SN_env * z);
 28 static int r_particle_etc(struct SN_env * z);
 29 static int r_R2(struct SN_env * z);
 30 static int r_mark_regions(struct SN_env * z);
 31 
 32 extern struct SN_env * finnish_UTF_8_create_env(void);
 33 extern void finnish_UTF_8_close_env(struct SN_env * z);
 34 
 35 static symbol s_0_0[2] = { 'p', 'a' };
 36 static symbol s_0_1[3] = { 's', 't', 'i' };
 37 static symbol s_0_2[4] = { 'k', 'a', 'a', 'n' };
 38 static symbol s_0_3[3] = { 'h', 'a', 'n' };
 39 static symbol s_0_4[3] = { 'k', 'i', 'n' };
 40 static symbol s_0_5[4] = { 'h', 0xC3, 0xA4, 'n' };
 41 static symbol s_0_6[6] = { 'k', 0xC3, 0xA4, 0xC3, 0xA4, 'n' };
 42 static symbol s_0_7[2] = { 'k', 'o' };
 43 static symbol s_0_8[3] = { 'p', 0xC3, 0xA4 };
 44 static symbol s_0_9[3] = { 'k', 0xC3, 0xB6 };
 45 
 46 static struct among a_0[10] =
 47 {
 48 /*  0 */ { 2, s_0_0, -1, 1, 0},
 49 /*  1 */ { 3, s_0_1, -1, 2, 0},
 50 /*  2 */ { 4, s_0_2, -1, 1, 0},
 51 /*  3 */ { 3, s_0_3, -1, 1, 0},
 52 /*  4 */ { 3, s_0_4, -1, 1, 0},
 53 /*  5 */ { 4, s_0_5, -1, 1, 0},
 54 /*  6 */ { 6, s_0_6, -1, 1, 0},
 55 /*  7 */ { 2, s_0_7, -1, 1, 0},
 56 /*  8 */ { 3, s_0_8, -1, 1, 0},
 57 /*  9 */ { 3, s_0_9, -1, 1, 0}
 58 };
 59 
 60 static symbol s_1_0[3] = { 'l', 'l', 'a' };
 61 static symbol s_1_1[2] = { 'n', 'a' };
 62 static symbol s_1_2[3] = { 's', 's', 'a' };
 63 static symbol s_1_3[2] = { 't', 'a' };
 64 static symbol s_1_4[3] = { 'l', 't', 'a' };
 65 static symbol s_1_5[3] = { 's', 't', 'a' };
 66 
 67 static struct among a_1[6] =
 68 {
 69 /*  0 */ { 3, s_1_0, -1, -1, 0},
 70 /*  1 */ { 2, s_1_1, -1, -1, 0},
 71 /*  2 */ { 3, s_1_2, -1, -1, 0},
 72 /*  3 */ { 2, s_1_3, -1, -1, 0},
 73 /*  4 */ { 3, s_1_4, 3, -1, 0},
 74 /*  5 */ { 3, s_1_5, 3, -1, 0}
 75 };
 76 
 77 static symbol s_2_0[4] = { 'l', 'l', 0xC3, 0xA4 };
 78 static symbol s_2_1[3] = { 'n', 0xC3, 0xA4 };
 79 static symbol s_2_2[4] = { 's', 's', 0xC3, 0xA4 };
 80 static symbol s_2_3[3] = { 't', 0xC3, 0xA4 };
 81 static symbol s_2_4[4] = { 'l', 't', 0xC3, 0xA4 };
 82 static symbol s_2_5[4] = { 's', 't', 0xC3, 0xA4 };
 83 
 84 static struct among a_2[6] =
 85 {
 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 
 94 static symbol s_3_0[3] = { 'l', 'l', 'e' };
 95 static symbol s_3_1[3] = { 'i', 'n', 'e' };
 96 
 97 static struct among a_3[2] =
 98 {
 99 /*  0 */ { 3, s_3_0, -1, -1, 0},
100 /*  1 */ { 3, s_3_1, -1, -1, 0}
101 };
102 
103 static symbol s_4_0[3] = { 'n', 's', 'a' };
104 static symbol s_4_1[3] = { 'm', 'm', 'e' };
105 static symbol s_4_2[3] = { 'n', 'n', 'e' };
106 static symbol s_4_3[2] = { 'n', 'i' };
107 static symbol s_4_4[2] = { 's', 'i' };
108 static symbol s_4_5[2] = { 'a', 'n' };
109 static symbol s_4_6[2] = { 'e', 'n' };
110 static symbol s_4_7[3] = { 0xC3, 0xA4, 'n' };
111 static symbol s_4_8[4] = { 'n', 's', 0xC3, 0xA4 };
112 
113 static struct among a_4[9] =
114 {
115 /*  0 */ { 3, s_4_0, -1, 3, 0},
116 /*  1 */ { 3, s_4_1, -1, 3, 0},
117 /*  2 */ { 3, s_4_2, -1, 3, 0},
118 /*  3 */ { 2, s_4_3, -1, 2, 0},
119 /*  4 */ { 2, s_4_4, -1, 1, 0},
120 /*  5 */ { 2, s_4_5, -1, 4, 0},
121 /*  6 */ { 2, s_4_6, -1, 6, 0},
122 /*  7 */ { 3, s_4_7, -1, 5, 0},
123 /*  8 */ { 4, s_4_8, -1, 3, 0}
124 };
125 
126 static symbol s_5_0[2] = { 'a', 'a' };
127 static symbol s_5_1[2] = { 'e', 'e' };
128 static symbol s_5_2[2] = { 'i', 'i' };
129 static symbol s_5_3[2] = { 'o', 'o' };
130 static symbol s_5_4[2] = { 'u', 'u' };
131 static symbol s_5_5[4] = { 0xC3, 0xA4, 0xC3, 0xA4 };
132 static symbol s_5_6[4] = { 0xC3, 0xB6, 0xC3, 0xB6 };
133 
134 static struct among a_5[7] =
135 {
136 /*  0 */ { 2, s_5_0, -1, -1, 0},
137 /*  1 */ { 2, s_5_1, -1, -1, 0},
138 /*  2 */ { 2, s_5_2, -1, -1, 0},
139 /*  3 */ { 2, s_5_3, -1, -1, 0},
140 /*  4 */ { 2, s_5_4, -1, -1, 0},
141 /*  5 */ { 4, s_5_5, -1, -1, 0},
142 /*  6 */ { 4, s_5_6, -1, -1, 0}
143 };
144 
145 static symbol s_6_0[1] = { 'a' };
146 static symbol s_6_1[3] = { 'l', 'l', 'a' };
147 static symbol s_6_2[2] = { 'n', 'a' };
148 static symbol s_6_3[3] = { 's', 's', 'a' };
149 static symbol s_6_4[2] = { 't', 'a' };
150 static symbol s_6_5[3] = { 'l', 't', 'a' };
151 static symbol s_6_6[3] = { 's', 't', 'a' };
152 static symbol s_6_7[3] = { 't', 't', 'a' };
153 static symbol s_6_8[3] = { 'l', 'l', 'e' };
154 static symbol s_6_9[3] = { 'i', 'n', 'e' };
155 static symbol s_6_10[3] = { 'k', 's', 'i' };
156 static symbol s_6_11[1] = { 'n' };
157 static symbol s_6_12[3] = { 'h', 'a', 'n' };
158 static symbol s_6_13[3] = { 'd', 'e', 'n' };
159 static symbol s_6_14[4] = { 's', 'e', 'e', 'n' };
160 static symbol s_6_15[3] = { 'h', 'e', 'n' };
161 static symbol s_6_16[4] = { 't', 't', 'e', 'n' };
162 static symbol s_6_17[3] = { 'h', 'i', 'n' };
163 static symbol s_6_18[4] = { 's', 'i', 'i', 'n' };
164 static symbol s_6_19[3] = { 'h', 'o', 'n' };
165 static symbol s_6_20[4] = { 'h', 0xC3, 0xA4, 'n' };
166 static symbol s_6_21[4] = { 'h', 0xC3, 0xB6, 'n' };
167 static symbol s_6_22[2] = { 0xC3, 0xA4 };
168 static symbol s_6_23[4] = { 'l', 'l', 0xC3, 0xA4 };
169 static symbol s_6_24[3] = { 'n', 0xC3, 0xA4 };
170 static symbol s_6_25[4] = { 's', 's', 0xC3, 0xA4 };
171 static symbol s_6_26[3] = { 't', 0xC3, 0xA4 };
172 static symbol s_6_27[4] = { 'l', 't', 0xC3, 0xA4 };
173 static symbol s_6_28[4] = { 's', 't', 0xC3, 0xA4 };
174 static symbol s_6_29[4] = { 't', 't', 0xC3, 0xA4 };
175 
176 static struct among a_6[30] =
177 {
178 /*  0 */ { 1, s_6_0, -1, 8, 0},
179 /*  1 */ { 3, s_6_1, 0, -1, 0},
180 /*  2 */ { 2, s_6_2, 0, -1, 0},
181 /*  3 */ { 3, s_6_3, 0, -1, 0},
182 /*  4 */ { 2, s_6_4, 0, -1, 0},
183 /*  5 */ { 3, s_6_5, 4, -1, 0},
184 /*  6 */ { 3, s_6_6, 4, -1, 0},
185 /*  7 */ { 3, s_6_7, 4, 9, 0},
186 /*  8 */ { 3, s_6_8, -1, -1, 0},
187 /*  9 */ { 3, s_6_9, -1, -1, 0},
188 /* 10 */ { 3, s_6_10, -1, -1, 0},
189 /* 11 */ { 1, s_6_11, -1, 7, 0},
190 /* 12 */ { 3, s_6_12, 11, 1, 0},
191 /* 13 */ { 3, s_6_13, 11, -1, r_VI},
192 /* 14 */ { 4, s_6_14, 11, -1, r_LONG},
193 /* 15 */ { 3, s_6_15, 11, 2, 0},
194 /* 16 */ { 4, s_6_16, 11, -1, r_VI},
195 /* 17 */ { 3, s_6_17, 11, 3, 0},
196 /* 18 */ { 4, s_6_18, 11, -1, r_VI},
197 /* 19 */ { 3, s_6_19, 11, 4, 0},
198 /* 20 */ { 4, s_6_20, 11, 5, 0},
199 /* 21 */ { 4, s_6_21, 11, 6, 0},
200 /* 22 */ { 2, s_6_22, -1, 8, 0},
201 /* 23 */ { 4, s_6_23, 22, -1, 0},
202 /* 24 */ { 3, s_6_24, 22, -1, 0},
203 /* 25 */ { 4, s_6_25, 22, -1, 0},
204 /* 26 */ { 3, s_6_26, 22, -1, 0},
205 /* 27 */ { 4, s_6_27, 26, -1, 0},
206 /* 28 */ { 4, s_6_28, 26, -1, 0},
207 /* 29 */ { 4, s_6_29, 26, 9, 0}
208 };
209 
210 static symbol s_7_0[3] = { 'e', 'j', 'a' };
211 static symbol s_7_1[3] = { 'm', 'm', 'a' };
212 static symbol s_7_2[4] = { 'i', 'm', 'm', 'a' };
213 static symbol s_7_3[3] = { 'm', 'p', 'a' };
214 static symbol s_7_4[4] = { 'i', 'm', 'p', 'a' };
215 static symbol s_7_5[3] = { 'm', 'm', 'i' };
216 static symbol s_7_6[4] = { 'i', 'm', 'm', 'i' };
217 static symbol s_7_7[3] = { 'm', 'p', 'i' };
218 static symbol s_7_8[4] = { 'i', 'm', 'p', 'i' };
219 static symbol s_7_9[4] = { 'e', 'j', 0xC3, 0xA4 };
220 static symbol s_7_10[4] = { 'm', 'm', 0xC3, 0xA4 };
221 static symbol s_7_11[5] = { 'i', 'm', 'm', 0xC3, 0xA4 };
222 static symbol s_7_12[4] = { 'm', 'p', 0xC3, 0xA4 };
223 static symbol s_7_13[5] = { 'i', 'm', 'p', 0xC3, 0xA4 };
224 
225 static struct among a_7[14] =
226 {
227 /*  0 */ { 3, s_7_0, -1, -1, 0},
228 /*  1 */ { 3, s_7_1, -1, 1, 0},
229 /*  2 */ { 4, s_7_2, 1, -1, 0},
230 /*  3 */ { 3, s_7_3, -1, 1, 0},
231 /*  4 */ { 4, s_7_4, 3, -1, 0},
232 /*  5 */ { 3, s_7_5, -1, 1, 0},
233 /*  6 */ { 4, s_7_6, 5, -1, 0},
234 /*  7 */ { 3, s_7_7, -1, 1, 0},
235 /*  8 */ { 4, s_7_8, 7, -1, 0},
236 /*  9 */ { 4, s_7_9, -1, -1, 0},
237 /* 10 */ { 4, s_7_10, -1, 1, 0},
238 /* 11 */ { 5, s_7_11, 10, -1, 0},
239 /* 12 */ { 4, s_7_12, -1, 1, 0},
240 /* 13 */ { 5, s_7_13, 12, -1, 0}
241 };
242 
243 static symbol s_8_0[1] = { 'i' };
244 static symbol s_8_1[1] = { 'j' };
245 
246 static struct among a_8[2] =
247 {
248 /*  0 */ { 1, s_8_0, -1, -1, 0},
249 /*  1 */ { 1, s_8_1, -1, -1, 0}
250 };
251 
252 static symbol s_9_0[3] = { 'm', 'm', 'a' };
253 static symbol s_9_1[4] = { 'i', 'm', 'm', 'a' };
254 
255 static struct among a_9[2] =
256 {
257 /*  0 */ { 3, s_9_0, -1, 1, 0},
258 /*  1 */ { 4, s_9_1, 0, -1, 0}
259 };
260 
261 static unsigned char g_AEI[] = { 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8 };
262 
263 static unsigned char g_V1[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
264 
265 static unsigned char g_V2[] = { 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
266 
267 static unsigned char g_particle_end[] = { 17, 97, 24, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
268 
269 static symbol s_0[] = { 'k' };
270 static symbol s_1[] = { 'k', 's', 'e' };
271 static symbol s_2[] = { 'k', 's', 'i' };
272 static symbol s_3[] = { 'i' };
273 static symbol s_4[] = { 'a' };
274 static symbol s_5[] = { 'e' };
275 static symbol s_6[] = { 'i' };
276 static symbol s_7[] = { 'o' };
277 static symbol s_8[] = { 0xC3, 0xA4 };
278 static symbol s_9[] = { 0xC3, 0xB6 };
279 static symbol s_10[] = { 'i', 'e' };
280 static symbol s_11[] = { 'e' };
281 static symbol s_12[] = { 'p', 'o' };
282 static symbol s_13[] = { 't' };
283 static symbol s_14[] = { 'p', 'o' };
284 static symbol s_15[] = { 'j' };
285 static symbol s_16[] = { 'o' };
286 static symbol s_17[] = { 'u' };
287 static symbol s_18[] = { 'o' };
288 static symbol s_19[] = { 'j' };
289 
290 static int r_mark_regions(struct SN_env * z) {
291     z->I[0] = z->l;
292     z->I[1] = z->l;
293     while(1) { /* goto, line 46 */
294 	int c = z->c;
295 	if (!(in_grouping_U(z, g_V1, 97, 246))) goto lab0;
296 	z->c = c;
297 	break;
298     lab0:
299 	z->c = c;
300 	{   int c = skip_utf8(z->p, z->c, 0, z->l, 1);
301 	    if (c < 0) return 0;
302 	    z->c = c; /* goto, line 46 */
303 	}
304     }
305     while(1) { /* gopast, line 46 */
306 	if (!(out_grouping_U(z, g_V1, 97, 246))) goto lab1;
307 	break;
308     lab1:
309 	{   int c = skip_utf8(z->p, z->c, 0, z->l, 1);
310 	    if (c < 0) return 0;
311 	    z->c = c; /* gopast, line 46 */
312 	}
313     }
314     z->I[0] = z->c; /* setmark p1, line 46 */
315     while(1) { /* goto, line 47 */
316 	int c = z->c;
317 	if (!(in_grouping_U(z, g_V1, 97, 246))) goto lab2;
318 	z->c = c;
319 	break;
320     lab2:
321 	z->c = c;
322 	{   int c = skip_utf8(z->p, z->c, 0, z->l, 1);
323 	    if (c < 0) return 0;
324 	    z->c = c; /* goto, line 47 */
325 	}
326     }
327     while(1) { /* gopast, line 47 */
328 	if (!(out_grouping_U(z, g_V1, 97, 246))) goto lab3;
329 	break;
330     lab3:
331 	{   int c = skip_utf8(z->p, z->c, 0, z->l, 1);
332 	    if (c < 0) return 0;
333 	    z->c = c; /* gopast, line 47 */
334 	}
335     }
336     z->I[1] = z->c; /* setmark p2, line 47 */
337     return 1;
338 }
339 
340 static int r_R2(struct SN_env * z) {
341     if (!(z->I[1] <= z->c)) return 0;
342     return 1;
343 }
344 
345 static int r_particle_etc(struct SN_env * z) {
346     int among_var;
347     {	int m3; /* setlimit, line 55 */
348 	int m = z->l - z->c; (void) m;
349 	if (z->c < z->I[0]) return 0;
350 	z->c = z->I[0]; /* tomark, line 55 */
351 	m3 = z->lb; z->lb = z->c;
352 	z->c = z->l - m;
353 	z->ket = z->c; /* [, line 55 */
354 	among_var = find_among_b(z, a_0, 10); /* substring, line 55 */
355 	if (!(among_var)) { z->lb = m3; return 0; }
356 	z->bra = z->c; /* ], line 55 */
357 	z->lb = m3;
358     }
359     switch(among_var) {
360 	case 0: return 0;
361 	case 1:
362 	    if (!(in_grouping_b_U(z, g_particle_end, 97, 246))) return 0;
363 	    break;
364 	case 2:
365 	    {	int ret = r_R2(z);
366 		if (ret == 0) return 0; /* call R2, line 64 */
367 		if (ret < 0) return ret;
368 	    }
369 	    break;
370     }
371     {	int ret;
372 	ret = slice_del(z); /* delete, line 66 */
373 	if (ret < 0) return ret;
374     }
375     return 1;
376 }
377 
378 static int r_possessive(struct SN_env * z) {
379     int among_var;
380     {	int m3; /* setlimit, line 69 */
381 	int m = z->l - z->c; (void) m;
382 	if (z->c < z->I[0]) return 0;
383 	z->c = z->I[0]; /* tomark, line 69 */
384 	m3 = z->lb; z->lb = z->c;
385 	z->c = z->l - m;
386 	z->ket = z->c; /* [, line 69 */
387 	among_var = find_among_b(z, a_4, 9); /* substring, line 69 */
388 	if (!(among_var)) { z->lb = m3; return 0; }
389 	z->bra = z->c; /* ], line 69 */
390 	z->lb = m3;
391     }
392     switch(among_var) {
393 	case 0: return 0;
394 	case 1:
395 	    {	int m = z->l - z->c; (void) m; /* not, line 72 */
396 		if (!(eq_s_b(z, 1, s_0))) goto lab0;
397 		return 0;
398 	    lab0:
399 		z->c = z->l - m;
400 	    }
401 	    {	int ret;
402 		ret = slice_del(z); /* delete, line 72 */
403 		if (ret < 0) return ret;
404 	    }
405 	    break;
406 	case 2:
407 	    {	int ret;
408 		ret = slice_del(z); /* delete, line 74 */
409 		if (ret < 0) return ret;
410 	    }
411 	    z->ket = z->c; /* [, line 74 */
412 	    if (!(eq_s_b(z, 3, s_1))) return 0;
413 	    z->bra = z->c; /* ], line 74 */
414 	    {	int ret;
415 		ret = slice_from_s(z, 3, s_2); /* <-, line 74 */
416 		if (ret < 0) return ret;
417 	    }
418 	    break;
419 	case 3:
420 	    {	int ret;
421 		ret = slice_del(z); /* delete, line 78 */
422 		if (ret < 0) return ret;
423 	    }
424 	    break;
425 	case 4:
426 	    if (!(find_among_b(z, a_1, 6))) return 0; /* among, line 81 */
427 	    {	int ret;
428 		ret = slice_del(z); /* delete, line 81 */
429 		if (ret < 0) return ret;
430 	    }
431 	    break;
432 	case 5:
433 	    if (!(find_among_b(z, a_2, 6))) return 0; /* among, line 83 */
434 	    {	int ret;
435 		ret = slice_del(z); /* delete, line 84 */
436 		if (ret < 0) return ret;
437 	    }
438 	    break;
439 	case 6:
440 	    if (!(find_among_b(z, a_3, 2))) return 0; /* among, line 86 */
441 	    {	int ret;
442 		ret = slice_del(z); /* delete, line 86 */
443 		if (ret < 0) return ret;
444 	    }
445 	    break;
446     }
447     return 1;
448 }
449 
450 static int r_LONG(struct SN_env * z) {
451     if (!(find_among_b(z, a_5, 7))) return 0; /* among, line 91 */
452     return 1;
453 }
454 
455 static int r_VI(struct SN_env * z) {
456     if (!(eq_s_b(z, 1, s_3))) return 0;
457     if (!(in_grouping_b_U(z, g_V2, 97, 246))) return 0;
458     return 1;
459 }
460 
461 static int r_case_ending(struct SN_env * z) {
462     int among_var;
463     {	int m3; /* setlimit, line 96 */
464 	int m = z->l - z->c; (void) m;
465 	if (z->c < z->I[0]) return 0;
466 	z->c = z->I[0]; /* tomark, line 96 */
467 	m3 = z->lb; z->lb = z->c;
468 	z->c = z->l - m;
469 	z->ket = z->c; /* [, line 96 */
470 	among_var = find_among_b(z, a_6, 30); /* substring, line 96 */
471 	if (!(among_var)) { z->lb = m3; return 0; }
472 	z->bra = z->c; /* ], line 96 */
473 	z->lb = m3;
474     }
475     switch(among_var) {
476 	case 0: return 0;
477 	case 1:
478 	    if (!(eq_s_b(z, 1, s_4))) return 0;
479 	    break;
480 	case 2:
481 	    if (!(eq_s_b(z, 1, s_5))) return 0;
482 	    break;
483 	case 3:
484 	    if (!(eq_s_b(z, 1, s_6))) return 0;
485 	    break;
486 	case 4:
487 	    if (!(eq_s_b(z, 1, s_7))) return 0;
488 	    break;
489 	case 5:
490 	    if (!(eq_s_b(z, 2, s_8))) return 0;
491 	    break;
492 	case 6:
493 	    if (!(eq_s_b(z, 2, s_9))) return 0;
494 	    break;
495 	case 7:
496 	    {	int m = z->l - z->c; (void) m; /* try, line 111 */
497 		{   int m = z->l - z->c; (void) m; /* and, line 113 */
498 		    {	int m = z->l - z->c; (void) m; /* or, line 112 */
499 			{   int ret = r_LONG(z);
500 			    if (ret == 0) goto lab2; /* call LONG, line 111 */
501 			    if (ret < 0) return ret;
502 			}
503 			goto lab1;
504 		    lab2:
505 			z->c = z->l - m;
506 			if (!(eq_s_b(z, 2, s_10))) { z->c = z->l - m; goto lab0; }
507 		    }
508 		lab1:
509 		    z->c = z->l - m;
510 		    {	int c = skip_utf8(z->p, z->c, z->lb, 0, -1);
511 			if (c < 0) { z->c = z->l - m; goto lab0; }
512 			z->c = c; /* next, line 113 */
513 		    }
514 		}
515 		z->bra = z->c; /* ], line 113 */
516 	    lab0:
517 		;
518 	    }
519 	    break;
520 	case 8:
521 	    if (!(in_grouping_b_U(z, g_V1, 97, 246))) return 0;
522 	    if (!(out_grouping_b_U(z, g_V1, 97, 246))) return 0;
523 	    break;
524 	case 9:
525 	    if (!(eq_s_b(z, 1, s_11))) return 0;
526 	    break;
527     }
528     {	int ret;
529 	ret = slice_del(z); /* delete, line 138 */
530 	if (ret < 0) return ret;
531     }
532     z->B[0] = 1; /* set ending_removed, line 139 */
533     return 1;
534 }
535 
536 static int r_other_endings(struct SN_env * z) {
537     int among_var;
538     {	int m3; /* setlimit, line 142 */
539 	int m = z->l - z->c; (void) m;
540 	if (z->c < z->I[1]) return 0;
541 	z->c = z->I[1]; /* tomark, line 142 */
542 	m3 = z->lb; z->lb = z->c;
543 	z->c = z->l - m;
544 	z->ket = z->c; /* [, line 142 */
545 	among_var = find_among_b(z, a_7, 14); /* substring, line 142 */
546 	if (!(among_var)) { z->lb = m3; return 0; }
547 	z->bra = z->c; /* ], line 142 */
548 	z->lb = m3;
549     }
550     switch(among_var) {
551 	case 0: return 0;
552 	case 1:
553 	    {	int m = z->l - z->c; (void) m; /* not, line 146 */
554 		if (!(eq_s_b(z, 2, s_12))) goto lab0;
555 		return 0;
556 	    lab0:
557 		z->c = z->l - m;
558 	    }
559 	    break;
560     }
561     {	int ret;
562 	ret = slice_del(z); /* delete, line 151 */
563 	if (ret < 0) return ret;
564     }
565     return 1;
566 }
567 
568 static int r_i_plural(struct SN_env * z) {
569     {	int m3; /* setlimit, line 154 */
570 	int m = z->l - z->c; (void) m;
571 	if (z->c < z->I[0]) return 0;
572 	z->c = z->I[0]; /* tomark, line 154 */
573 	m3 = z->lb; z->lb = z->c;
574 	z->c = z->l - m;
575 	z->ket = z->c; /* [, line 154 */
576 	if (!(find_among_b(z, a_8, 2))) { z->lb = m3; return 0; } /* substring, line 154 */
577 	z->bra = z->c; /* ], line 154 */
578 	z->lb = m3;
579     }
580     {	int ret;
581 	ret = slice_del(z); /* delete, line 158 */
582 	if (ret < 0) return ret;
583     }
584     return 1;
585 }
586 
587 static int r_t_plural(struct SN_env * z) {
588     int among_var;
589     {	int m3; /* setlimit, line 161 */
590 	int m = z->l - z->c; (void) m;
591 	if (z->c < z->I[0]) return 0;
592 	z->c = z->I[0]; /* tomark, line 161 */
593 	m3 = z->lb; z->lb = z->c;
594 	z->c = z->l - m;
595 	z->ket = z->c; /* [, line 162 */
596 	if (!(eq_s_b(z, 1, s_13))) { z->lb = m3; return 0; }
597 	z->bra = z->c; /* ], line 162 */
598 	{   int m_test = z->l - z->c; /* test, line 162 */
599 	    if (!(in_grouping_b_U(z, g_V1, 97, 246))) { z->lb = m3; return 0; }
600 	    z->c = z->l - m_test;
601 	}
602 	{   int ret;
603 	    ret = slice_del(z); /* delete, line 163 */
604 	    if (ret < 0) return ret;
605 	}
606 	z->lb = m3;
607     }
608     {	int m3; /* setlimit, line 165 */
609 	int m = z->l - z->c; (void) m;
610 	if (z->c < z->I[1]) return 0;
611 	z->c = z->I[1]; /* tomark, line 165 */
612 	m3 = z->lb; z->lb = z->c;
613 	z->c = z->l - m;
614 	z->ket = z->c; /* [, line 165 */
615 	among_var = find_among_b(z, a_9, 2); /* substring, line 165 */
616 	if (!(among_var)) { z->lb = m3; return 0; }
617 	z->bra = z->c; /* ], line 165 */
618 	z->lb = m3;
619     }
620     switch(among_var) {
621 	case 0: return 0;
622 	case 1:
623 	    {	int m = z->l - z->c; (void) m; /* not, line 167 */
624 		if (!(eq_s_b(z, 2, s_14))) goto lab0;
625 		return 0;
626 	    lab0:
627 		z->c = z->l - m;
628 	    }
629 	    break;
630     }
631     {	int ret;
632 	ret = slice_del(z); /* delete, line 170 */
633 	if (ret < 0) return ret;
634     }
635     return 1;
636 }
637 
638 static int r_tidy(struct SN_env * z) {
639     {	int m3; /* setlimit, line 173 */
640 	int m = z->l - z->c; (void) m;
641 	if (z->c < z->I[0]) return 0;
642 	z->c = z->I[0]; /* tomark, line 173 */
643 	m3 = z->lb; z->lb = z->c;
644 	z->c = z->l - m;
645 	{   int m = z->l - z->c; (void) m; /* do, line 174 */
646 	    {	int m = z->l - z->c; (void) m; /* and, line 174 */
647 		{   int ret = r_LONG(z);
648 		    if (ret == 0) goto lab0; /* call LONG, line 174 */
649 		    if (ret < 0) return ret;
650 		}
651 		z->c = z->l - m;
652 		z->ket = z->c; /* [, line 174 */
653 		{   int c = skip_utf8(z->p, z->c, z->lb, 0, -1);
654 		    if (c < 0) goto lab0;
655 		    z->c = c; /* next, line 174 */
656 		}
657 		z->bra = z->c; /* ], line 174 */
658 		{   int ret;
659 		    ret = slice_del(z); /* delete, line 174 */
660 		    if (ret < 0) return ret;
661 		}
662 	    }
663 	lab0:
664 	    z->c = z->l - m;
665 	}
666 	{   int m = z->l - z->c; (void) m; /* do, line 175 */
667 	    z->ket = z->c; /* [, line 175 */
668 	    if (!(in_grouping_b_U(z, g_AEI, 97, 228))) goto lab1;
669 	    z->bra = z->c; /* ], line 175 */
670 	    if (!(out_grouping_b_U(z, g_V1, 97, 246))) goto lab1;
671 	    {	int ret;
672 		ret = slice_del(z); /* delete, line 175 */
673 		if (ret < 0) return ret;
674 	    }
675 	lab1:
676 	    z->c = z->l - m;
677 	}
678 	{   int m = z->l - z->c; (void) m; /* do, line 176 */
679 	    z->ket = z->c; /* [, line 176 */
680 	    if (!(eq_s_b(z, 1, s_15))) goto lab2;
681 	    z->bra = z->c; /* ], line 176 */
682 	    {	int m = z->l - z->c; (void) m; /* or, line 176 */
683 		if (!(eq_s_b(z, 1, s_16))) goto lab4;
684 		goto lab3;
685 	    lab4:
686 		z->c = z->l - m;
687 		if (!(eq_s_b(z, 1, s_17))) goto lab2;
688 	    }
689 	lab3:
690 	    {	int ret;
691 		ret = slice_del(z); /* delete, line 176 */
692 		if (ret < 0) return ret;
693 	    }
694 	lab2:
695 	    z->c = z->l - m;
696 	}
697 	{   int m = z->l - z->c; (void) m; /* do, line 177 */
698 	    z->ket = z->c; /* [, line 177 */
699 	    if (!(eq_s_b(z, 1, s_18))) goto lab5;
700 	    z->bra = z->c; /* ], line 177 */
701 	    if (!(eq_s_b(z, 1, s_19))) goto lab5;
702 	    {	int ret;
703 		ret = slice_del(z); /* delete, line 177 */
704 		if (ret < 0) return ret;
705 	    }
706 	lab5:
707 	    z->c = z->l - m;
708 	}
709 	z->lb = m3;
710     }
711     while(1) { /* goto, line 179 */
712 	int m = z->l - z->c; (void) m;
713 	if (!(out_grouping_b_U(z, g_V1, 97, 246))) goto lab6;
714 	z->c = z->l - m;
715 	break;
716     lab6:
717 	z->c = z->l - m;
718 	{   int c = skip_utf8(z->p, z->c, z->lb, 0, -1);
719 	    if (c < 0) return 0;
720 	    z->c = c; /* goto, line 179 */
721 	}
722     }
723     z->ket = z->c; /* [, line 179 */
724     {	int c = skip_utf8(z->p, z->c, z->lb, 0, -1);
725 	if (c < 0) return 0;
726 	z->c = c; /* next, line 179 */
727     }
728     z->bra = z->c; /* ], line 179 */
729     z->S[0] = slice_to(z, z->S[0]); /* -> x, line 179 */
730     if (z->S[0] == 0) return -1; /* -> x, line 179 */
731     if (!(eq_v_b(z, z->S[0]))) return 0; /* name x, line 179 */
732     {	int ret;
733 	ret = slice_del(z); /* delete, line 179 */
734 	if (ret < 0) return ret;
735     }
736     return 1;
737 }
738 
739 extern int finnish_UTF_8_stem(struct SN_env * z) {
740     {	int c = z->c; /* do, line 185 */
741 	{   int ret = r_mark_regions(z);
742 	    if (ret == 0) goto lab0; /* call mark_regions, line 185 */
743 	    if (ret < 0) return ret;
744 	}
745     lab0:
746 	z->c = c;
747     }
748     z->B[0] = 0; /* unset ending_removed, line 186 */
749     z->lb = z->c; z->c = z->l; /* backwards, line 187 */
750 
751     {	int m = z->l - z->c; (void) m; /* do, line 188 */
752 	{   int ret = r_particle_etc(z);
753 	    if (ret == 0) goto lab1; /* call particle_etc, line 188 */
754 	    if (ret < 0) return ret;
755 	}
756     lab1:
757 	z->c = z->l - m;
758     }
759     {	int m = z->l - z->c; (void) m; /* do, line 189 */
760 	{   int ret = r_possessive(z);
761 	    if (ret == 0) goto lab2; /* call possessive, line 189 */
762 	    if (ret < 0) return ret;
763 	}
764     lab2:
765 	z->c = z->l - m;
766     }
767     {	int m = z->l - z->c; (void) m; /* do, line 190 */
768 	{   int ret = r_case_ending(z);
769 	    if (ret == 0) goto lab3; /* call case_ending, line 190 */
770 	    if (ret < 0) return ret;
771 	}
772     lab3:
773 	z->c = z->l - m;
774     }
775     {	int m = z->l - z->c; (void) m; /* do, line 191 */
776 	{   int ret = r_other_endings(z);
777 	    if (ret == 0) goto lab4; /* call other_endings, line 191 */
778 	    if (ret < 0) return ret;
779 	}
780     lab4:
781 	z->c = z->l - m;
782     }
783     {	int m = z->l - z->c; (void) m; /* or, line 192 */
784 	if (!(z->B[0])) goto lab6; /* Boolean test ending_removed, line 192 */
785 	{   int m = z->l - z->c; (void) m; /* do, line 192 */
786 	    {	int ret = r_i_plural(z);
787 		if (ret == 0) goto lab7; /* call i_plural, line 192 */
788 		if (ret < 0) return ret;
789 	    }
790 	lab7:
791 	    z->c = z->l - m;
792 	}
793 	goto lab5;
794     lab6:
795 	z->c = z->l - m;
796 	{   int m = z->l - z->c; (void) m; /* do, line 192 */
797 	    {	int ret = r_t_plural(z);
798 		if (ret == 0) goto lab8; /* call t_plural, line 192 */
799 		if (ret < 0) return ret;
800 	    }
801 	lab8:
802 	    z->c = z->l - m;
803 	}
804     }
805 lab5:
806     {	int m = z->l - z->c; (void) m; /* do, line 193 */
807 	{   int ret = r_tidy(z);
808 	    if (ret == 0) goto lab9; /* call tidy, line 193 */
809 	    if (ret < 0) return ret;
810 	}
811     lab9:
812 	z->c = z->l - m;
813     }
814     z->c = z->lb;
815     return 1;
816 }
817 
818 extern struct SN_env * finnish_UTF_8_create_env(void) { return SN_create_env(1, 2, 1); }
819 
820 extern void finnish_UTF_8_close_env(struct SN_env * z) { SN_close_env(z); }