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