LCOV - code coverage report
Current view: top level - src/backend/snowball/libstemmer - stem_ISO_8859_1_finnish.c (source / functions) Coverage Total Hit
Test: PostgreSQL 19devel Lines: 0.0 % 342 0
Test Date: 2026-03-03 11:15:01 Functions: 0.0 % 15 0
Legend: Lines:     hit not hit

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

Generated by: LCOV version 2.0-1