Changeset 1950

Show
Ignore:
Timestamp:
10/23/07 23:08:09 (10 months ago)
Author:
karpet
Message:

merge stemmer changes from trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • swish-e/branches/2.6/pod/CHANGES.pod

    r1907 r1950  
    77This document contains list of bug fixes and feature additions to Swish-e. 
    88 
     9=head2 Version 2.6.x - ? 
     10 
     11=over 4 
     12 
     13=item New Berkeley DB backend 
     14 
     15Jose Ruiz contributed a new BDB index format. The old native 
     16and experimental incremental index formats have been removed. 
     17 
     18=back 
     19 
    920=head2 Version 2.4.x - ? 
    1021 
    1122=over 4 
     23 
     24=item New Snowball stemmers 
     25 
     26Trygve Falch contributed patches to update 
     27the Snowball stemmers, including new Hungarian and Romanian stemmers. 
    1228 
    1329=item Patched leaks 
  • swish-e/branches/2.6/src/snowball/Makefile.am

    r1277 r1950  
    3232        stem_ru.h \ 
    3333        stem_fi.c \ 
    34         stem_fi.h 
     34        stem_fi.h \ 
     35        stem_ro.c \ 
     36        stem_ro.h \ 
     37        stem_hu.c \ 
     38        stem_hu.h 
    3539 
    3640 
  • swish-e/branches/2.6/src/snowball/Makefile.in

    r1939 r1950  
    140140        stem_ru.h \ 
    141141        stem_fi.c \ 
    142         stem_fi.h 
     142        stem_fi.h \ 
     143        stem_ro.c \ 
     144        stem_ro.h \ 
     145        stem_hu.c \ 
     146        stem_hu.h 
    143147 
    144148subdir = src/snowball 
     
    153157        stem_es.lo stem_fr.lo stem_it.lo stem_pt.lo stem_de.lo \ 
    154158        stem_nl.lo stem_no.lo stem_se.lo stem_dk.lo stem_ru.lo \ 
    155         stem_fi.lo 
     159        stem_fi.lo stem_ro.lo stem_hu.lo 
    156160libsnowball_la_OBJECTS = $(am_libsnowball_la_OBJECTS) 
    157161 
     
    167171@AMDEP_TRUE@    ./$(DEPDIR)/stem_en2.Plo ./$(DEPDIR)/stem_es.Plo \ 
    168172@AMDEP_TRUE@    ./$(DEPDIR)/stem_fi.Plo ./$(DEPDIR)/stem_fr.Plo \ 
    169 @AMDEP_TRUE@    ./$(DEPDIR)/stem_it.Plo ./$(DEPDIR)/stem_nl.Plo \ 
    170 @AMDEP_TRUE@    ./$(DEPDIR)/stem_no.Plo ./$(DEPDIR)/stem_pt.Plo \ 
     173@AMDEP_TRUE@    ./$(DEPDIR)/stem_hu.Plo ./$(DEPDIR)/stem_it.Plo \ 
     174@AMDEP_TRUE@    ./$(DEPDIR)/stem_nl.Plo ./$(DEPDIR)/stem_no.Plo \ 
     175@AMDEP_TRUE@    ./$(DEPDIR)/stem_pt.Plo ./$(DEPDIR)/stem_ro.Plo \ 
    171176@AMDEP_TRUE@    ./$(DEPDIR)/stem_ru.Plo ./$(DEPDIR)/stem_se.Plo \ 
    172177@AMDEP_TRUE@    ./$(DEPDIR)/utilities.Plo 
     
    218223@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stem_fi.Plo@am__quote@ 
    219224@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stem_fr.Plo@am__quote@ 
     225@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stem_hu.Plo@am__quote@ 
    220226@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stem_it.Plo@am__quote@ 
    221227@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stem_nl.Plo@am__quote@ 
    222228@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stem_no.Plo@am__quote@ 
    223229@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stem_pt.Plo@am__quote@ 
     230@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stem_ro.Plo@am__quote@ 
    224231@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stem_ru.Plo@am__quote@ 
    225232@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stem_se.Plo@am__quote@ 
  • swish-e/branches/2.6/src/snowball/api.c

    r1296 r1950  
    11 
     2#include <stdlib.h> /* for calloc, free */ 
    23#include "header.h" 
    3 #include <stdlib.h> 
    44 
    55extern struct SN_env * SN_create_env(int S_size, int I_size, int B_size) 
    6 {   struct SN_env * z = (struct SN_env *) calloc(1, sizeof(struct SN_env)); 
     6
     7    struct SN_env * z = (struct SN_env *) calloc(1, sizeof(struct SN_env)); 
     8    if (z == NULL) return NULL; 
    79    z->p = create_s(); 
     10    if (z->p == NULL) goto error; 
    811    if (S_size) 
    9     {   z->S = (symbol * *) calloc(S_size, sizeof(symbol *)); 
    10         {   int i; 
    11             for (i = 0; i < S_size; i++) z->S[i] = create_s(); 
     12    { 
     13        int i; 
     14        z->S = (symbol * *) calloc(S_size, sizeof(symbol *)); 
     15        if (z->S == NULL) goto error; 
     16 
     17        for (i = 0; i < S_size; i++) 
     18        { 
     19            z->S[i] = create_s(); 
     20            if (z->S[i] == NULL) goto error; 
    1221        } 
    13         z->S_size = S_size; 
    1422    } 
    1523 
    1624    if (I_size) 
    17     {   z->I = (int *) calloc(I_size, sizeof(int)); 
    18         z->I_size = I_size; 
     25    { 
     26        z->I = (int *) calloc(I_size, sizeof(int)); 
     27        if (z->I == NULL) goto error; 
    1928    } 
    2029 
    2130    if (B_size) 
    22     {   z->B = (symbol *) calloc(B_size, sizeof(symbol)); 
    23         z->B_size = B_size; 
     31    { 
     32        z->B = (unsigned char *) calloc(B_size, sizeof(unsigned char)); 
     33        if (z->B == NULL) goto error; 
    2434    } 
    2535 
    2636    return z; 
     37error: 
     38    SN_close_env(z, S_size); 
     39    return NULL; 
    2740} 
    2841 
    29 extern void SN_close_env(struct SN_env * z
     42extern void SN_close_env(struct SN_env * z, int S_size
    3043{ 
    31     if (z->S_size) 
     44    if (z == NULL) return; 
     45    if (S_size) 
    3246    { 
    33         {   int i; 
    34             for (i = 0; i < z->S_size; i++) lose_s(z->S[i]); 
     47        int i; 
     48        for (i = 0; i < S_size; i++) 
     49        { 
     50            lose_s(z->S[i]); 
    3551        } 
    3652        free(z->S); 
    3753    } 
    38     if (z->I_size) free(z->I); 
    39     if (z->B_size) free(z->B); 
     54    free(z->I); 
     55    free(z->B); 
    4056    if (z->p) lose_s(z->p); 
    4157    free(z); 
    4258} 
    4359 
    44 extern void SN_set_current(struct SN_env * z, int size, const symbol * s) 
     60extern int SN_set_current(struct SN_env * z, int size, const symbol * s) 
    4561{ 
    46     replace_s(z, 0, z->l, size, s); 
     62    int err = replace_s(z, 0, z->l, size, s, NULL); 
    4763    z->c = 0; 
     64    return err; 
    4865} 
    4966 
  • swish-e/branches/2.6/src/snowball/api.h

    r1440 r1950  
    1616struct SN_env { 
    1717    symbol * p; 
    18     int c; int a; int l; int lb; int bra; int ket; 
    19     int S_size; int I_size; int B_size; 
     18    int c; int l; int lb; int bra; int ket; 
    2019    symbol * * S; 
    2120    int * I; 
    22     symbol * B; 
     21    unsigned char * B; 
    2322}; 
    2423 
    2524extern struct SN_env * SN_create_env(int S_size, int I_size, int B_size); 
    26 extern void SN_close_env(struct SN_env * z); 
     25extern void SN_close_env(struct SN_env * z, int S_size); 
    2726 
    28 extern void SN_set_current(struct SN_env * z, int size, const symbol * s); 
     27extern int SN_set_current(struct SN_env * z, int size, const symbol * s); 
    2928 
    3029#endif 
  • swish-e/branches/2.6/src/snowball/header.h

    r1296 r1950  
    22#include <limits.h> 
    33 
    4  
    54#include "api.h" 
    6  
    7 /* use SWISHE emalloc/efree schema */ 
    8 // #define calloc(n,s) ecalloc((n),(s)) 
    9 // #define malloc(s) emalloc((s)) 
    10 // #define free(p) efree((p)) 
    115 
    126#define MAXINT INT_MAX 
     
    2115struct among 
    2216{   int s_size;     /* number of chars in string */ 
    23     symbol * s;       /* search string */ 
     17    const symbol * s;       /* search string */ 
    2418    int substring_i;/* index to longest matching substring */ 
    2519    int result;     /* result of the lookup */ 
     
    3024extern void lose_s(symbol * p); 
    3125 
    32 extern int in_grouping(struct SN_env * z, unsigned char * s, int min, int max); 
    33 extern int in_grouping_b(struct SN_env * z, unsigned char * s, int min, int max); 
    34 extern int out_grouping(struct SN_env * z, unsigned char * s, int min, int max); 
    35 extern int out_grouping_b(struct SN_env * z, unsigned char * s, int min, int max); 
     26extern int skip_utf8(const symbol * p, int c, int lb, int l, int n); 
    3627 
    37 extern int in_range(struct SN_env * z, int min, int max); 
    38 extern int in_range_b(struct SN_env * z, int min, int max); 
    39 extern int out_range(struct SN_env * z, int min, int max); 
    40 extern int out_range_b(struct SN_env * z, int min, int max); 
     28extern int in_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); 
     29extern int in_grouping_b_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); 
     30extern int out_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); 
     31extern int out_grouping_b_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); 
    4132 
    42 extern int eq_s(struct SN_env * z, int s_size, symbol * s); 
    43 extern int eq_s_b(struct SN_env * z, int s_size, symbol * s); 
    44 extern int eq_v(struct SN_env * z, symbol * p); 
    45 extern int eq_v_b(struct SN_env * z, symbol * p); 
     33extern int in_grouping(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); 
     34extern int in_grouping_b(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); 
     35extern int out_grouping(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); 
     36extern int out_grouping_b(struct SN_env * z, const unsigned char * s, int min, int max, int repeat); 
    4637 
    47 extern int find_among(struct SN_env * z, struct among * v, int v_size); 
    48 extern int find_among_b(struct SN_env * z, struct among * v, int v_size); 
     38extern int eq_s(struct SN_env * z, int s_size, const symbol * s); 
     39extern int eq_s_b(struct SN_env * z, int s_size, const symbol * s); 
     40extern int eq_v(struct SN_env * z, const symbol * p); 
     41extern int eq_v_b(struct SN_env * z, const symbol * p); 
    4942 
    50 extern symbol * increase_size(symbol * p, int n); 
    51 extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s); 
    52 extern void slice_from_s(struct SN_env * z, int s_size, symbol * s); 
    53 extern void slice_from_v(struct SN_env * z, symbol * p); 
    54 extern void slice_del(struct SN_env * z); 
     43extern int find_among(struct SN_env * z, const struct among * v, int v_size); 
     44extern int find_among_b(struct SN_env * z, const struct among * v, int v_size); 
    5545 
    56 extern void insert_s(struct SN_env * z, int bra, int ket, int s_size, symbol * s); 
    57 extern void insert_v(struct SN_env * z, int bra, int ket, symbol * p); 
     46extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjustment); 
     47extern int slice_from_s(struct SN_env * z, int s_size, const symbol * s); 
     48extern int slice_from_v(struct SN_env * z, const symbol * p); 
     49extern int slice_del(struct SN_env * z); 
     50 
     51extern int insert_s(struct SN_env * z, int bra, int ket, int s_size, const symbol * s); 
     52extern int insert_v(struct SN_env * z, int bra, int ket, const symbol * p); 
    5853 
    5954extern symbol * slice_to(struct SN_env * z, symbol * p); 
  • swish-e/branches/2.6/src/snowball/stem_de.c

    r1267 r1950  
    44#include "header.h" 
    55 
    6 extern int german_stem(struct SN_env * z); 
     6#ifdef __cplusplus 
     7extern "C" { 
     8#endif 
     9extern int german_ISO_8859_1_stem(struct SN_env * z); 
     10#ifdef __cplusplus 
     11
     12#endif 
    713static int r_standard_suffix(struct SN_env * z); 
    814static int r_R2(struct SN_env * z); 
     
    1117static int r_postlude(struct SN_env * z); 
    1218static int r_prelude(struct SN_env * z); 
    13  
    14 extern struct SN_env * german_create_env(void); 
    15 extern void german_close_env(struct SN_env * z); 
    16  
    17 static symbol s_0_1[1] = { 'U' }; 
    18 static symbol s_0_2[1] = { 'Y' }; 
    19 static symbol s_0_3[1] = { 228 }; 
    20 static symbol s_0_4[1] = { 246 }; 
    21 static symbol s_0_5[1] = { 252 }; 
    22  
    23 static struct among a_0[6] = 
     19#ifdef __cplusplus 
     20extern "C" { 
     21#endif 
     22 
     23 
     24extern struct SN_env * german_ISO_8859_1_create_env(void); 
     25extern void german_ISO_8859_1_close_env(struct SN_env * z); 
     26 
     27 
     28#ifdef __cplusplus 
     29
     30#endif 
     31static const symbol s_0_1[1] = { 'U' }; 
     32static const symbol s_0_2[1] = { 'Y' }; 
     33static const symbol s_0_3[1] = { 0xE4 }; 
     34static const symbol s_0_4[1] = { 0xF6 }; 
     35static const symbol s_0_5[1] = { 0xFC }; 
     36 
     37static const struct among a_0[6] = 
    2438{ 
    2539/*  0 */ { 0, 0, -1, 6, 0}, 
     
    3145}; 
    3246 
    33 static symbol s_1_0[1] = { 'e' }; 
    34 static symbol s_1_1[2] = { 'e', 'm' }; 
    35 static symbol s_1_2[2] = { 'e', 'n' }; 
    36 static symbol s_1_3[3] = { 'e', 'r', 'n' }; 
    37 static symbol s_1_4[2] = { 'e', 'r' }; 
    38 static symbol s_1_5[1] = { 's' }; 
    39 static symbol s_1_6[2] = { 'e', 's' }; 
    40  
    41 static struct among a_1[7] = 
     47static const symbol s_1_0[1] = { 'e' }; 
     48static const symbol s_1_1[2] = { 'e', 'm' }; 
     49static const symbol s_1_2[2] = { 'e', 'n' }; 
     50static const symbol s_1_3[3] = { 'e', 'r', 'n' }; 
     51static const symbol s_1_4[2] = { 'e', 'r' }; 
     52static const symbol s_1_5[1] = { 's' }; 
     53static const symbol s_1_6[2] = { 'e', 's' }; 
     54 
     55static const struct among a_1[7] = 
    4256{ 
    4357/*  0 */ { 1, s_1_0, -1, 1, 0}, 
     
    5064}; 
    5165 
    52 static symbol s_2_0[2] = { 'e', 'n' }; 
    53 static symbol s_2_1[2] = { 'e', 'r' }; 
    54 static symbol s_2_2[2] = { 's', 't' }; 
    55 static symbol s_2_3[3] = { 'e', 's', 't' }; 
    56  
    57 static struct among a_2[4] = 
     66static const symbol s_2_0[2] = { 'e', 'n' }; 
     67static const symbol s_2_1[2] = { 'e', 'r' }; 
     68static const symbol s_2_2[2] = { 's', 't' }; 
     69static const symbol s_2_3[3] = { 'e', 's', 't' }; 
     70 
     71static const struct among a_2[4] = 
    5872{ 
    5973/*  0 */ { 2, s_2_0, -1, 1, 0}, 
     
    6377}; 
    6478 
    65 static symbol s_3_0[2] = { 'i', 'g' }; 
    66 static symbol s_3_1[4] = { 'l', 'i', 'c', 'h' }; 
    67  
    68 static struct among a_3[2] = 
     79static const symbol s_3_0[2] = { 'i', 'g' }; 
     80static const symbol s_3_1[4] = { 'l', 'i', 'c', 'h' }; 
     81 
     82static const struct among a_3[2] = 
    6983{ 
    7084/*  0 */ { 2, s_3_0, -1, 1, 0}, 
     
    7286}; 
    7387 
    74 static symbol s_4_0[3] = { 'e', 'n', 'd' }; 
    75 static symbol s_4_1[2] = { 'i', 'g' }; 
    76 static symbol s_4_2[3] = { 'u', 'n', 'g' }; 
    77 static symbol s_4_3[4] = { 'l', 'i', 'c', 'h' }; 
    78 static symbol s_4_4[4] = { 'i', 's', 'c', 'h' }; 
    79 static symbol s_4_5[2] = { 'i', 'k' }; 
    80 static symbol s_4_6[4] = { 'h', 'e', 'i', 't' }; 
    81 static symbol s_4_7[4] = { 'k', 'e', 'i', 't' }; 
    82  
    83 static struct among a_4[8] = 
     88static const symbol s_4_0[3] = { 'e', 'n', 'd' }; 
     89static const symbol s_4_1[2] = { 'i', 'g' }; 
     90static const symbol s_4_2[3] = { 'u', 'n', 'g' }; 
     91static const symbol s_4_3[4] = { 'l', 'i', 'c', 'h' }; 
     92static const symbol s_4_4[4] = { 'i', 's', 'c', 'h' }; 
     93static const symbol s_4_5[2] = { 'i', 'k' }; 
     94static const symbol s_4_6[4] = { 'h', 'e', 'i', 't' }; 
     95static const symbol s_4_7[4] = { 'k', 'e', 'i', 't' }; 
     96 
     97static const struct among a_4[8] = 
    8498{ 
    8599/*  0 */ { 3, s_4_0, -1, 1, 0}, 
     
    93107}; 
    94108 
    95 static unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8 }; 
    96  
    97 static unsigned char g_s_ending[] = { 117, 30, 5 }; 
    98  
    99 static unsigned char g_st_ending[] = { 117, 30, 4 }; 
    100  
    101 static symbol s_0[] = { 223 }; 
    102 static symbol s_1[] = { 's', 's' }; 
    103 static symbol s_2[] = { 'u' }; 
    104 static symbol s_3[] = { 'U' }; 
    105 static symbol s_4[] = { 'y' }; 
    106 static symbol s_5[] = { 'Y' }; 
    107 static symbol s_6[] = { 'y' }; 
    108 static symbol s_7[] = { 'u' }; 
    109 static symbol s_8[] = { 'a' }; 
    110 static symbol s_9[] = { 'o' }; 
    111 static symbol s_10[] = { 'u' }; 
    112 static symbol s_11[] = { 'i', 'g' }; 
    113 static symbol s_12[] = { 'e' }; 
    114 static symbol s_13[] = { 'e' }; 
    115 static symbol s_14[] = { 'e', 'r' }; 
    116 static symbol s_15[] = { 'e', 'n' }; 
     109static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8 }; 
     110 
     111static const unsigned char g_s_ending[] = { 117, 30, 5 }; 
     112 
     113static const unsigned char g_st_ending[] = { 117, 30, 4 }; 
     114 
     115static const symbol s_0[] = { 0xDF }; 
     116static const symbol s_1[] = { 's', 's' }; 
     117static const symbol s_2[] = { 'u' }; 
     118static const symbol s_3[] = { 'U' }; 
     119static const symbol s_4[] = { 'y' }; 
     120static const symbol s_5[] = { 'Y' }; 
     121static const symbol s_6[] = { 'y' }; 
     122static const symbol s_7[] = { 'u' }; 
     123static const symbol s_8[] = { 'a' }; 
     124static const symbol s_9[] = { 'o' }; 
     125static const symbol s_10[] = { 'u' }; 
     126static const symbol s_11[] = { 'i', 'g' }; 
     127static const symbol s_12[] = { 'e' }; 
     128static const symbol s_13[] = { 'e' }; 
     129static const symbol s_14[] = { 'e', 'r' }; 
     130static const symbol s_15[] = { 'e', 'n' }; 
    117131 
    118132static int r_prelude(struct SN_env * z) { 
    119133    {   int c_test = z->c; /* test, line 30 */ 
    120134        while(1) { /* repeat, line 30 */ 
    121             int c = z->c; 
    122             {   int c = z->c; /* or, line 33 */ 
     135            int c1 = z->c; 
     136            {   int c2 = z->c; /* or, line 33 */ 
    123137                z->bra = z->c; /* [, line 32 */ 
    124138                if (!(eq_s(z, 1, s_0))) goto lab2; 
    125139                z->ket = z->c; /* ], line 32 */ 
    126                 slice_from_s(z, 2, s_1); /* <-, line 32 */ 
     140                {   int ret = slice_from_s(z, 2, s_1); /* <-, line 32 */ 
     141                    if (ret < 0) return ret; 
     142                } 
    127143                goto lab1; 
    128144            lab2: 
    129                 z->c = c
     145                z->c = c2
    130146                if (z->c >= z->l) goto lab0; 
    131147                z->c++; /* next, line 33 */ 
     
    134150            continue; 
    135151        lab0: 
    136             z->c = c
     152            z->c = c1
    137153            break; 
    138154        } 
     
    140156    } 
    141157    while(1) { /* repeat, line 36 */ 
    142         int c = z->c; 
     158        int c3 = z->c; 
    143159        while(1) { /* goto, line 36 */ 
    144             int c = z->c; 
    145             if (!(in_grouping(z, g_v, 97, 252))) goto lab4; 
     160            int c4 = z->c; 
     161            if (in_grouping(z, g_v, 97, 252, 0)) goto lab4; 
    146162            z->bra = z->c; /* [, line 37 */ 
    147             {   int c = z->c; /* or, line 37 */ 
     163            {   int c5 = z->c; /* or, line 37 */ 
    148164                if (!(eq_s(z, 1, s_2))) goto lab6; 
    149165                z->ket = z->c; /* ], line 37 */ 
    150                 if (!(in_grouping(z, g_v, 97, 252))) goto lab6; 
    151                 slice_from_s(z, 1, s_3); /* <-, line 37 */ 
     166                if (in_grouping(z, g_v, 97, 252, 0)) goto lab6; 
     167                {   int ret = slice_from_s(z, 1, s_3); /* <-, line 37 */ 
     168                    if (ret < 0) return ret; 
     169                } 
    152170                goto lab5; 
    153171            lab6: 
    154                 z->c = c
     172                z->c = c5
    155173                if (!(eq_s(z, 1, s_4))) goto lab4; 
    156174                z->ket = z->c; /* ], line 38 */ 
    157                 if (!(in_grouping(z, g_v, 97, 252))) goto lab4; 
    158                 slice_from_s(z, 1, s_5); /* <-, line 38 */ 
     175                if (in_grouping(z, g_v, 97, 252, 0)) goto lab4; 
     176                {   int ret = slice_from_s(z, 1, s_5); /* <-, line 38 */ 
     177                    if (ret < 0) return ret; 
     178                } 
    159179            } 
    160180        lab5: 
    161             z->c = c
     181            z->c = c4
    162182            break; 
    163183        lab4: 
    164             z->c = c
     184            z->c = c4
    165185            if (z->c >= z->l) goto lab3; 
    166             z->c++; 
     186            z->c++; /* goto, line 36 */ 
    167187        } 
    168188        continue; 
    169189    lab3: 
    170         z->c = c
     190        z->c = c3
    171191        break; 
    172192    } 
     
    177197    z->I[0] = z->l; 
    178198    z->I[1] = z->l; 
    179     while(1) { /* gopast, line 47 */ 
    180         if (!(in_grouping(z, g_v, 97, 252))) goto lab0
    181         break
    182     lab0: 
    183         if (z->c >= z->l) return 0; 
    184         z->c++; 
    185     } 
    186     while(1) { /* gopast, line 47 */ 
    187         if (!(out_grouping(z, g_v, 97, 252))) goto lab1; 
    188         break
    189     lab1: 
    190         if (z->c >= z->l) return 0
    191         z->c++; 
    192     } 
    193     z->I[0] = z->c; /* setmark p1, line 47 */ 
    194      /* try, line 48 */ 
    195     if (!(z->I[0] < 3)) goto lab2
    196     z->I[0] = 3; 
    197 lab2: 
    198     while(1) { /* gopast, line 49 */ 
    199         if (!(in_grouping(z, g_v, 97, 252))) goto lab3
    200         break
    201     lab3
    202         if (z->c >= z->l) return 0; 
    203         z->c++
    204     } 
    205     while(1) { /* gopast, line 49 */ 
    206         if (!(out_grouping(z, g_v, 97, 252))) goto lab4; 
    207         break; 
    208     lab4: 
    209         if (z->c >= z->l) return 0; 
    210         z->c++
    211     } 
    212     z->I[1] = z->c; /* setmark p2, line 49 */ 
     199    {   int c_test = z->c; /* test, line 47 */ 
     200        {   int ret = z->c + 3
     201            if (0 > ret || ret > z->l) return 0
     202            z->c = ret; /* hop, line 47 */ 
     203        } 
     204        z->I[2] = z->c; /* setmark x, line 47 */ 
     205        z->c = c_test; 
     206    } 
     207    {    /* gopast */ /* grouping v, line 49 */ 
     208        int ret = out_grouping(z, g_v, 97, 252, 1)
     209        if (ret < 0) return 0; 
     210        z->c += ret
     211    } 
     212    {    /* gopast */ /* non v, line 49 */ 
     213        int ret = in_grouping(z, g_v, 97, 252, 1); 
     214        if (ret < 0) return 0; 
     215        z->c += ret
     216    } 
     217    z->I[0] = z->c; /* setmark p1, line 49 */ 
     218    /* try, line 50 */ 
     219    if (!(z->I[0] < z->I[2])) goto lab0
     220    z->I[0] = z->I[2]
     221lab0
     222    {    /* gopast */ /* grouping v, line 51 */ 
     223        int ret = out_grouping(z, g_v, 97, 252, 1)
     224        if (ret < 0) return 0; 
     225        z->c += ret; 
     226    } 
     227    {    /* gopast */ /* non v, line 51 */ 
     228        int ret = in_grouping(z, g_v, 97, 252, 1); 
     229        if (ret < 0) return 0; 
     230        z->c += ret
     231    } 
     232    z->I[1] = z->c; /* setmark p2, line 51 */ 
    213233    return 1; 
    214234} 
     
    216236static int r_postlude(struct SN_env * z) { 
    217237    int among_var; 
    218     while(1) { /* repeat, line 53 */ 
    219         int c = z->c; 
    220         z->bra = z->c; /* [, line 55 */ 
    221         among_var = find_among(z, a_0, 6); /* substring, line 55 */ 
     238    while(1) { /* repeat, line 55 */ 
     239        int c1 = z->c; 
     240        z->bra = z->c; /* [, line 57 */ 
     241        among_var = find_among(z, a_0, 6); /* substring, line 57 */ 
    222242        if (!(among_var)) goto lab0; 
    223         z->ket = z->c; /* ], line 55 */ 
     243        z->ket = z->c; /* ], line 57 */ 
    224244        switch(among_var) { 
    225245            case 0: goto lab0; 
    226246            case 1: 
    227                 slice_from_s(z, 1, s_6); /* <-, line 56 */ 
     247                {   int ret = slice_from_s(z, 1, s_6); /* <-, line 58 */ 
     248                    if (ret < 0) return ret; 
     249                } 
    228250                break; 
    229251            case 2: 
    230                 slice_from_s(z, 1, s_7); /* <-, line 57 */ 
     252                {   int ret = slice_from_s(z, 1, s_7); /* <-, line 59 */ 
     253                    if (ret < 0) return ret; 
     254                } 
    231255                break; 
    232256            case 3: 
    233                 slice_from_s(z, 1, s_8); /* <-, line 58 */ 
     257                {   int ret = slice_from_s(z, 1, s_8); /* <-, line 60 */ 
     258                    if (ret < 0) return ret; 
     259                } 
    234260                break; 
    235261            case 4: 
    236                 slice_from_s(z, 1, s_9); /* <-, line 59 */ 
     262                {   int ret = slice_from_s(z, 1, s_9); /* <-, line 61 */ 
     263                    if (ret < 0) return ret; 
     264                } 
    237265                break; 
    238266            case 5: 
    239                 slice_from_s(z, 1, s_10); /* <-, line 60 */ 
     267                {   int ret = slice_from_s(z, 1, s_10); /* <-, line 62 */ 
     268                    if (ret < 0) return ret; 
     269                } 
    240270                break; 
    241271            case 6: 
    242272                if (z->c >= z->l) goto lab0; 
    243                 z->c++; /* next, line 61 */ 
     273                z->c++; /* next, line 63 */ 
    244274                break; 
    245275        } 
    246276        continue; 
    247277    lab0: 
    248         z->c = c
     278        z->c = c1
    249279        break; 
    250280    } 
     
    264294static int r_standard_suffix(struct SN_env * z) { 
    265295    int among_var; 
    266     {   int m = z->l - z->c; /* do, line 72 */ 
    267         z->ket = z->c; /* [, line 73 */ 
    268         among_var = find_among_b(z, a_1, 7); /* substring, line 73 */ 
     296    {   int m1 = z->l - z->c; (void)m1; /* do, line 74 */ 
     297        z->ket = z->c; /* [, line 75 */ 
     298        if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((811040 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab0; 
     299        among_var = find_among_b(z, a_1, 7); /* substring, line 75 */ 
    269300        if (!(among_var)) goto lab0; 
    270         z->bra = z->c; /* ], line 73 */ 
    271         if (!r_R1(z)) goto lab0; /* call R1, line 73 */ 
     301        z->bra = z->c; /* ], line 75 */ 
     302        {   int ret = r_R1(z); 
     303            if (ret == 0) goto lab0; /* call R1, line 75 */ 
     304            if (ret < 0) return ret; 
     305        } 
    272306        switch(among_var) { 
    273307            case 0: goto lab0; 
    274308            case 1: 
    275                 slice_del(z); /* delete, line 75 */ 
     309                {   int ret = slice_del(z); /* delete, line 77 */ 
     310                    if (ret < 0) return ret; 
     311                } 
    276312                break; 
    277313            case 2: 
    278                 if (!(in_grouping_b(z, g_s_ending, 98, 116))) goto lab0; 
    279                 slice_del(z); /* delete, line 78 */ 
     314                if (in_grouping_b(z, g_s_ending, 98, 116, 0)) goto lab0; 
     315                {   int ret = slice_del(z); /* delete, line 80 */ 
     316                    if (ret < 0) return ret; 
     317                } 
    280318                break; 
    281319        } 
    282320    lab0: 
    283         z->c = z->l - m; 
    284     } 
    285     {   int m = z->l - z->c; /* do, line 82 */ 
    286         z->ket = z->c; /* [, line 83 */ 
    287         among_var = find_among_b(z, a_2, 4); /* substring, line 83 */ 
     321        z->c = z->l - m1; 
     322    } 
     323    {   int m2 = z->l - z->c; (void)m2; /* do, line 84 */ 
     324        z->ket = z->c; /* [, line 85 */ 
     325        if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1327104 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab1; 
     326        among_var = find_among_b(z, a_2, 4); /* substring, line 85 */ 
    288327        if (!(among_var)) goto lab1; 
    289         z->bra = z->c; /* ], line 83 */ 
    290         if (!r_R1(z)) goto lab1; /* call R1, line 83 */ 
     328        z->bra = z->c; /* ], line 85 */ 
     329        {   int ret = r_R1(z); 
     330            if (ret == 0) goto lab1; /* call R1, line 85 */ 
     331            if (ret < 0) return ret; 
     332        } 
    291333        switch(among_var) { 
    292334            case 0: goto lab1; 
    293335            case 1: 
    294                 slice_del(z); /* delete, line 85 */ 
     336                {   int ret = slice_del(z); /* delete, line 87 */ 
     337                    if (ret < 0) return ret; 
     338                } 
    295339                break; 
    296340            case 2: 
    297                 if (!(in_grouping_b(z, g_st_ending, 98, 116))) goto lab1; 
    298                 {   int c = z->c - 3; 
    299                     if (z->lb > c || c > z->l) goto lab1; 
    300                     z->c = c; /* hop, line 88 */ 
    301                 } 
    302                 slice_del(z); /* delete, line 88 */ 
     341                if (in_grouping_b(z, g_st_ending, 98, 116, 0)) goto lab1; 
     342                {   int ret = z->c - 3; 
     343                    if (z->lb > ret || ret > z->l) goto lab1; 
     344                    z->c = ret; /* hop, line 90 */ 
     345                } 
     346                {   int ret = slice_del(z); /* delete, line 90 */ 
     347                    if (ret < 0) return ret; 
     348                } 
    303349                break; 
    304350        } 
    305351    lab1: 
    306         z->c = z->l - m; 
    307     } 
    308     {   int m = z->l - z->c; /* do, line 92 */ 
    309         z->ket = z->c; /* [, line 93 */ 
    310         among_var = find_among_b(z, a_4, 8); /* substring, line 93 */ 
     352        z->c = z->l - m2; 
     353    } 
     354    {   int m3 = z->l - z->c; (void)m3; /* do, line 94 */ 
     355        z->ket = z->c; /* [, line 95 */ 
     356        if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1051024 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab2; 
     357        among_var = find_among_b(z, a_4, 8); /* substring, line 95 */ 
    311358        if (!(among_var)) goto lab2; 
    312         z->bra = z->c; /* ], line 93 */ 
    313         if (!r_R2(z)) goto lab2; /* call R2, line 93 */ 
     359        z->bra = z->c; /* ], line 95 */ 
     360        {   int ret = r_R2(z); 
     361            if (ret == 0) goto lab2; /* call R2, line 95 */ 
     362            if (ret < 0) return ret; 
     363        } 
    314364        switch(among_var) { 
    315365            case 0: goto lab2; 
    316366            case 1: 
    317                 slice_del(z); /* delete, line 95 */ 
    318                 {   int m = z->l - z->c; /* try, line 96 */ 
    319                     z->ket = z->c; /* [, line 96 */ 
    320                     if (!(eq_s_b(z, 2, s_11))) { z->c = z->l - m; goto lab3; } 
    321                     z->bra = z->c; /* ], line 96 */ 
    322                     {   int m = z->l - z->c; /* not, line 96 */ 
     367                {   int ret = slice_del(z); /* delete, line 97 */ 
     368                    if (ret < 0) return ret; 
     369                } 
     370                {   int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 98 */ 
     371                    z->ket = z->c; /* [, line 98 */ 
     372                    if (!(eq_s_b(z, 2, s_11))) { z->c = z->l - m_keep; goto lab3; } 
     373                    z->bra = z->c; /* ], line 98 */ 
     374                    {   int m4 = z->l - z->c; (void)m4; /* not, line 98 */ 
    323375                        if (!(eq_s_b(z, 1, s_12))) goto lab4; 
    324                         { z->c = z->l - m; goto lab3; } 
     376                        { z->c = z->l - m_keep; goto lab3; } 
    325377                    lab4: 
    326                         z->c = z->l - m; 
    327                     } 
    328                     if (!r_R2(z)) { z->c = z->l - m; goto lab3; } /* call R2, line 96 */ 
    329                     slice_del(z); /* delete, line 96 */ 
     378                        z->c = z->l - m4; 
     379                    } 
     380                    {   int ret = r_R2(z); 
     381                        if (ret == 0) { z->c = z->l - m_keep; goto lab3; } /* call R2, line 98 */ 
     382                        if (ret < 0) return ret; 
     383                    } 
     384                    {   int ret = slice_del(z); /* delete, line 98 */ 
     385                        if (ret < 0) return ret; 
     386                    } 
    330387                lab3: 
    331388                    ; 
     
    333390                break; 
    334391            case 2: 
    335                 {   int m = z->l - z->c; /* not, line 99 */ 
     392                {   int m5 = z->l - z->c; (void)m5; /* not, line 101 */ 
    336393                    if (!(eq_s_b(z, 1, s_13))) goto lab5; 
    337394                    goto lab2; 
    338395                lab5: 
    339                     z->c = z->l - m; 
    340                 } 
    341                 slice_del(z); /* delete, line 99 */ 
     396                    z->c = z->l - m5; 
     397                } 
     398                {   int ret = slice_del(z); /* delete, line 101 */ 
     399                    if (ret < 0) return ret; 
     400                } 
    342401                break; 
    343402            case 3: 
    344                 slice_del(z); /* delete, line 102 */ 
    345                 {   int m = z->l - z->c; /* try, line 103 */ 
    346                     z->ket = z->c; /* [, line 104 */ 
    347                     {   int m = z->l - z->c; /* or, line 104 */ 
     403                {   int ret = slice_del(z); /* delete, line 104 */ 
     404                    if (ret < 0) return ret; 
     405                } 
     406                {   int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 105 */ 
     407                    z->ket = z->c; /* [, line 106 */ 
     408                    {   int m6 = z->l - z->c; (void)m6; /* or, line 106 */ 
    348409                        if (!(eq_s_b(z, 2, s_14))) goto lab8; 
    349410                        goto lab7; 
    350411                    lab8: 
    351                         z->c = z->l - m
    352                         if (!(eq_s_b(z, 2, s_15))) { z->c = z->l - m; goto lab6; } 
     412                        z->c = z->l - m6
     413                        if (!(eq_s_b(z, 2, s_15))) { z->c = z->l - m_keep; goto lab6; } 
    353414                    } 
    354415                lab7: 
    355                     z->bra = z->c; /* ], line 104 */ 
    356                     if (!r_R1(z)) { z->c = z->l - m; goto lab6; } /* call R1, line 104 */ 
    357                     slice_del(z); /* delete, line 104 */ 
     416                    z->bra = z->c; /* ], line 106 */ 
     417                    {   int ret = r_R1(z); 
     418                        if (ret == 0) { z->c = z->l - m_keep; goto lab6; } /* call R1, line 106 */ 
     419                        if (ret < 0) return ret; 
     420                    } 
     421                    {   int ret = slice_del(z); /* delete, line 106 */ 
     422                        if (ret < 0) return ret; 
     423                    } 
    358424                lab6: 
    359425                    ; 
     
    361427                break; 
    362428            case 4: 
    363                 slice_del(z); /* delete, line 108 */ 
    364                 {   int m = z->l - z->c; /* try, line 109 */ 
    365                     z->ket = z->c; /* [, line 110 */ 
    366                     among_var = find_among_b(z, a_3, 2); /* substring, line 110 */ 
    367                     if (!(among_var)) { z->c = z->l - m; goto lab9; } 
    368                     z->bra = z->c; /* ], line 110 */ 
    369                     if (!r_R2(z)) { z->c = z->l - m; goto lab9; } /* call R2, line 110 */ 
     429                {   int ret = slice_del(z); /* delete, line 110 */ 
     430                    if (ret < 0) return ret; 
     431                } 
     432                {   int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 111 */ 
     433                    z->ket = z->c; /* [, line 112 */ 
     434                    if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 103 && z->p[z->c - 1] != 104)) { z->c = z->l - m_keep; goto lab9; } 
     435                    among_var = find_among_b(z, a_3, 2); /* substring, line 112 */ 
     436                    if (!(among_var)) { z->c = z->l - m_keep; goto lab9; } 
     437                    z->bra = z->c; /* ], line 112 */ 
     438