YAZ 5.35.1
stem_UTF_8_porter.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 porter_UTF_8_stem (struct SN_env *z);
11#ifdef __cplusplus
12}
13#endif
14static int r_Step_5b (struct SN_env *z);
15static int r_Step_5a (struct SN_env *z);
16static int r_Step_4 (struct SN_env *z);
17static int r_Step_3 (struct SN_env *z);
18static int r_Step_2 (struct SN_env *z);
19static int r_Step_1c (struct SN_env *z);
20static int r_Step_1b (struct SN_env *z);
21static int r_Step_1a (struct SN_env *z);
22static int r_R2 (struct SN_env *z);
23static int r_R1 (struct SN_env *z);
24static int r_shortv (struct SN_env *z);
25#ifdef __cplusplus
26extern "C"
27{
28#endif
29
30
31 extern struct SN_env *porter_UTF_8_create_env (void);
32 extern void porter_UTF_8_close_env (struct SN_env *z);
33
34
35#ifdef __cplusplus
36}
37#endif
38static const symbol s_0_0[1] = { 's' };
39static const symbol s_0_1[3] = { 'i', 'e', 's' };
40static const symbol s_0_2[4] = { 's', 's', 'e', 's' };
41static const symbol s_0_3[2] = { 's', 's' };
42
43static const struct among a_0[4] = {
44/* 0 */ {1, s_0_0, -1, 3, 0},
45/* 1 */ {3, s_0_1, 0, 2, 0},
46/* 2 */ {4, s_0_2, 0, 1, 0},
47/* 3 */ {2, s_0_3, 0, -1, 0}
48};
49
50static const symbol s_1_1[2] = { 'b', 'b' };
51static const symbol s_1_2[2] = { 'd', 'd' };
52static const symbol s_1_3[2] = { 'f', 'f' };
53static const symbol s_1_4[2] = { 'g', 'g' };
54static const symbol s_1_5[2] = { 'b', 'l' };
55static const symbol s_1_6[2] = { 'm', 'm' };
56static const symbol s_1_7[2] = { 'n', 'n' };
57static const symbol s_1_8[2] = { 'p', 'p' };
58static const symbol s_1_9[2] = { 'r', 'r' };
59static const symbol s_1_10[2] = { 'a', 't' };
60static const symbol s_1_11[2] = { 't', 't' };
61static const symbol s_1_12[2] = { 'i', 'z' };
62
63static const struct among a_1[13] = {
64/* 0 */ {0, 0, -1, 3, 0},
65/* 1 */ {2, s_1_1, 0, 2, 0},
66/* 2 */ {2, s_1_2, 0, 2, 0},
67/* 3 */ {2, s_1_3, 0, 2, 0},
68/* 4 */ {2, s_1_4, 0, 2, 0},
69/* 5 */ {2, s_1_5, 0, 1, 0},
70/* 6 */ {2, s_1_6, 0, 2, 0},
71/* 7 */ {2, s_1_7, 0, 2, 0},
72/* 8 */ {2, s_1_8, 0, 2, 0},
73/* 9 */ {2, s_1_9, 0, 2, 0},
74/* 10 */ {2, s_1_10, 0, 1, 0},
75/* 11 */ {2, s_1_11, 0, 2, 0},
76/* 12 */ {2, s_1_12, 0, 1, 0}
77};
78
79static const symbol s_2_0[2] = { 'e', 'd' };
80static const symbol s_2_1[3] = { 'e', 'e', 'd' };
81static const symbol s_2_2[3] = { 'i', 'n', 'g' };
82
83static const struct among a_2[3] = {
84/* 0 */ {2, s_2_0, -1, 2, 0},
85/* 1 */ {3, s_2_1, 0, 1, 0},
86/* 2 */ {3, s_2_2, -1, 2, 0}
87};
88
89static const symbol s_3_0[4] = { 'a', 'n', 'c', 'i' };
90static const symbol s_3_1[4] = { 'e', 'n', 'c', 'i' };
91static const symbol s_3_2[4] = { 'a', 'b', 'l', 'i' };
92static const symbol s_3_3[3] = { 'e', 'l', 'i' };
93static const symbol s_3_4[4] = { 'a', 'l', 'l', 'i' };
94static const symbol s_3_5[5] = { 'o', 'u', 's', 'l', 'i' };
95static const symbol s_3_6[5] = { 'e', 'n', 't', 'l', 'i' };
96static const symbol s_3_7[5] = { 'a', 'l', 'i', 't', 'i' };
97static const symbol s_3_8[6] = { 'b', 'i', 'l', 'i', 't', 'i' };
98static const symbol s_3_9[5] = { 'i', 'v', 'i', 't', 'i' };
99static const symbol s_3_10[6] = { 't', 'i', 'o', 'n', 'a', 'l' };
100static const symbol s_3_11[7] = { 'a', 't', 'i', 'o', 'n', 'a', 'l' };
101static const symbol s_3_12[5] = { 'a', 'l', 'i', 's', 'm' };
102static const symbol s_3_13[5] = { 'a', 't', 'i', 'o', 'n' };
103static const symbol s_3_14[7] = { 'i', 'z', 'a', 't', 'i', 'o', 'n' };
104static const symbol s_3_15[4] = { 'i', 'z', 'e', 'r' };
105static const symbol s_3_16[4] = { 'a', 't', 'o', 'r' };
106static const symbol s_3_17[7] = { 'i', 'v', 'e', 'n', 'e', 's', 's' };
107static const symbol s_3_18[7] = { 'f', 'u', 'l', 'n', 'e', 's', 's' };
108static const symbol s_3_19[7] = { 'o', 'u', 's', 'n', 'e', 's', 's' };
109
110static const struct among a_3[20] = {
111/* 0 */ {4, s_3_0, -1, 3, 0},
112/* 1 */ {4, s_3_1, -1, 2, 0},
113/* 2 */ {4, s_3_2, -1, 4, 0},
114/* 3 */ {3, s_3_3, -1, 6, 0},
115/* 4 */ {4, s_3_4, -1, 9, 0},
116/* 5 */ {5, s_3_5, -1, 12, 0},
117/* 6 */ {5, s_3_6, -1, 5, 0},
118/* 7 */ {5, s_3_7, -1, 10, 0},
119/* 8 */ {6, s_3_8, -1, 14, 0},
120/* 9 */ {5, s_3_9, -1, 13, 0},
121/* 10 */ {6, s_3_10, -1, 1, 0},
122/* 11 */ {7, s_3_11, 10, 8, 0},
123/* 12 */ {5, s_3_12, -1, 10, 0},
124/* 13 */ {5, s_3_13, -1, 8, 0},
125/* 14 */ {7, s_3_14, 13, 7, 0},
126/* 15 */ {4, s_3_15, -1, 7, 0},
127/* 16 */ {4, s_3_16, -1, 8, 0},
128/* 17 */ {7, s_3_17, -1, 13, 0},
129/* 18 */ {7, s_3_18, -1, 11, 0},
130/* 19 */ {7, s_3_19, -1, 12, 0}
131};
132
133static const symbol s_4_0[5] = { 'i', 'c', 'a', 't', 'e' };
134static const symbol s_4_1[5] = { 'a', 't', 'i', 'v', 'e' };
135static const symbol s_4_2[5] = { 'a', 'l', 'i', 'z', 'e' };
136static const symbol s_4_3[5] = { 'i', 'c', 'i', 't', 'i' };
137static const symbol s_4_4[4] = { 'i', 'c', 'a', 'l' };
138static const symbol s_4_5[3] = { 'f', 'u', 'l' };
139static const symbol s_4_6[4] = { 'n', 'e', 's', 's' };
140
141static const struct among a_4[7] = {
142/* 0 */ {5, s_4_0, -1, 2, 0},
143/* 1 */ {5, s_4_1, -1, 3, 0},
144/* 2 */ {5, s_4_2, -1, 1, 0},
145/* 3 */ {5, s_4_3, -1, 2, 0},
146/* 4 */ {4, s_4_4, -1, 2, 0},
147/* 5 */ {3, s_4_5, -1, 3, 0},
148/* 6 */ {4, s_4_6, -1, 3, 0}
149};
150
151static const symbol s_5_0[2] = { 'i', 'c' };
152static const symbol s_5_1[4] = { 'a', 'n', 'c', 'e' };
153static const symbol s_5_2[4] = { 'e', 'n', 'c', 'e' };
154static const symbol s_5_3[4] = { 'a', 'b', 'l', 'e' };
155static const symbol s_5_4[4] = { 'i', 'b', 'l', 'e' };
156static const symbol s_5_5[3] = { 'a', 't', 'e' };
157static const symbol s_5_6[3] = { 'i', 'v', 'e' };
158static const symbol s_5_7[3] = { 'i', 'z', 'e' };
159static const symbol s_5_8[3] = { 'i', 't', 'i' };
160static const symbol s_5_9[2] = { 'a', 'l' };
161static const symbol s_5_10[3] = { 'i', 's', 'm' };
162static const symbol s_5_11[3] = { 'i', 'o', 'n' };
163static const symbol s_5_12[2] = { 'e', 'r' };
164static const symbol s_5_13[3] = { 'o', 'u', 's' };
165static const symbol s_5_14[3] = { 'a', 'n', 't' };
166static const symbol s_5_15[3] = { 'e', 'n', 't' };
167static const symbol s_5_16[4] = { 'm', 'e', 'n', 't' };
168static const symbol s_5_17[5] = { 'e', 'm', 'e', 'n', 't' };
169static const symbol s_5_18[2] = { 'o', 'u' };
170
171static const struct among a_5[19] = {
172/* 0 */ {2, s_5_0, -1, 1, 0},
173/* 1 */ {4, s_5_1, -1, 1, 0},
174/* 2 */ {4, s_5_2, -1, 1, 0},
175/* 3 */ {4, s_5_3, -1, 1, 0},
176/* 4 */ {4, s_5_4, -1, 1, 0},
177/* 5 */ {3, s_5_5, -1, 1, 0},
178/* 6 */ {3, s_5_6, -1, 1, 0},
179/* 7 */ {3, s_5_7, -1, 1, 0},
180/* 8 */ {3, s_5_8, -1, 1, 0},
181/* 9 */ {2, s_5_9, -1, 1, 0},
182/* 10 */ {3, s_5_10, -1, 1, 0},
183/* 11 */ {3, s_5_11, -1, 2, 0},
184/* 12 */ {2, s_5_12, -1, 1, 0},
185/* 13 */ {3, s_5_13, -1, 1, 0},
186/* 14 */ {3, s_5_14, -1, 1, 0},
187/* 15 */ {3, s_5_15, -1, 1, 0},
188/* 16 */ {4, s_5_16, 15, 1, 0},
189/* 17 */ {5, s_5_17, 16, 1, 0},
190/* 18 */ {2, s_5_18, -1, 1, 0}
191};
192
193static const unsigned char g_v[] = { 17, 65, 16, 1 };
194
195static const unsigned char g_v_WXY[] = { 1, 17, 65, 208, 1 };
196
197static const symbol s_0[] = { 's', 's' };
198static const symbol s_1[] = { 'i' };
199static const symbol s_2[] = { 'e', 'e' };
200static const symbol s_3[] = { 'e' };
201static const symbol s_4[] = { 'e' };
202static const symbol s_5[] = { 'y' };
203static const symbol s_6[] = { 'Y' };
204static const symbol s_7[] = { 'i' };
205static const symbol s_8[] = { 't', 'i', 'o', 'n' };
206static const symbol s_9[] = { 'e', 'n', 'c', 'e' };
207static const symbol s_10[] = { 'a', 'n', 'c', 'e' };
208static const symbol s_11[] = { 'a', 'b', 'l', 'e' };
209static const symbol s_12[] = { 'e', 'n', 't' };
210static const symbol s_13[] = { 'e' };
211static const symbol s_14[] = { 'i', 'z', 'e' };
212static const symbol s_15[] = { 'a', 't', 'e' };
213static const symbol s_16[] = { 'a', 'l' };
214static const symbol s_17[] = { 'a', 'l' };
215static const symbol s_18[] = { 'f', 'u', 'l' };
216static const symbol s_19[] = { 'o', 'u', 's' };
217static const symbol s_20[] = { 'i', 'v', 'e' };
218static const symbol s_21[] = { 'b', 'l', 'e' };
219static const symbol s_22[] = { 'a', 'l' };
220static const symbol s_23[] = { 'i', 'c' };
221static const symbol s_24[] = { 's' };
222static const symbol s_25[] = { 't' };
223static const symbol s_26[] = { 'e' };
224static const symbol s_27[] = { 'l' };
225static const symbol s_28[] = { 'l' };
226static const symbol s_29[] = { 'y' };
227static const symbol s_30[] = { 'Y' };
228static const symbol s_31[] = { 'y' };
229static const symbol s_32[] = { 'Y' };
230static const symbol s_33[] = { 'Y' };
231static const symbol s_34[] = { 'y' };
232
233static int
234r_shortv (struct SN_env *z)
235{
236 if (out_grouping_b_U (z, g_v_WXY, 89, 121, 0))
237 return 0;
238 if (in_grouping_b_U (z, g_v, 97, 121, 0))
239 return 0;
240 if (out_grouping_b_U (z, g_v, 97, 121, 0))
241 return 0;
242 return 1;
243}
244
245static int
246r_R1 (struct SN_env *z)
247{
248 if (!(z->I[0] <= z->c))
249 return 0;
250 return 1;
251}
252
253static int
254r_R2 (struct SN_env *z)
255{
256 if (!(z->I[1] <= z->c))
257 return 0;
258 return 1;
259}
260
261static int
262r_Step_1a (struct SN_env *z)
263{
264 int among_var;
265 z->ket = z->c; /* [, line 25 */
266 if (z->c <= z->lb || z->p[z->c - 1] != 115)
267 return 0;
268 among_var = find_among_b (z, a_0, 4); /* substring, line 25 */
269 if (!(among_var))
270 return 0;
271 z->bra = z->c; /* ], line 25 */
272 switch (among_var)
273 {
274 case 0:
275 return 0;
276 case 1:
277 {
278 int ret = slice_from_s (z, 2, s_0); /* <-, line 26 */
279 if (ret < 0)
280 return ret;
281 }
282 break;
283 case 2:
284 {
285 int ret = slice_from_s (z, 1, s_1); /* <-, line 27 */
286 if (ret < 0)
287 return ret;
288 }
289 break;
290 case 3:
291 {
292 int ret = slice_del (z); /* delete, line 29 */
293 if (ret < 0)
294 return ret;
295 }
296 break;
297 }
298 return 1;
299}
300
301static int
302r_Step_1b (struct SN_env *z)
303{
304 int among_var;
305 z->ket = z->c; /* [, line 34 */
306 if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 100 && z->p[z->c - 1] != 103))
307 return 0;
308 among_var = find_among_b (z, a_2, 3); /* substring, line 34 */
309 if (!(among_var))
310 return 0;
311 z->bra = z->c; /* ], line 34 */
312 switch (among_var)
313 {
314 case 0:
315 return 0;
316 case 1:
317 {
318 int ret = r_R1 (z);
319 if (ret == 0)
320 return 0; /* call R1, line 35 */
321 if (ret < 0)
322 return ret;
323 }
324 {
325 int ret = slice_from_s (z, 2, s_2); /* <-, line 35 */
326 if (ret < 0)
327 return ret;
328 }
329 break;
330 case 2:
331 {
332 int m_test = z->l - z->c; /* test, line 38 */
333 { /* gopast *//* grouping v, line 38 */
334 int ret = out_grouping_b_U (z, g_v, 97, 121, 1);
335 if (ret < 0)
336 return 0;
337 z->c -= ret;
338 }
339 z->c = z->l - m_test;
340 }
341 {
342 int ret = slice_del (z); /* delete, line 38 */
343 if (ret < 0)
344 return ret;
345 }
346 {
347 int m_test = z->l - z->c; /* test, line 39 */
348 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3
349 || !((68514004 >> (z->p[z->c - 1] & 0x1f)) & 1))
350 among_var = 3;
351 else
352 among_var = find_among_b (z, a_1, 13); /* substring, line 39 */
353 if (!(among_var))
354 return 0;
355 z->c = z->l - m_test;
356 }
357 switch (among_var)
358 {
359 case 0:
360 return 0;
361 case 1:
362 {
363 int c_keep = z->c;
364 int ret = insert_s (z, z->c, z->c, 1, s_3); /* <+, line 41 */
365 z->c = c_keep;
366 if (ret < 0)
367 return ret;
368 }
369 break;
370 case 2:
371 z->ket = z->c; /* [, line 44 */
372 {
373 int ret = skip_utf8 (z->p, z->c, z->lb, 0, -1);
374 if (ret < 0)
375 return 0;
376 z->c = ret; /* next, line 44 */
377 }
378 z->bra = z->c; /* ], line 44 */
379 {
380 int ret = slice_del (z); /* delete, line 44 */
381 if (ret < 0)
382 return ret;
383 }
384 break;
385 case 3:
386 if (z->c != z->I[0])
387 return 0; /* atmark, line 45 */
388 {
389 int m_test = z->l - z->c; /* test, line 45 */
390 {
391 int ret = r_shortv (z);
392 if (ret == 0)
393 return 0; /* call shortv, line 45 */
394 if (ret < 0)
395 return ret;
396 }
397 z->c = z->l - m_test;
398 }
399 {
400 int c_keep = z->c;
401 int ret = insert_s (z, z->c, z->c, 1, s_4); /* <+, line 45 */
402 z->c = c_keep;
403 if (ret < 0)
404 return ret;
405 }
406 break;
407 }
408 break;
409 }
410 return 1;
411}
412
413static int
414r_Step_1c (struct SN_env *z)
415{
416 z->ket = z->c; /* [, line 52 */
417 {
418 int m1 = z->l - z->c;
419 (void) m1; /* or, line 52 */
420 if (!(eq_s_b (z, 1, s_5)))
421 goto lab1;
422 goto lab0;
423 lab1:
424 z->c = z->l - m1;
425 if (!(eq_s_b (z, 1, s_6)))
426 return 0;
427 }
428lab0:
429 z->bra = z->c; /* ], line 52 */
430 { /* gopast *//* grouping v, line 53 */
431 int ret = out_grouping_b_U (z, g_v, 97, 121, 1);
432 if (ret < 0)
433 return 0;
434 z->c -= ret;
435 }
436 {
437 int ret = slice_from_s (z, 1, s_7); /* <-, line 54 */
438 if (ret < 0)
439 return ret;
440 }
441 return 1;
442}
443
444static int
445r_Step_2 (struct SN_env *z)
446{
447 int among_var;
448 z->ket = z->c; /* [, line 58 */
449 if (z->c - 2 <= z->lb || z->p[z->c - 1] >> 5 != 3
450 || !((815616 >> (z->p[z->c - 1] & 0x1f)) & 1))
451 return 0;
452 among_var = find_among_b (z, a_3, 20); /* substring, line 58 */
453 if (!(among_var))
454 return 0;
455 z->bra = z->c; /* ], line 58 */
456 {
457 int ret = r_R1 (z);
458 if (ret == 0)
459 return 0; /* call R1, line 58 */
460 if (ret < 0)
461 return ret;
462 }
463 switch (among_var)
464 {
465 case 0:
466 return 0;
467 case 1:
468 {
469 int ret = slice_from_s (z, 4, s_8); /* <-, line 59 */
470 if (ret < 0)
471 return ret;
472 }
473 break;
474 case 2:
475 {
476 int ret = slice_from_s (z, 4, s_9); /* <-, line 60 */
477 if (ret < 0)
478 return ret;
479 }
480 break;
481 case 3:
482 {
483 int ret = slice_from_s (z, 4, s_10); /* <-, line 61 */
484 if (ret < 0)
485 return ret;
486 }
487 break;
488 case 4:
489 {
490 int ret = slice_from_s (z, 4, s_11); /* <-, line 62 */
491 if (ret < 0)
492 return ret;
493 }
494 break;
495 case 5:
496 {
497 int ret = slice_from_s (z, 3, s_12); /* <-, line 63 */
498 if (ret < 0)
499 return ret;
500 }
501 break;
502 case 6:
503 {
504 int ret = slice_from_s (z, 1, s_13); /* <-, line 64 */
505 if (ret < 0)
506 return ret;
507 }
508 break;
509 case 7:
510 {
511 int ret = slice_from_s (z, 3, s_14); /* <-, line 66 */
512 if (ret < 0)
513 return ret;
514 }
515 break;
516 case 8:
517 {
518 int ret = slice_from_s (z, 3, s_15); /* <-, line 68 */
519 if (ret < 0)
520 return ret;
521 }
522 break;
523 case 9:
524 {
525 int ret = slice_from_s (z, 2, s_16); /* <-, line 69 */
526 if (ret < 0)
527 return ret;
528 }
529 break;
530 case 10:
531 {
532 int ret = slice_from_s (z, 2, s_17); /* <-, line 71 */
533 if (ret < 0)
534 return ret;
535 }
536 break;
537 case 11:
538 {
539 int ret = slice_from_s (z, 3, s_18); /* <-, line 72 */
540 if (ret < 0)
541 return ret;
542 }
543 break;
544 case 12:
545 {
546 int ret = slice_from_s (z, 3, s_19); /* <-, line 74 */
547 if (ret < 0)
548 return ret;
549 }
550 break;
551 case 13:
552 {
553 int ret = slice_from_s (z, 3, s_20); /* <-, line 76 */
554 if (ret < 0)
555 return ret;
556 }
557 break;
558 case 14:
559 {
560 int ret = slice_from_s (z, 3, s_21); /* <-, line 77 */
561 if (ret < 0)
562 return ret;
563 }
564 break;
565 }
566 return 1;
567}
568
569static int
570r_Step_3 (struct SN_env *z)
571{
572 int among_var;
573 z->ket = z->c; /* [, line 82 */
574 if (z->c - 2 <= z->lb || z->p[z->c - 1] >> 5 != 3
575 || !((528928 >> (z->p[z->c - 1] & 0x1f)) & 1))
576 return 0;
577 among_var = find_among_b (z, a_4, 7); /* substring, line 82 */
578 if (!(among_var))
579 return 0;
580 z->bra = z->c; /* ], line 82 */
581 {
582 int ret = r_R1 (z);
583 if (ret == 0)
584 return 0; /* call R1, line 82 */
585 if (ret < 0)
586 return ret;
587 }
588 switch (among_var)
589 {
590 case 0:
591 return 0;
592 case 1:
593 {
594 int ret = slice_from_s (z, 2, s_22); /* <-, line 83 */
595 if (ret < 0)
596 return ret;
597 }
598 break;
599 case 2:
600 {
601 int ret = slice_from_s (z, 2, s_23); /* <-, line 85 */
602 if (ret < 0)
603 return ret;
604 }
605 break;
606 case 3:
607 {
608 int ret = slice_del (z); /* delete, line 87 */
609 if (ret < 0)
610 return ret;
611 }
612 break;
613 }
614 return 1;
615}
616
617static int
618r_Step_4 (struct SN_env *z)
619{
620 int among_var;
621 z->ket = z->c; /* [, line 92 */
622 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3
623 || !((3961384 >> (z->p[z->c - 1] & 0x1f)) & 1))
624 return 0;
625 among_var = find_among_b (z, a_5, 19); /* substring, line 92 */
626 if (!(among_var))
627 return 0;
628 z->bra = z->c; /* ], line 92 */
629 {
630 int ret = r_R2 (z);
631 if (ret == 0)
632 return 0; /* call R2, line 92 */
633 if (ret < 0)
634 return ret;
635 }
636 switch (among_var)
637 {
638 case 0:
639 return 0;
640 case 1:
641 {
642 int ret = slice_del (z); /* delete, line 95 */
643 if (ret < 0)
644 return ret;
645 }
646 break;
647 case 2:
648 {
649 int m1 = z->l - z->c;
650 (void) m1; /* or, line 96 */
651 if (!(eq_s_b (z, 1, s_24)))
652 goto lab1;
653 goto lab0;
654 lab1:
655 z->c = z->l - m1;
656 if (!(eq_s_b (z, 1, s_25)))
657 return 0;
658 }
659 lab0:
660 {
661 int ret = slice_del (z); /* delete, line 96 */
662 if (ret < 0)
663 return ret;
664 }
665 break;
666 }
667 return 1;
668}
669
670static int
671r_Step_5a (struct SN_env *z)
672{
673 z->ket = z->c; /* [, line 101 */
674 if (!(eq_s_b (z, 1, s_26)))
675 return 0;
676 z->bra = z->c; /* ], line 101 */
677 {
678 int m1 = z->l - z->c;
679 (void) m1; /* or, line 102 */
680 {
681 int ret = r_R2 (z);
682 if (ret == 0)
683 goto lab1; /* call R2, line 102 */
684 if (ret < 0)
685 return ret;
686 }
687 goto lab0;
688 lab1:
689 z->c = z->l - m1;
690 {
691 int ret = r_R1 (z);
692 if (ret == 0)
693 return 0; /* call R1, line 102 */
694 if (ret < 0)
695 return ret;
696 }
697 {
698 int m2 = z->l - z->c;
699 (void) m2; /* not, line 102 */
700 {
701 int ret = r_shortv (z);
702 if (ret == 0)
703 goto lab2; /* call shortv, line 102 */
704 if (ret < 0)
705 return ret;
706 }
707 return 0;
708 lab2:
709 z->c = z->l - m2;
710 }
711 }
712lab0:
713 {
714 int ret = slice_del (z); /* delete, line 103 */
715 if (ret < 0)
716 return ret;
717 }
718 return 1;
719}
720
721static int
722r_Step_5b (struct SN_env *z)
723{
724 z->ket = z->c; /* [, line 107 */
725 if (!(eq_s_b (z, 1, s_27)))
726 return 0;
727 z->bra = z->c; /* ], line 107 */
728 {
729 int ret = r_R2 (z);
730 if (ret == 0)
731 return 0; /* call R2, line 108 */
732 if (ret < 0)
733 return ret;
734 }
735 if (!(eq_s_b (z, 1, s_28)))
736 return 0;
737 {
738 int ret = slice_del (z); /* delete, line 109 */
739 if (ret < 0)
740 return ret;
741 }
742 return 1;
743}
744
745extern int
747{
748 z->B[0] = 0; /* unset Y_found, line 115 */
749 {
750 int c1 = z->c; /* do, line 116 */
751 z->bra = z->c; /* [, line 116 */
752 if (!(eq_s (z, 1, s_29)))
753 goto lab0;
754 z->ket = z->c; /* ], line 116 */
755 {
756 int ret = slice_from_s (z, 1, s_30); /* <-, line 116 */
757 if (ret < 0)
758 return ret;
759 }
760 z->B[0] = 1; /* set Y_found, line 116 */
761 lab0:
762 z->c = c1;
763 }
764 {
765 int c2 = z->c; /* do, line 117 */
766 while (1)
767 { /* repeat, line 117 */
768 int c3 = z->c;
769 while (1)
770 { /* goto, line 117 */
771 int c4 = z->c;
772 if (in_grouping_U (z, g_v, 97, 121, 0))
773 goto lab3;
774 z->bra = z->c; /* [, line 117 */
775 if (!(eq_s (z, 1, s_31)))
776 goto lab3;
777 z->ket = z->c; /* ], line 117 */
778 z->c = c4;
779 break;
780 lab3:
781 z->c = c4;
782 {
783 int ret = skip_utf8 (z->p, z->c, 0, z->l, 1);
784 if (ret < 0)
785 goto lab2;
786 z->c = ret; /* goto, line 117 */
787 }
788 }
789 {
790 int ret = slice_from_s (z, 1, s_32); /* <-, line 117 */
791 if (ret < 0)
792 return ret;
793 }
794 z->B[0] = 1; /* set Y_found, line 117 */
795 continue;
796 lab2:
797 z->c = c3;
798 break;
799 }
800 z->c = c2;
801 }
802 z->I[0] = z->l;
803 z->I[1] = z->l;
804 {
805 int c5 = z->c; /* do, line 121 */
806 { /* gopast *//* grouping v, line 122 */
807 int ret = out_grouping_U (z, g_v, 97, 121, 1);
808 if (ret < 0)
809 goto lab4;
810 z->c += ret;
811 }
812 { /* gopast *//* non v, line 122 */
813 int ret = in_grouping_U (z, g_v, 97, 121, 1);
814 if (ret < 0)
815 goto lab4;
816 z->c += ret;
817 }
818 z->I[0] = z->c; /* setmark p1, line 122 */
819 { /* gopast *//* grouping v, line 123 */
820 int ret = out_grouping_U (z, g_v, 97, 121, 1);
821 if (ret < 0)
822 goto lab4;
823 z->c += ret;
824 }
825 { /* gopast *//* non v, line 123 */
826 int ret = in_grouping_U (z, g_v, 97, 121, 1);
827 if (ret < 0)
828 goto lab4;
829 z->c += ret;
830 }
831 z->I[1] = z->c; /* setmark p2, line 123 */
832 lab4:
833 z->c = c5;
834 }
835 z->lb = z->c;
836 z->c = z->l; /* backwards, line 126 */
837
838 {
839 int m6 = z->l - z->c;
840 (void) m6; /* do, line 127 */
841 {
842 int ret = r_Step_1a (z);
843 if (ret == 0)
844 goto lab5; /* call Step_1a, line 127 */
845 if (ret < 0)
846 return ret;
847 }
848 lab5:
849 z->c = z->l - m6;
850 }
851 {
852 int m7 = z->l - z->c;
853 (void) m7; /* do, line 128 */
854 {
855 int ret = r_Step_1b (z);
856 if (ret == 0)
857 goto lab6; /* call Step_1b, line 128 */
858 if (ret < 0)
859 return ret;
860 }
861 lab6:
862 z->c = z->l - m7;
863 }
864 {
865 int m8 = z->l - z->c;
866 (void) m8; /* do, line 129 */
867 {
868 int ret = r_Step_1c (z);
869 if (ret == 0)
870 goto lab7; /* call Step_1c, line 129 */
871 if (ret < 0)
872 return ret;
873 }
874 lab7:
875 z->c = z->l - m8;
876 }
877 {
878 int m9 = z->l - z->c;
879 (void) m9; /* do, line 130 */
880 {
881 int ret = r_Step_2 (z);
882 if (ret == 0)
883 goto lab8; /* call Step_2, line 130 */
884 if (ret < 0)
885 return ret;
886 }
887 lab8:
888 z->c = z->l - m9;
889 }
890 {
891 int m10 = z->l - z->c;
892 (void) m10; /* do, line 131 */
893 {
894 int ret = r_Step_3 (z);
895 if (ret == 0)
896 goto lab9; /* call Step_3, line 131 */
897 if (ret < 0)
898 return ret;
899 }
900 lab9:
901 z->c = z->l - m10;
902 }
903 {
904 int m11 = z->l - z->c;
905 (void) m11; /* do, line 132 */
906 {
907 int ret = r_Step_4 (z);
908 if (ret == 0)
909 goto lab10; /* call Step_4, line 132 */
910 if (ret < 0)
911 return ret;
912 }
913 lab10:
914 z->c = z->l - m11;
915 }
916 {
917 int m12 = z->l - z->c;
918 (void) m12; /* do, line 133 */
919 {
920 int ret = r_Step_5a (z);
921 if (ret == 0)
922 goto lab11; /* call Step_5a, line 133 */
923 if (ret < 0)
924 return ret;
925 }
926 lab11:
927 z->c = z->l - m12;
928 }
929 {
930 int m13 = z->l - z->c;
931 (void) m13; /* do, line 134 */
932 {
933 int ret = r_Step_5b (z);
934 if (ret == 0)
935 goto lab12; /* call Step_5b, line 134 */
936 if (ret < 0)
937 return ret;
938 }
939 lab12:
940 z->c = z->l - m13;
941 }
942 z->c = z->lb;
943 {
944 int c14 = z->c; /* do, line 137 */
945 if (!(z->B[0]))
946 goto lab13; /* Boolean test Y_found, line 137 */
947 while (1)
948 { /* repeat, line 137 */
949 int c15 = z->c;
950 while (1)
951 { /* goto, line 137 */
952 int c16 = z->c;
953 z->bra = z->c; /* [, line 137 */
954 if (!(eq_s (z, 1, s_33)))
955 goto lab15;
956 z->ket = z->c; /* ], line 137 */
957 z->c = c16;
958 break;
959 lab15:
960 z->c = c16;
961 {
962 int ret = skip_utf8 (z->p, z->c, 0, z->l, 1);
963 if (ret < 0)
964 goto lab14;
965 z->c = ret; /* goto, line 137 */
966 }
967 }
968 {
969 int ret = slice_from_s (z, 1, s_34); /* <-, line 137 */
970 if (ret < 0)
971 return ret;
972 }
973 continue;
974 lab14:
975 z->c = c15;
976 break;
977 }
978 lab13:
979 z->c = c14;
980 }
981 return 1;
982}
983
984extern struct SN_env *
986{
987 return SN_create_env (0, 2, 1);
988}
989
990extern void
992{
993 SN_close_env (z, 0);
994}
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 insert_s(struct SN_env *z, int bra, int ket, int s_size, const symbol *s)
Definition utilities.c:579
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_s(struct SN_env *z, int s_size, const symbol *s)
Definition utilities.c:280
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
int slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition utilities.c:559
static const symbol s_0_2[4]
static const symbol s_1_5[2]
static const symbol s_25[]
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 const symbol s_30[]
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_29[]
static const symbol s_4_4[4]
static const symbol s_2_0[2]
static const symbol s_27[]
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_32[]
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_24[]
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_31[]
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 const symbol s_33[]
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_28[]
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_26[]
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_34[]
static const symbol s_3_11[7]
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
Definition header.h:16