LCOV - code coverage report
Current view: top level - src/backend/snowball/libstemmer - stem_UTF_8_finnish.c (source / functions) Hit Total Coverage
Test: PostgreSQL 14devel Lines: 0 325 0.0 %
Date: 2020-09-25 17:06:10 Functions: 0 14 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* Generated by Snowball 2.0.0 - https://snowballstem.org/ */
       2             : 
       3             : #include "header.h"
       4             : 
       5             : #ifdef __cplusplus
       6             : extern "C" {
       7             : #endif
       8             : extern int finnish_UTF_8_stem(struct SN_env * z);
       9             : #ifdef __cplusplus
      10             : }
      11             : #endif
      12             : static int r_tidy(struct SN_env * z);
      13             : static int r_other_endings(struct SN_env * z);
      14             : static int r_t_plural(struct SN_env * z);
      15             : static int r_i_plural(struct SN_env * z);
      16             : static int r_case_ending(struct SN_env * z);
      17             : static int r_VI(struct SN_env * z);
      18             : static int r_LONG(struct SN_env * z);
      19             : static int r_possessive(struct SN_env * z);
      20             : static int r_particle_etc(struct SN_env * z);
      21             : static int r_R2(struct SN_env * z);
      22             : static int r_mark_regions(struct SN_env * z);
      23             : #ifdef __cplusplus
      24             : extern "C" {
      25             : #endif
      26             : 
      27             : 
      28             : extern struct SN_env * finnish_UTF_8_create_env(void);
      29             : extern void finnish_UTF_8_close_env(struct SN_env * z);
      30             : 
      31             : 
      32             : #ifdef __cplusplus
      33             : }
      34             : #endif
      35             : static const symbol s_0_0[2] = { 'p', 'a' };
      36             : static const symbol s_0_1[3] = { 's', 't', 'i' };
      37             : static const symbol s_0_2[4] = { 'k', 'a', 'a', 'n' };
      38             : static const symbol s_0_3[3] = { 'h', 'a', 'n' };
      39             : static const symbol s_0_4[3] = { 'k', 'i', 'n' };
      40             : static const symbol s_0_5[4] = { 'h', 0xC3, 0xA4, 'n' };
      41             : static const symbol s_0_6[6] = { 'k', 0xC3, 0xA4, 0xC3, 0xA4, 'n' };
      42             : static const symbol s_0_7[2] = { 'k', 'o' };
      43             : static const symbol s_0_8[3] = { 'p', 0xC3, 0xA4 };
      44             : static const symbol s_0_9[3] = { 'k', 0xC3, 0xB6 };
      45             : 
      46             : static const 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 const symbol s_1_0[3] = { 'l', 'l', 'a' };
      61             : static const symbol s_1_1[2] = { 'n', 'a' };
      62             : static const symbol s_1_2[3] = { 's', 's', 'a' };
      63             : static const symbol s_1_3[2] = { 't', 'a' };
      64             : static const symbol s_1_4[3] = { 'l', 't', 'a' };
      65             : static const symbol s_1_5[3] = { 's', 't', 'a' };
      66             : 
      67             : static const 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 const symbol s_2_0[4] = { 'l', 'l', 0xC3, 0xA4 };
      78             : static const symbol s_2_1[3] = { 'n', 0xC3, 0xA4 };
      79             : static const symbol s_2_2[4] = { 's', 's', 0xC3, 0xA4 };
      80             : static const symbol s_2_3[3] = { 't', 0xC3, 0xA4 };
      81             : static const symbol s_2_4[4] = { 'l', 't', 0xC3, 0xA4 };
      82             : static const symbol s_2_5[4] = { 's', 't', 0xC3, 0xA4 };
      83             : 
      84             : static const 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 const symbol s_3_0[3] = { 'l', 'l', 'e' };
      95             : static const symbol s_3_1[3] = { 'i', 'n', 'e' };
      96             : 
      97             : static const 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 const symbol s_4_0[3] = { 'n', 's', 'a' };
     104             : static const symbol s_4_1[3] = { 'm', 'm', 'e' };
     105             : static const symbol s_4_2[3] = { 'n', 'n', 'e' };
     106             : static const symbol s_4_3[2] = { 'n', 'i' };
     107             : static const symbol s_4_4[2] = { 's', 'i' };
     108             : static const symbol s_4_5[2] = { 'a', 'n' };
     109             : static const symbol s_4_6[2] = { 'e', 'n' };
     110             : static const symbol s_4_7[3] = { 0xC3, 0xA4, 'n' };
     111             : static const symbol s_4_8[4] = { 'n', 's', 0xC3, 0xA4 };
     112             : 
     113             : static const 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 const symbol s_5_0[2] = { 'a', 'a' };
     127             : static const symbol s_5_1[2] = { 'e', 'e' };
     128             : static const symbol s_5_2[2] = { 'i', 'i' };
     129             : static const symbol s_5_3[2] = { 'o', 'o' };
     130             : static const symbol s_5_4[2] = { 'u', 'u' };
     131             : static const symbol s_5_5[4] = { 0xC3, 0xA4, 0xC3, 0xA4 };
     132             : static const symbol s_5_6[4] = { 0xC3, 0xB6, 0xC3, 0xB6 };
     133             : 
     134             : static const 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 const symbol s_6_0[1] = { 'a' };
     146             : static const symbol s_6_1[3] = { 'l', 'l', 'a' };
     147             : static const symbol s_6_2[2] = { 'n', 'a' };
     148             : static const symbol s_6_3[3] = { 's', 's', 'a' };
     149             : static const symbol s_6_4[2] = { 't', 'a' };
     150             : static const symbol s_6_5[3] = { 'l', 't', 'a' };
     151             : static const symbol s_6_6[3] = { 's', 't', 'a' };
     152             : static const symbol s_6_7[3] = { 't', 't', 'a' };
     153             : static const symbol s_6_8[3] = { 'l', 'l', 'e' };
     154             : static const symbol s_6_9[3] = { 'i', 'n', 'e' };
     155             : static const symbol s_6_10[3] = { 'k', 's', 'i' };
     156             : static const symbol s_6_11[1] = { 'n' };
     157             : static const symbol s_6_12[3] = { 'h', 'a', 'n' };
     158             : static const symbol s_6_13[3] = { 'd', 'e', 'n' };
     159             : static const symbol s_6_14[4] = { 's', 'e', 'e', 'n' };
     160             : static const symbol s_6_15[3] = { 'h', 'e', 'n' };
     161             : static const symbol s_6_16[4] = { 't', 't', 'e', 'n' };
     162             : static const symbol s_6_17[3] = { 'h', 'i', 'n' };
     163             : static const symbol s_6_18[4] = { 's', 'i', 'i', 'n' };
     164             : static const symbol s_6_19[3] = { 'h', 'o', 'n' };
     165             : static const symbol s_6_20[4] = { 'h', 0xC3, 0xA4, 'n' };
     166             : static const symbol s_6_21[4] = { 'h', 0xC3, 0xB6, 'n' };
     167             : static const symbol s_6_22[2] = { 0xC3, 0xA4 };
     168             : static const symbol s_6_23[4] = { 'l', 'l', 0xC3, 0xA4 };
     169             : static const symbol s_6_24[3] = { 'n', 0xC3, 0xA4 };
     170             : static const symbol s_6_25[4] = { 's', 's', 0xC3, 0xA4 };
     171             : static const symbol s_6_26[3] = { 't', 0xC3, 0xA4 };
     172             : static const symbol s_6_27[4] = { 'l', 't', 0xC3, 0xA4 };
     173             : static const symbol s_6_28[4] = { 's', 't', 0xC3, 0xA4 };
     174             : static const symbol s_6_29[4] = { 't', 't', 0xC3, 0xA4 };
     175             : 
     176             : static const 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, 2, 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, 2, 0}
     208             : };
     209             : 
     210             : static const symbol s_7_0[3] = { 'e', 'j', 'a' };
     211             : static const symbol s_7_1[3] = { 'm', 'm', 'a' };
     212             : static const symbol s_7_2[4] = { 'i', 'm', 'm', 'a' };
     213             : static const symbol s_7_3[3] = { 'm', 'p', 'a' };
     214             : static const symbol s_7_4[4] = { 'i', 'm', 'p', 'a' };
     215             : static const symbol s_7_5[3] = { 'm', 'm', 'i' };
     216             : static const symbol s_7_6[4] = { 'i', 'm', 'm', 'i' };
     217             : static const symbol s_7_7[3] = { 'm', 'p', 'i' };
     218             : static const symbol s_7_8[4] = { 'i', 'm', 'p', 'i' };
     219             : static const symbol s_7_9[4] = { 'e', 'j', 0xC3, 0xA4 };
     220             : static const symbol s_7_10[4] = { 'm', 'm', 0xC3, 0xA4 };
     221             : static const symbol s_7_11[5] = { 'i', 'm', 'm', 0xC3, 0xA4 };
     222             : static const symbol s_7_12[4] = { 'm', 'p', 0xC3, 0xA4 };
     223             : static const symbol s_7_13[5] = { 'i', 'm', 'p', 0xC3, 0xA4 };
     224             : 
     225             : static const 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 const symbol s_8_0[1] = { 'i' };
     244             : static const symbol s_8_1[1] = { 'j' };
     245             : 
     246             : static const 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 const symbol s_9_0[3] = { 'm', 'm', 'a' };
     253             : static const symbol s_9_1[4] = { 'i', 'm', 'm', 'a' };
     254             : 
     255             : static const 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 const unsigned char g_AEI[] = { 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8 };
     262             : 
     263             : static const unsigned char g_C[] = { 119, 223, 119, 1 };
     264             : 
     265             : static const unsigned char g_V1[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
     266             : 
     267             : static const unsigned char g_V2[] = { 17, 65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32 };
     268             : 
     269             : static 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 };
     270             : 
     271             : static const symbol s_0[] = { 'k', 's', 'e' };
     272             : static const symbol s_1[] = { 'k', 's', 'i' };
     273             : static const symbol s_2[] = { 0xC3, 0xA4 };
     274             : static const symbol s_3[] = { 0xC3, 0xB6 };
     275             : static const symbol s_4[] = { 'i', 'e' };
     276             : static const symbol s_5[] = { 'p', 'o' };
     277             : static const symbol s_6[] = { 'p', 'o' };
     278             : 
     279           0 : static int r_mark_regions(struct SN_env * z) { /* forwardmode */
     280           0 :     z->I[0] = z->l; /* $p1 = <integer expression>, line 44 */
     281           0 :     z->I[1] = z->l; /* $p2 = <integer expression>, line 45 */
     282           0 :     if (out_grouping_U(z, g_V1, 97, 246, 1) < 0) return 0; /* goto */ /* grouping V1, line 47 */
     283             :     {    /* gopast */ /* non V1, line 47 */
     284           0 :         int ret = in_grouping_U(z, g_V1, 97, 246, 1);
     285           0 :         if (ret < 0) return 0;
     286           0 :         z->c += ret;
     287             :     }
     288           0 :     z->I[0] = z->c; /* setmark p1, line 47 */
     289           0 :     if (out_grouping_U(z, g_V1, 97, 246, 1) < 0) return 0; /* goto */ /* grouping V1, line 48 */
     290             :     {    /* gopast */ /* non V1, line 48 */
     291           0 :         int ret = in_grouping_U(z, g_V1, 97, 246, 1);
     292           0 :         if (ret < 0) return 0;
     293           0 :         z->c += ret;
     294             :     }
     295           0 :     z->I[1] = z->c; /* setmark p2, line 48 */
     296           0 :     return 1;
     297             : }
     298             : 
     299           0 : static int r_R2(struct SN_env * z) { /* backwardmode */
     300           0 :     if (!(z->I[1] <= z->c)) return 0; /* $(<integer expression> <= <integer expression>), line 53 */
     301           0 :     return 1;
     302             : }
     303             : 
     304           0 : static int r_particle_etc(struct SN_env * z) { /* backwardmode */
     305             :     int among_var;
     306             : 
     307             :     {   int mlimit1; /* setlimit, line 56 */
     308           0 :         if (z->c < z->I[0]) return 0;
     309           0 :         mlimit1 = z->lb; z->lb = z->I[0];
     310           0 :         z->ket = z->c; /* [, line 56 */
     311           0 :         among_var = find_among_b(z, a_0, 10); /* substring, line 56 */
     312           0 :         if (!(among_var)) { z->lb = mlimit1; return 0; }
     313           0 :         z->bra = z->c; /* ], line 56 */
     314           0 :         z->lb = mlimit1;
     315             :     }
     316           0 :     switch (among_var) { /* among, line 57 */
     317           0 :         case 1:
     318           0 :             if (in_grouping_b_U(z, g_particle_end, 97, 246, 0)) return 0; /* grouping particle_end, line 63 */
     319           0 :             break;
     320           0 :         case 2:
     321           0 :             {   int ret = r_R2(z); /* call R2, line 65 */
     322           0 :                 if (ret <= 0) return ret;
     323             :             }
     324           0 :             break;
     325             :     }
     326           0 :     {   int ret = slice_del(z); /* delete, line 67 */
     327           0 :         if (ret < 0) return ret;
     328             :     }
     329           0 :     return 1;
     330             : }
     331             : 
     332           0 : static int r_possessive(struct SN_env * z) { /* backwardmode */
     333             :     int among_var;
     334             : 
     335             :     {   int mlimit1; /* setlimit, line 70 */
     336           0 :         if (z->c < z->I[0]) return 0;
     337           0 :         mlimit1 = z->lb; z->lb = z->I[0];
     338           0 :         z->ket = z->c; /* [, line 70 */
     339           0 :         among_var = find_among_b(z, a_4, 9); /* substring, line 70 */
     340           0 :         if (!(among_var)) { z->lb = mlimit1; return 0; }
     341           0 :         z->bra = z->c; /* ], line 70 */
     342           0 :         z->lb = mlimit1;
     343             :     }
     344           0 :     switch (among_var) { /* among, line 71 */
     345           0 :         case 1:
     346           0 :             {   int m2 = z->l - z->c; (void)m2; /* not, line 73 */
     347           0 :                 if (z->c <= z->lb || z->p[z->c - 1] != 'k') goto lab0; /* literal, line 73 */
     348           0 :                 z->c--;
     349           0 :                 return 0;
     350           0 :             lab0:
     351           0 :                 z->c = z->l - m2;
     352             :             }
     353           0 :             {   int ret = slice_del(z); /* delete, line 73 */
     354           0 :                 if (ret < 0) return ret;
     355             :             }
     356           0 :             break;
     357           0 :         case 2:
     358           0 :             {   int ret = slice_del(z); /* delete, line 75 */
     359           0 :                 if (ret < 0) return ret;
     360             :             }
     361           0 :             z->ket = z->c; /* [, line 75 */
     362           0 :             if (!(eq_s_b(z, 3, s_0))) return 0; /* literal, line 75 */
     363           0 :             z->bra = z->c; /* ], line 75 */
     364           0 :             {   int ret = slice_from_s(z, 3, s_1); /* <-, line 75 */
     365           0 :                 if (ret < 0) return ret;
     366             :             }
     367           0 :             break;
     368           0 :         case 3:
     369           0 :             {   int ret = slice_del(z); /* delete, line 79 */
     370           0 :                 if (ret < 0) return ret;
     371             :             }
     372           0 :             break;
     373           0 :         case 4:
     374           0 :             if (z->c - 1 <= z->lb || z->p[z->c - 1] != 97) return 0; /* among, line 82 */
     375           0 :             if (!(find_among_b(z, a_1, 6))) return 0;
     376           0 :             {   int ret = slice_del(z); /* delete, line 82 */
     377           0 :                 if (ret < 0) return ret;
     378             :             }
     379           0 :             break;
     380           0 :         case 5:
     381           0 :             if (z->c - 2 <= z->lb || z->p[z->c - 1] != 164) return 0; /* among, line 84 */
     382           0 :             if (!(find_among_b(z, a_2, 6))) return 0;
     383           0 :             {   int ret = slice_del(z); /* delete, line 85 */
     384           0 :                 if (ret < 0) return ret;
     385             :             }
     386           0 :             break;
     387           0 :         case 6:
     388           0 :             if (z->c - 2 <= z->lb || z->p[z->c - 1] != 101) return 0; /* among, line 87 */
     389           0 :             if (!(find_among_b(z, a_3, 2))) return 0;
     390           0 :             {   int ret = slice_del(z); /* delete, line 87 */
     391           0 :                 if (ret < 0) return ret;
     392             :             }
     393           0 :             break;
     394             :     }
     395           0 :     return 1;
     396             : }
     397             : 
     398           0 : static int r_LONG(struct SN_env * z) { /* backwardmode */
     399           0 :     if (!(find_among_b(z, a_5, 7))) return 0; /* among, line 92 */
     400           0 :     return 1;
     401             : }
     402             : 
     403           0 : static int r_VI(struct SN_env * z) { /* backwardmode */
     404           0 :     if (z->c <= z->lb || z->p[z->c - 1] != 'i') return 0; /* literal, line 94 */
     405           0 :     z->c--;
     406           0 :     if (in_grouping_b_U(z, g_V2, 97, 246, 0)) return 0; /* grouping V2, line 94 */
     407           0 :     return 1;
     408             : }
     409             : 
     410           0 : static int r_case_ending(struct SN_env * z) { /* backwardmode */
     411             :     int among_var;
     412             : 
     413             :     {   int mlimit1; /* setlimit, line 97 */
     414           0 :         if (z->c < z->I[0]) return 0;
     415           0 :         mlimit1 = z->lb; z->lb = z->I[0];
     416           0 :         z->ket = z->c; /* [, line 97 */
     417           0 :         among_var = find_among_b(z, a_6, 30); /* substring, line 97 */
     418           0 :         if (!(among_var)) { z->lb = mlimit1; return 0; }
     419           0 :         z->bra = z->c; /* ], line 97 */
     420           0 :         z->lb = mlimit1;
     421             :     }
     422           0 :     switch (among_var) { /* among, line 98 */
     423           0 :         case 1:
     424           0 :             if (z->c <= z->lb || z->p[z->c - 1] != 'a') return 0; /* literal, line 99 */
     425           0 :             z->c--;
     426           0 :             break;
     427           0 :         case 2:
     428           0 :             if (z->c <= z->lb || z->p[z->c - 1] != 'e') return 0; /* literal, line 100 */
     429           0 :             z->c--;
     430           0 :             break;
     431           0 :         case 3:
     432           0 :             if (z->c <= z->lb || z->p[z->c - 1] != 'i') return 0; /* literal, line 101 */
     433           0 :             z->c--;
     434           0 :             break;
     435           0 :         case 4:
     436           0 :             if (z->c <= z->lb || z->p[z->c - 1] != 'o') return 0; /* literal, line 102 */
     437           0 :             z->c--;
     438           0 :             break;
     439           0 :         case 5:
     440           0 :             if (!(eq_s_b(z, 2, s_2))) return 0; /* literal, line 103 */
     441           0 :             break;
     442           0 :         case 6:
     443           0 :             if (!(eq_s_b(z, 2, s_3))) return 0; /* literal, line 104 */
     444           0 :             break;
     445           0 :         case 7:
     446           0 :             {   int m2 = z->l - z->c; (void)m2; /* try, line 112 */
     447           0 :                 {   int m3 = z->l - z->c; (void)m3; /* and, line 114 */
     448           0 :                     {   int m4 = z->l - z->c; (void)m4; /* or, line 113 */
     449           0 :                         {   int ret = r_LONG(z); /* call LONG, line 112 */
     450           0 :                             if (ret == 0) goto lab2;
     451           0 :                             if (ret < 0) return ret;
     452             :                         }
     453           0 :                         goto lab1;
     454           0 :                     lab2:
     455           0 :                         z->c = z->l - m4;
     456           0 :                         if (!(eq_s_b(z, 2, s_4))) { z->c = z->l - m2; goto lab0; } /* literal, line 113 */
     457             :                     }
     458           0 :                 lab1:
     459           0 :                     z->c = z->l - m3;
     460           0 :                     {   int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
     461           0 :                         if (ret < 0) { z->c = z->l - m2; goto lab0; }
     462           0 :                         z->c = ret; /* next, line 114 */
     463             :                     }
     464             :                 }
     465           0 :                 z->bra = z->c; /* ], line 114 */
     466           0 :             lab0:
     467             :                 ;
     468             :             }
     469           0 :             break;
     470           0 :         case 8:
     471           0 :             if (in_grouping_b_U(z, g_V1, 97, 246, 0)) return 0; /* grouping V1, line 120 */
     472           0 :             if (in_grouping_b_U(z, g_C, 98, 122, 0)) return 0; /* grouping C, line 120 */
     473           0 :             break;
     474             :     }
     475           0 :     {   int ret = slice_del(z); /* delete, line 139 */
     476           0 :         if (ret < 0) return ret;
     477             :     }
     478           0 :     z->B[0] = 1; /* set ending_removed, line 140 */
     479           0 :     return 1;
     480             : }
     481             : 
     482           0 : static int r_other_endings(struct SN_env * z) { /* backwardmode */
     483             :     int among_var;
     484             : 
     485             :     {   int mlimit1; /* setlimit, line 143 */
     486           0 :         if (z->c < z->I[1]) return 0;
     487           0 :         mlimit1 = z->lb; z->lb = z->I[1];
     488           0 :         z->ket = z->c; /* [, line 143 */
     489           0 :         among_var = find_among_b(z, a_7, 14); /* substring, line 143 */
     490           0 :         if (!(among_var)) { z->lb = mlimit1; return 0; }
     491           0 :         z->bra = z->c; /* ], line 143 */
     492           0 :         z->lb = mlimit1;
     493             :     }
     494           0 :     switch (among_var) { /* among, line 144 */
     495           0 :         case 1:
     496           0 :             {   int m2 = z->l - z->c; (void)m2; /* not, line 147 */
     497           0 :                 if (!(eq_s_b(z, 2, s_5))) goto lab0; /* literal, line 147 */
     498           0 :                 return 0;
     499           0 :             lab0:
     500           0 :                 z->c = z->l - m2;
     501             :             }
     502           0 :             break;
     503             :     }
     504           0 :     {   int ret = slice_del(z); /* delete, line 152 */
     505           0 :         if (ret < 0) return ret;
     506             :     }
     507           0 :     return 1;
     508             : }
     509             : 
     510           0 : static int r_i_plural(struct SN_env * z) { /* backwardmode */
     511             : 
     512             :     {   int mlimit1; /* setlimit, line 155 */
     513           0 :         if (z->c < z->I[0]) return 0;
     514           0 :         mlimit1 = z->lb; z->lb = z->I[0];
     515           0 :         z->ket = z->c; /* [, line 155 */
     516           0 :         if (z->c <= z->lb || (z->p[z->c - 1] != 105 && z->p[z->c - 1] != 106)) { z->lb = mlimit1; return 0; } /* substring, line 155 */
     517           0 :         if (!(find_among_b(z, a_8, 2))) { z->lb = mlimit1; return 0; }
     518           0 :         z->bra = z->c; /* ], line 155 */
     519           0 :         z->lb = mlimit1;
     520             :     }
     521           0 :     {   int ret = slice_del(z); /* delete, line 159 */
     522           0 :         if (ret < 0) return ret;
     523             :     }
     524           0 :     return 1;
     525             : }
     526             : 
     527           0 : static int r_t_plural(struct SN_env * z) { /* backwardmode */
     528             :     int among_var;
     529             : 
     530             :     {   int mlimit1; /* setlimit, line 162 */
     531           0 :         if (z->c < z->I[0]) return 0;
     532           0 :         mlimit1 = z->lb; z->lb = z->I[0];
     533           0 :         z->ket = z->c; /* [, line 163 */
     534           0 :         if (z->c <= z->lb || z->p[z->c - 1] != 't') { z->lb = mlimit1; return 0; } /* literal, line 163 */
     535           0 :         z->c--;
     536           0 :         z->bra = z->c; /* ], line 163 */
     537           0 :         {   int m_test2 = z->l - z->c; /* test, line 163 */
     538           0 :             if (in_grouping_b_U(z, g_V1, 97, 246, 0)) { z->lb = mlimit1; return 0; } /* grouping V1, line 163 */
     539           0 :             z->c = z->l - m_test2;
     540             :         }
     541           0 :         {   int ret = slice_del(z); /* delete, line 164 */
     542           0 :             if (ret < 0) return ret;
     543             :         }
     544           0 :         z->lb = mlimit1;
     545             :     }
     546             : 
     547             :     {   int mlimit3; /* setlimit, line 166 */
     548           0 :         if (z->c < z->I[1]) return 0;
     549           0 :         mlimit3 = z->lb; z->lb = z->I[1];
     550           0 :         z->ket = z->c; /* [, line 166 */
     551           0 :         if (z->c - 2 <= z->lb || z->p[z->c - 1] != 97) { z->lb = mlimit3; return 0; } /* substring, line 166 */
     552           0 :         among_var = find_among_b(z, a_9, 2);
     553           0 :         if (!(among_var)) { z->lb = mlimit3; return 0; }
     554           0 :         z->bra = z->c; /* ], line 166 */
     555           0 :         z->lb = mlimit3;
     556             :     }
     557           0 :     switch (among_var) { /* among, line 167 */
     558           0 :         case 1:
     559           0 :             {   int m4 = z->l - z->c; (void)m4; /* not, line 168 */
     560           0 :                 if (!(eq_s_b(z, 2, s_6))) goto lab0; /* literal, line 168 */
     561           0 :                 return 0;
     562           0 :             lab0:
     563           0 :                 z->c = z->l - m4;
     564             :             }
     565           0 :             break;
     566             :     }
     567           0 :     {   int ret = slice_del(z); /* delete, line 171 */
     568           0 :         if (ret < 0) return ret;
     569             :     }
     570           0 :     return 1;
     571             : }
     572             : 
     573           0 : static int r_tidy(struct SN_env * z) { /* backwardmode */
     574             : 
     575             :     {   int mlimit1; /* setlimit, line 174 */
     576           0 :         if (z->c < z->I[0]) return 0;
     577           0 :         mlimit1 = z->lb; z->lb = z->I[0];
     578           0 :         {   int m2 = z->l - z->c; (void)m2; /* do, line 175 */
     579           0 :             {   int m3 = z->l - z->c; (void)m3; /* and, line 175 */
     580           0 :                 {   int ret = r_LONG(z); /* call LONG, line 175 */
     581           0 :                     if (ret == 0) goto lab0;
     582           0 :                     if (ret < 0) return ret;
     583             :                 }
     584           0 :                 z->c = z->l - m3;
     585           0 :                 z->ket = z->c; /* [, line 175 */
     586           0 :                 {   int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
     587           0 :                     if (ret < 0) goto lab0;
     588           0 :                     z->c = ret; /* next, line 175 */
     589             :                 }
     590           0 :                 z->bra = z->c; /* ], line 175 */
     591           0 :                 {   int ret = slice_del(z); /* delete, line 175 */
     592           0 :                     if (ret < 0) return ret;
     593             :                 }
     594             :             }
     595           0 :         lab0:
     596           0 :             z->c = z->l - m2;
     597             :         }
     598           0 :         {   int m4 = z->l - z->c; (void)m4; /* do, line 176 */
     599           0 :             z->ket = z->c; /* [, line 176 */
     600           0 :             if (in_grouping_b_U(z, g_AEI, 97, 228, 0)) goto lab1; /* grouping AEI, line 176 */
     601           0 :             z->bra = z->c; /* ], line 176 */
     602           0 :             if (in_grouping_b_U(z, g_C, 98, 122, 0)) goto lab1; /* grouping C, line 176 */
     603           0 :             {   int ret = slice_del(z); /* delete, line 176 */
     604           0 :                 if (ret < 0) return ret;
     605             :             }
     606           0 :         lab1:
     607           0 :             z->c = z->l - m4;
     608             :         }
     609           0 :         {   int m5 = z->l - z->c; (void)m5; /* do, line 177 */
     610           0 :             z->ket = z->c; /* [, line 177 */
     611           0 :             if (z->c <= z->lb || z->p[z->c - 1] != 'j') goto lab2; /* literal, line 177 */
     612           0 :             z->c--;
     613           0 :             z->bra = z->c; /* ], line 177 */
     614           0 :             {   int m6 = z->l - z->c; (void)m6; /* or, line 177 */
     615           0 :                 if (z->c <= z->lb || z->p[z->c - 1] != 'o') goto lab4; /* literal, line 177 */
     616           0 :                 z->c--;
     617           0 :                 goto lab3;
     618           0 :             lab4:
     619           0 :                 z->c = z->l - m6;
     620           0 :                 if (z->c <= z->lb || z->p[z->c - 1] != 'u') goto lab2; /* literal, line 177 */
     621           0 :                 z->c--;
     622             :             }
     623           0 :         lab3:
     624           0 :             {   int ret = slice_del(z); /* delete, line 177 */
     625           0 :                 if (ret < 0) return ret;
     626             :             }
     627           0 :         lab2:
     628           0 :             z->c = z->l - m5;
     629             :         }
     630           0 :         {   int m7 = z->l - z->c; (void)m7; /* do, line 178 */
     631           0 :             z->ket = z->c; /* [, line 178 */
     632           0 :             if (z->c <= z->lb || z->p[z->c - 1] != 'o') goto lab5; /* literal, line 178 */
     633           0 :             z->c--;
     634           0 :             z->bra = z->c; /* ], line 178 */
     635           0 :             if (z->c <= z->lb || z->p[z->c - 1] != 'j') goto lab5; /* literal, line 178 */
     636           0 :             z->c--;
     637           0 :             {   int ret = slice_del(z); /* delete, line 178 */
     638           0 :                 if (ret < 0) return ret;
     639             :             }
     640           0 :         lab5:
     641           0 :             z->c = z->l - m7;
     642             :         }
     643           0 :         z->lb = mlimit1;
     644             :     }
     645           0 :     if (in_grouping_b_U(z, g_V1, 97, 246, 1) < 0) return 0; /* goto */ /* non V1, line 180 */
     646           0 :     z->ket = z->c; /* [, line 180 */
     647           0 :     if (in_grouping_b_U(z, g_C, 98, 122, 0)) return 0; /* grouping C, line 180 */
     648           0 :     z->bra = z->c; /* ], line 180 */
     649           0 :     z->S[0] = slice_to(z, z->S[0]); /* -> x, line 180 */
     650           0 :     if (z->S[0] == 0) return -1; /* -> x, line 180 */
     651           0 :     if (!(eq_v_b(z, z->S[0]))) return 0; /* name x, line 180 */
     652           0 :     {   int ret = slice_del(z); /* delete, line 180 */
     653           0 :         if (ret < 0) return ret;
     654             :     }
     655           0 :     return 1;
     656             : }
     657             : 
     658           0 : extern int finnish_UTF_8_stem(struct SN_env * z) { /* forwardmode */
     659           0 :     {   int c1 = z->c; /* do, line 186 */
     660           0 :         {   int ret = r_mark_regions(z); /* call mark_regions, line 186 */
     661           0 :             if (ret < 0) return ret;
     662             :         }
     663           0 :         z->c = c1;
     664             :     }
     665           0 :     z->B[0] = 0; /* unset ending_removed, line 187 */
     666           0 :     z->lb = z->c; z->c = z->l; /* backwards, line 188 */
     667             : 
     668           0 :     {   int m2 = z->l - z->c; (void)m2; /* do, line 189 */
     669           0 :         {   int ret = r_particle_etc(z); /* call particle_etc, line 189 */
     670           0 :             if (ret < 0) return ret;
     671             :         }
     672           0 :         z->c = z->l - m2;
     673             :     }
     674           0 :     {   int m3 = z->l - z->c; (void)m3; /* do, line 190 */
     675           0 :         {   int ret = r_possessive(z); /* call possessive, line 190 */
     676           0 :             if (ret < 0) return ret;
     677             :         }
     678           0 :         z->c = z->l - m3;
     679             :     }
     680           0 :     {   int m4 = z->l - z->c; (void)m4; /* do, line 191 */
     681           0 :         {   int ret = r_case_ending(z); /* call case_ending, line 191 */
     682           0 :             if (ret < 0) return ret;
     683             :         }
     684           0 :         z->c = z->l - m4;
     685             :     }
     686           0 :     {   int m5 = z->l - z->c; (void)m5; /* do, line 192 */
     687           0 :         {   int ret = r_other_endings(z); /* call other_endings, line 192 */
     688           0 :             if (ret < 0) return ret;
     689             :         }
     690           0 :         z->c = z->l - m5;
     691             :     }
     692             :     /* or, line 193 */
     693           0 :     if (!(z->B[0])) goto lab1; /* Boolean test ending_removed, line 193 */
     694           0 :     {   int m6 = z->l - z->c; (void)m6; /* do, line 193 */
     695           0 :         {   int ret = r_i_plural(z); /* call i_plural, line 193 */
     696           0 :             if (ret < 0) return ret;
     697             :         }
     698           0 :         z->c = z->l - m6;
     699             :     }
     700           0 :     goto lab0;
     701           0 : lab1:
     702           0 :     {   int m7 = z->l - z->c; (void)m7; /* do, line 193 */
     703           0 :         {   int ret = r_t_plural(z); /* call t_plural, line 193 */
     704           0 :             if (ret < 0) return ret;
     705             :         }
     706           0 :         z->c = z->l - m7;
     707             :     }
     708           0 : lab0:
     709           0 :     {   int m8 = z->l - z->c; (void)m8; /* do, line 194 */
     710           0 :         {   int ret = r_tidy(z); /* call tidy, line 194 */
     711           0 :             if (ret < 0) return ret;
     712             :         }
     713           0 :         z->c = z->l - m8;
     714             :     }
     715           0 :     z->c = z->lb;
     716           0 :     return 1;
     717             : }
     718             : 
     719           0 : extern struct SN_env * finnish_UTF_8_create_env(void) { return SN_create_env(1, 2, 1); }
     720             : 
     721           0 : extern void finnish_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 1); }
     722             : 

Generated by: LCOV version 1.13