ferret 0.11.6 → 0.11.8.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. data/README +10 -22
  2. data/RELEASE_CHANGES +137 -0
  3. data/RELEASE_NOTES +60 -0
  4. data/Rakefile +379 -274
  5. data/TODO +100 -8
  6. data/bin/ferret-browser +0 -0
  7. data/ext/BZLIB_blocksort.c +1094 -0
  8. data/ext/BZLIB_bzlib.c +1578 -0
  9. data/ext/BZLIB_compress.c +672 -0
  10. data/ext/BZLIB_crctable.c +104 -0
  11. data/ext/BZLIB_decompress.c +626 -0
  12. data/ext/BZLIB_huffman.c +205 -0
  13. data/ext/BZLIB_randtable.c +84 -0
  14. data/ext/{api.c → STEMMER_api.c} +7 -10
  15. data/ext/{libstemmer.c → STEMMER_libstemmer.c} +3 -2
  16. data/ext/{stem_ISO_8859_1_danish.c → STEMMER_stem_ISO_8859_1_danish.c} +123 -124
  17. data/ext/{stem_ISO_8859_1_dutch.c → STEMMER_stem_ISO_8859_1_dutch.c} +177 -188
  18. data/ext/STEMMER_stem_ISO_8859_1_english.c +1117 -0
  19. data/ext/{stem_ISO_8859_1_finnish.c → STEMMER_stem_ISO_8859_1_finnish.c} +276 -306
  20. data/ext/STEMMER_stem_ISO_8859_1_french.c +1246 -0
  21. data/ext/{stem_ISO_8859_1_german.c → STEMMER_stem_ISO_8859_1_german.c} +161 -170
  22. data/ext/STEMMER_stem_ISO_8859_1_hungarian.c +1230 -0
  23. data/ext/STEMMER_stem_ISO_8859_1_italian.c +1065 -0
  24. data/ext/STEMMER_stem_ISO_8859_1_norwegian.c +297 -0
  25. data/ext/{stem_ISO_8859_1_porter.c → STEMMER_stem_ISO_8859_1_porter.c} +263 -290
  26. data/ext/{stem_ISO_8859_1_portuguese.c → STEMMER_stem_ISO_8859_1_portuguese.c} +362 -380
  27. data/ext/STEMMER_stem_ISO_8859_1_spanish.c +1093 -0
  28. data/ext/STEMMER_stem_ISO_8859_1_swedish.c +307 -0
  29. data/ext/STEMMER_stem_ISO_8859_2_romanian.c +998 -0
  30. data/ext/{stem_KOI8_R_russian.c → STEMMER_stem_KOI8_R_russian.c} +244 -245
  31. data/ext/STEMMER_stem_UTF_8_danish.c +339 -0
  32. data/ext/{stem_UTF_8_dutch.c → STEMMER_stem_UTF_8_dutch.c} +192 -211
  33. data/ext/STEMMER_stem_UTF_8_english.c +1125 -0
  34. data/ext/{stem_UTF_8_finnish.c → STEMMER_stem_UTF_8_finnish.c} +284 -324
  35. data/ext/STEMMER_stem_UTF_8_french.c +1256 -0
  36. data/ext/{stem_UTF_8_german.c → STEMMER_stem_UTF_8_german.c} +170 -187
  37. data/ext/STEMMER_stem_UTF_8_hungarian.c +1234 -0
  38. data/ext/STEMMER_stem_UTF_8_italian.c +1073 -0
  39. data/ext/STEMMER_stem_UTF_8_norwegian.c +299 -0
  40. data/ext/{stem_UTF_8_porter.c → STEMMER_stem_UTF_8_porter.c} +271 -310
  41. data/ext/STEMMER_stem_UTF_8_portuguese.c +1023 -0
  42. data/ext/STEMMER_stem_UTF_8_romanian.c +1004 -0
  43. data/ext/STEMMER_stem_UTF_8_russian.c +694 -0
  44. data/ext/STEMMER_stem_UTF_8_spanish.c +1097 -0
  45. data/ext/STEMMER_stem_UTF_8_swedish.c +309 -0
  46. data/ext/STEMMER_stem_UTF_8_turkish.c +2205 -0
  47. data/ext/{utilities.c → STEMMER_utilities.c} +100 -68
  48. data/ext/analysis.c +276 -121
  49. data/ext/analysis.h +190 -143
  50. data/ext/api.h +3 -4
  51. data/ext/array.c +5 -3
  52. data/ext/array.h +52 -43
  53. data/ext/bitvector.c +38 -482
  54. data/ext/bitvector.h +446 -124
  55. data/ext/bzlib.h +282 -0
  56. data/ext/bzlib_private.h +503 -0
  57. data/ext/compound_io.c +23 -22
  58. data/ext/config.h +21 -11
  59. data/ext/document.c +43 -40
  60. data/ext/document.h +31 -21
  61. data/ext/except.c +20 -38
  62. data/ext/except.h +89 -76
  63. data/ext/extconf.rb +3 -2
  64. data/ext/ferret.c +49 -35
  65. data/ext/ferret.h +14 -11
  66. data/ext/field_index.c +262 -0
  67. data/ext/field_index.h +52 -0
  68. data/ext/filter.c +11 -10
  69. data/ext/fs_store.c +65 -47
  70. data/ext/global.c +245 -165
  71. data/ext/global.h +252 -54
  72. data/ext/hash.c +200 -243
  73. data/ext/hash.h +205 -163
  74. data/ext/hashset.c +118 -96
  75. data/ext/hashset.h +110 -82
  76. data/ext/header.h +19 -19
  77. data/ext/helper.c +11 -10
  78. data/ext/helper.h +14 -6
  79. data/ext/index.c +745 -366
  80. data/ext/index.h +503 -529
  81. data/ext/internal.h +1020 -0
  82. data/ext/lang.c +10 -0
  83. data/ext/lang.h +35 -15
  84. data/ext/mempool.c +5 -4
  85. data/ext/mempool.h +30 -22
  86. data/ext/modules.h +35 -7
  87. data/ext/multimapper.c +43 -2
  88. data/ext/multimapper.h +32 -23
  89. data/ext/posh.c +0 -0
  90. data/ext/posh.h +4 -38
  91. data/ext/priorityqueue.c +10 -12
  92. data/ext/priorityqueue.h +33 -21
  93. data/ext/q_boolean.c +22 -9
  94. data/ext/q_const_score.c +3 -2
  95. data/ext/q_filtered_query.c +15 -12
  96. data/ext/q_fuzzy.c +147 -135
  97. data/ext/q_match_all.c +3 -2
  98. data/ext/q_multi_term.c +28 -32
  99. data/ext/q_parser.c +451 -173
  100. data/ext/q_phrase.c +158 -79
  101. data/ext/q_prefix.c +16 -18
  102. data/ext/q_range.c +363 -31
  103. data/ext/q_span.c +130 -141
  104. data/ext/q_term.c +21 -21
  105. data/ext/q_wildcard.c +19 -23
  106. data/ext/r_analysis.c +369 -242
  107. data/ext/r_index.c +421 -434
  108. data/ext/r_qparser.c +142 -92
  109. data/ext/r_search.c +790 -407
  110. data/ext/r_store.c +44 -44
  111. data/ext/r_utils.c +264 -96
  112. data/ext/ram_store.c +29 -23
  113. data/ext/scanner.c +895 -0
  114. data/ext/scanner.h +36 -0
  115. data/ext/scanner_mb.c +6701 -0
  116. data/ext/scanner_utf8.c +4415 -0
  117. data/ext/search.c +210 -87
  118. data/ext/search.h +556 -488
  119. data/ext/similarity.c +17 -16
  120. data/ext/similarity.h +51 -44
  121. data/ext/sort.c +157 -354
  122. data/ext/stem_ISO_8859_1_hungarian.h +16 -0
  123. data/ext/stem_ISO_8859_2_romanian.h +16 -0
  124. data/ext/stem_UTF_8_hungarian.h +16 -0
  125. data/ext/stem_UTF_8_romanian.h +16 -0
  126. data/ext/stem_UTF_8_turkish.h +16 -0
  127. data/ext/stopwords.c +287 -278
  128. data/ext/store.c +57 -51
  129. data/ext/store.h +308 -286
  130. data/ext/symbol.c +10 -0
  131. data/ext/symbol.h +23 -0
  132. data/ext/term_vectors.c +14 -293
  133. data/ext/threading.h +22 -22
  134. data/ext/win32.h +12 -4
  135. data/lib/ferret.rb +2 -1
  136. data/lib/ferret/browser.rb +1 -1
  137. data/lib/ferret/field_symbol.rb +94 -0
  138. data/lib/ferret/index.rb +221 -34
  139. data/lib/ferret/number_tools.rb +6 -6
  140. data/lib/ferret/version.rb +3 -0
  141. data/test/{unit → long_running}/largefile/tc_largefile.rb +1 -1
  142. data/test/test_helper.rb +7 -2
  143. data/test/test_installed.rb +1 -0
  144. data/test/threading/thread_safety_index_test.rb +10 -1
  145. data/test/threading/thread_safety_read_write_test.rb +4 -7
  146. data/test/threading/thread_safety_test.rb +0 -0
  147. data/test/unit/analysis/tc_analyzer.rb +29 -27
  148. data/test/unit/analysis/tc_token_stream.rb +23 -16
  149. data/test/unit/index/tc_index.rb +116 -11
  150. data/test/unit/index/tc_index_reader.rb +27 -27
  151. data/test/unit/index/tc_index_writer.rb +10 -0
  152. data/test/unit/index/th_doc.rb +38 -21
  153. data/test/unit/search/tc_filter.rb +31 -10
  154. data/test/unit/search/tc_index_searcher.rb +6 -0
  155. data/test/unit/search/tm_searcher.rb +53 -1
  156. data/test/unit/store/tc_fs_store.rb +40 -2
  157. data/test/unit/store/tc_ram_store.rb +0 -0
  158. data/test/unit/store/tm_store.rb +0 -0
  159. data/test/unit/store/tm_store_lock.rb +7 -6
  160. data/test/unit/tc_field_symbol.rb +26 -0
  161. data/test/unit/ts_analysis.rb +0 -0
  162. data/test/unit/ts_index.rb +0 -0
  163. data/test/unit/ts_store.rb +0 -0
  164. data/test/unit/ts_utils.rb +0 -0
  165. data/test/unit/utils/tc_number_tools.rb +0 -0
  166. data/test/utils/content_generator.rb +226 -0
  167. metadata +262 -221
  168. data/ext/inc/lang.h +0 -48
  169. data/ext/inc/threading.h +0 -31
  170. data/ext/stem_ISO_8859_1_english.c +0 -1156
  171. data/ext/stem_ISO_8859_1_french.c +0 -1276
  172. data/ext/stem_ISO_8859_1_italian.c +0 -1091
  173. data/ext/stem_ISO_8859_1_norwegian.c +0 -296
  174. data/ext/stem_ISO_8859_1_spanish.c +0 -1119
  175. data/ext/stem_ISO_8859_1_swedish.c +0 -307
  176. data/ext/stem_UTF_8_danish.c +0 -344
  177. data/ext/stem_UTF_8_english.c +0 -1176
  178. data/ext/stem_UTF_8_french.c +0 -1296
  179. data/ext/stem_UTF_8_italian.c +0 -1113
  180. data/ext/stem_UTF_8_norwegian.c +0 -302
  181. data/ext/stem_UTF_8_portuguese.c +0 -1055
  182. data/ext/stem_UTF_8_russian.c +0 -709
  183. data/ext/stem_UTF_8_spanish.c +0 -1137
  184. data/ext/stem_UTF_8_swedish.c +0 -313
  185. data/lib/ferret_version.rb +0 -3
@@ -3,7 +3,13 @@
3
3
 
4
4
  #include "header.h"
5
5
 
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
6
9
  extern int russian_KOI8_R_stem(struct SN_env * z);
10
+ #ifdef __cplusplus
11
+ }
12
+ #endif
7
13
  static int r_tidy_up(struct SN_env * z);
8
14
  static int r_derivational(struct SN_env * z);
9
15
  static int r_noun(struct SN_env * z);
@@ -14,21 +20,29 @@ static int r_adjective(struct SN_env * z);
14
20
  static int r_perfective_gerund(struct SN_env * z);
15
21
  static int r_R2(struct SN_env * z);
16
22
  static int r_mark_regions(struct SN_env * z);
23
+ #ifdef __cplusplus
24
+ extern "C" {
25
+ #endif
26
+
17
27
 
18
28
  extern struct SN_env * russian_KOI8_R_create_env(void);
19
29
  extern void russian_KOI8_R_close_env(struct SN_env * z);
20
30
 
21
- static symbol s_0_0[3] = { 0xD7, 0xDB, 0xC9 };
22
- static symbol s_0_1[4] = { 0xC9, 0xD7, 0xDB, 0xC9 };
23
- static symbol s_0_2[4] = { 0xD9, 0xD7, 0xDB, 0xC9 };
24
- static symbol s_0_3[1] = { 0xD7 };
25
- static symbol s_0_4[2] = { 0xC9, 0xD7 };
26
- static symbol s_0_5[2] = { 0xD9, 0xD7 };
27
- static symbol s_0_6[5] = { 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
28
- static symbol s_0_7[6] = { 0xC9, 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
29
- static symbol s_0_8[6] = { 0xD9, 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
30
-
31
- static struct among a_0[9] =
31
+
32
+ #ifdef __cplusplus
33
+ }
34
+ #endif
35
+ static const symbol s_0_0[3] = { 0xD7, 0xDB, 0xC9 };
36
+ static const symbol s_0_1[4] = { 0xC9, 0xD7, 0xDB, 0xC9 };
37
+ static const symbol s_0_2[4] = { 0xD9, 0xD7, 0xDB, 0xC9 };
38
+ static const symbol s_0_3[1] = { 0xD7 };
39
+ static const symbol s_0_4[2] = { 0xC9, 0xD7 };
40
+ static const symbol s_0_5[2] = { 0xD9, 0xD7 };
41
+ static const symbol s_0_6[5] = { 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
42
+ static const symbol s_0_7[6] = { 0xC9, 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
43
+ static const symbol s_0_8[6] = { 0xD9, 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
44
+
45
+ static const struct among a_0[9] =
32
46
  {
33
47
  /* 0 */ { 3, s_0_0, -1, 1, 0},
34
48
  /* 1 */ { 4, s_0_1, 0, 2, 0},
@@ -41,34 +55,34 @@ static struct among a_0[9] =
41
55
  /* 8 */ { 6, s_0_8, 6, 2, 0}
42
56
  };
43
57
 
44
- static symbol s_1_0[2] = { 0xC0, 0xC0 };
45
- static symbol s_1_1[2] = { 0xC5, 0xC0 };
46
- static symbol s_1_2[2] = { 0xCF, 0xC0 };
47
- static symbol s_1_3[2] = { 0xD5, 0xC0 };
48
- static symbol s_1_4[2] = { 0xC5, 0xC5 };
49
- static symbol s_1_5[2] = { 0xC9, 0xC5 };
50
- static symbol s_1_6[2] = { 0xCF, 0xC5 };
51
- static symbol s_1_7[2] = { 0xD9, 0xC5 };
52
- static symbol s_1_8[2] = { 0xC9, 0xC8 };
53
- static symbol s_1_9[2] = { 0xD9, 0xC8 };
54
- static symbol s_1_10[3] = { 0xC9, 0xCD, 0xC9 };
55
- static symbol s_1_11[3] = { 0xD9, 0xCD, 0xC9 };
56
- static symbol s_1_12[2] = { 0xC5, 0xCA };
57
- static symbol s_1_13[2] = { 0xC9, 0xCA };
58
- static symbol s_1_14[2] = { 0xCF, 0xCA };
59
- static symbol s_1_15[2] = { 0xD9, 0xCA };
60
- static symbol s_1_16[2] = { 0xC5, 0xCD };
61
- static symbol s_1_17[2] = { 0xC9, 0xCD };
62
- static symbol s_1_18[2] = { 0xCF, 0xCD };
63
- static symbol s_1_19[2] = { 0xD9, 0xCD };
64
- static symbol s_1_20[3] = { 0xC5, 0xC7, 0xCF };
65
- static symbol s_1_21[3] = { 0xCF, 0xC7, 0xCF };
66
- static symbol s_1_22[2] = { 0xC1, 0xD1 };
67
- static symbol s_1_23[2] = { 0xD1, 0xD1 };
68
- static symbol s_1_24[3] = { 0xC5, 0xCD, 0xD5 };
69
- static symbol s_1_25[3] = { 0xCF, 0xCD, 0xD5 };
70
-
71
- static struct among a_1[26] =
58
+ static const symbol s_1_0[2] = { 0xC0, 0xC0 };
59
+ static const symbol s_1_1[2] = { 0xC5, 0xC0 };
60
+ static const symbol s_1_2[2] = { 0xCF, 0xC0 };
61
+ static const symbol s_1_3[2] = { 0xD5, 0xC0 };
62
+ static const symbol s_1_4[2] = { 0xC5, 0xC5 };
63
+ static const symbol s_1_5[2] = { 0xC9, 0xC5 };
64
+ static const symbol s_1_6[2] = { 0xCF, 0xC5 };
65
+ static const symbol s_1_7[2] = { 0xD9, 0xC5 };
66
+ static const symbol s_1_8[2] = { 0xC9, 0xC8 };
67
+ static const symbol s_1_9[2] = { 0xD9, 0xC8 };
68
+ static const symbol s_1_10[3] = { 0xC9, 0xCD, 0xC9 };
69
+ static const symbol s_1_11[3] = { 0xD9, 0xCD, 0xC9 };
70
+ static const symbol s_1_12[2] = { 0xC5, 0xCA };
71
+ static const symbol s_1_13[2] = { 0xC9, 0xCA };
72
+ static const symbol s_1_14[2] = { 0xCF, 0xCA };
73
+ static const symbol s_1_15[2] = { 0xD9, 0xCA };
74
+ static const symbol s_1_16[2] = { 0xC5, 0xCD };
75
+ static const symbol s_1_17[2] = { 0xC9, 0xCD };
76
+ static const symbol s_1_18[2] = { 0xCF, 0xCD };
77
+ static const symbol s_1_19[2] = { 0xD9, 0xCD };
78
+ static const symbol s_1_20[3] = { 0xC5, 0xC7, 0xCF };
79
+ static const symbol s_1_21[3] = { 0xCF, 0xC7, 0xCF };
80
+ static const symbol s_1_22[2] = { 0xC1, 0xD1 };
81
+ static const symbol s_1_23[2] = { 0xD1, 0xD1 };
82
+ static const symbol s_1_24[3] = { 0xC5, 0xCD, 0xD5 };
83
+ static const symbol s_1_25[3] = { 0xCF, 0xCD, 0xD5 };
84
+
85
+ static const struct among a_1[26] =
72
86
  {
73
87
  /* 0 */ { 2, s_1_0, -1, 1, 0},
74
88
  /* 1 */ { 2, s_1_1, -1, 1, 0},
@@ -98,16 +112,16 @@ static struct among a_1[26] =
98
112
  /* 25 */ { 3, s_1_25, -1, 1, 0}
99
113
  };
100
114
 
101
- static symbol s_2_0[2] = { 0xC5, 0xCD };
102
- static symbol s_2_1[2] = { 0xCE, 0xCE };
103
- static symbol s_2_2[2] = { 0xD7, 0xDB };
104
- static symbol s_2_3[3] = { 0xC9, 0xD7, 0xDB };
105
- static symbol s_2_4[3] = { 0xD9, 0xD7, 0xDB };
106
- static symbol s_2_5[1] = { 0xDD };
107
- static symbol s_2_6[2] = { 0xC0, 0xDD };
108
- static symbol s_2_7[3] = { 0xD5, 0xC0, 0xDD };
115
+ static const symbol s_2_0[2] = { 0xC5, 0xCD };
116
+ static const symbol s_2_1[2] = { 0xCE, 0xCE };
117
+ static const symbol s_2_2[2] = { 0xD7, 0xDB };
118
+ static const symbol s_2_3[3] = { 0xC9, 0xD7, 0xDB };
119
+ static const symbol s_2_4[3] = { 0xD9, 0xD7, 0xDB };
120
+ static const symbol s_2_5[1] = { 0xDD };
121
+ static const symbol s_2_6[2] = { 0xC0, 0xDD };
122
+ static const symbol s_2_7[3] = { 0xD5, 0xC0, 0xDD };
109
123
 
110
- static struct among a_2[8] =
124
+ static const struct among a_2[8] =
111
125
  {
112
126
  /* 0 */ { 2, s_2_0, -1, 1, 0},
113
127
  /* 1 */ { 2, s_2_1, -1, 1, 0},
@@ -119,63 +133,63 @@ static struct among a_2[8] =
119
133
  /* 7 */ { 3, s_2_7, 6, 2, 0}
120
134
  };
121
135
 
122
- static symbol s_3_0[2] = { 0xD3, 0xD1 };
123
- static symbol s_3_1[2] = { 0xD3, 0xD8 };
136
+ static const symbol s_3_0[2] = { 0xD3, 0xD1 };
137
+ static const symbol s_3_1[2] = { 0xD3, 0xD8 };
124
138
 
125
- static struct among a_3[2] =
139
+ static const struct among a_3[2] =
126
140
  {
127
141
  /* 0 */ { 2, s_3_0, -1, 1, 0},
128
142
  /* 1 */ { 2, s_3_1, -1, 1, 0}
129
143
  };
130
144
 
131
- static symbol s_4_0[1] = { 0xC0 };
132
- static symbol s_4_1[2] = { 0xD5, 0xC0 };
133
- static symbol s_4_2[2] = { 0xCC, 0xC1 };
134
- static symbol s_4_3[3] = { 0xC9, 0xCC, 0xC1 };
135
- static symbol s_4_4[3] = { 0xD9, 0xCC, 0xC1 };
136
- static symbol s_4_5[2] = { 0xCE, 0xC1 };
137
- static symbol s_4_6[3] = { 0xC5, 0xCE, 0xC1 };
138
- static symbol s_4_7[3] = { 0xC5, 0xD4, 0xC5 };
139
- static symbol s_4_8[3] = { 0xC9, 0xD4, 0xC5 };
140
- static symbol s_4_9[3] = { 0xCA, 0xD4, 0xC5 };
141
- static symbol s_4_10[4] = { 0xC5, 0xCA, 0xD4, 0xC5 };
142
- static symbol s_4_11[4] = { 0xD5, 0xCA, 0xD4, 0xC5 };
143
- static symbol s_4_12[2] = { 0xCC, 0xC9 };
144
- static symbol s_4_13[3] = { 0xC9, 0xCC, 0xC9 };
145
- static symbol s_4_14[3] = { 0xD9, 0xCC, 0xC9 };
146
- static symbol s_4_15[1] = { 0xCA };
147
- static symbol s_4_16[2] = { 0xC5, 0xCA };
148
- static symbol s_4_17[2] = { 0xD5, 0xCA };
149
- static symbol s_4_18[1] = { 0xCC };
150
- static symbol s_4_19[2] = { 0xC9, 0xCC };
151
- static symbol s_4_20[2] = { 0xD9, 0xCC };
152
- static symbol s_4_21[2] = { 0xC5, 0xCD };
153
- static symbol s_4_22[2] = { 0xC9, 0xCD };
154
- static symbol s_4_23[2] = { 0xD9, 0xCD };
155
- static symbol s_4_24[1] = { 0xCE };
156
- static symbol s_4_25[2] = { 0xC5, 0xCE };
157
- static symbol s_4_26[2] = { 0xCC, 0xCF };
158
- static symbol s_4_27[3] = { 0xC9, 0xCC, 0xCF };
159
- static symbol s_4_28[3] = { 0xD9, 0xCC, 0xCF };
160
- static symbol s_4_29[2] = { 0xCE, 0xCF };
161
- static symbol s_4_30[3] = { 0xC5, 0xCE, 0xCF };
162
- static symbol s_4_31[3] = { 0xCE, 0xCE, 0xCF };
163
- static symbol s_4_32[2] = { 0xC0, 0xD4 };
164
- static symbol s_4_33[3] = { 0xD5, 0xC0, 0xD4 };
165
- static symbol s_4_34[2] = { 0xC5, 0xD4 };
166
- static symbol s_4_35[3] = { 0xD5, 0xC5, 0xD4 };
167
- static symbol s_4_36[2] = { 0xC9, 0xD4 };
168
- static symbol s_4_37[2] = { 0xD1, 0xD4 };
169
- static symbol s_4_38[2] = { 0xD9, 0xD4 };
170
- static symbol s_4_39[2] = { 0xD4, 0xD8 };
171
- static symbol s_4_40[3] = { 0xC9, 0xD4, 0xD8 };
172
- static symbol s_4_41[3] = { 0xD9, 0xD4, 0xD8 };
173
- static symbol s_4_42[3] = { 0xC5, 0xDB, 0xD8 };
174
- static symbol s_4_43[3] = { 0xC9, 0xDB, 0xD8 };
175
- static symbol s_4_44[2] = { 0xCE, 0xD9 };
176
- static symbol s_4_45[3] = { 0xC5, 0xCE, 0xD9 };
177
-
178
- static struct among a_4[46] =
145
+ static const symbol s_4_0[1] = { 0xC0 };
146
+ static const symbol s_4_1[2] = { 0xD5, 0xC0 };
147
+ static const symbol s_4_2[2] = { 0xCC, 0xC1 };
148
+ static const symbol s_4_3[3] = { 0xC9, 0xCC, 0xC1 };
149
+ static const symbol s_4_4[3] = { 0xD9, 0xCC, 0xC1 };
150
+ static const symbol s_4_5[2] = { 0xCE, 0xC1 };
151
+ static const symbol s_4_6[3] = { 0xC5, 0xCE, 0xC1 };
152
+ static const symbol s_4_7[3] = { 0xC5, 0xD4, 0xC5 };
153
+ static const symbol s_4_8[3] = { 0xC9, 0xD4, 0xC5 };
154
+ static const symbol s_4_9[3] = { 0xCA, 0xD4, 0xC5 };
155
+ static const symbol s_4_10[4] = { 0xC5, 0xCA, 0xD4, 0xC5 };
156
+ static const symbol s_4_11[4] = { 0xD5, 0xCA, 0xD4, 0xC5 };
157
+ static const symbol s_4_12[2] = { 0xCC, 0xC9 };
158
+ static const symbol s_4_13[3] = { 0xC9, 0xCC, 0xC9 };
159
+ static const symbol s_4_14[3] = { 0xD9, 0xCC, 0xC9 };
160
+ static const symbol s_4_15[1] = { 0xCA };
161
+ static const symbol s_4_16[2] = { 0xC5, 0xCA };
162
+ static const symbol s_4_17[2] = { 0xD5, 0xCA };
163
+ static const symbol s_4_18[1] = { 0xCC };
164
+ static const symbol s_4_19[2] = { 0xC9, 0xCC };
165
+ static const symbol s_4_20[2] = { 0xD9, 0xCC };
166
+ static const symbol s_4_21[2] = { 0xC5, 0xCD };
167
+ static const symbol s_4_22[2] = { 0xC9, 0xCD };
168
+ static const symbol s_4_23[2] = { 0xD9, 0xCD };
169
+ static const symbol s_4_24[1] = { 0xCE };
170
+ static const symbol s_4_25[2] = { 0xC5, 0xCE };
171
+ static const symbol s_4_26[2] = { 0xCC, 0xCF };
172
+ static const symbol s_4_27[3] = { 0xC9, 0xCC, 0xCF };
173
+ static const symbol s_4_28[3] = { 0xD9, 0xCC, 0xCF };
174
+ static const symbol s_4_29[2] = { 0xCE, 0xCF };
175
+ static const symbol s_4_30[3] = { 0xC5, 0xCE, 0xCF };
176
+ static const symbol s_4_31[3] = { 0xCE, 0xCE, 0xCF };
177
+ static const symbol s_4_32[2] = { 0xC0, 0xD4 };
178
+ static const symbol s_4_33[3] = { 0xD5, 0xC0, 0xD4 };
179
+ static const symbol s_4_34[2] = { 0xC5, 0xD4 };
180
+ static const symbol s_4_35[3] = { 0xD5, 0xC5, 0xD4 };
181
+ static const symbol s_4_36[2] = { 0xC9, 0xD4 };
182
+ static const symbol s_4_37[2] = { 0xD1, 0xD4 };
183
+ static const symbol s_4_38[2] = { 0xD9, 0xD4 };
184
+ static const symbol s_4_39[2] = { 0xD4, 0xD8 };
185
+ static const symbol s_4_40[3] = { 0xC9, 0xD4, 0xD8 };
186
+ static const symbol s_4_41[3] = { 0xD9, 0xD4, 0xD8 };
187
+ static const symbol s_4_42[3] = { 0xC5, 0xDB, 0xD8 };
188
+ static const symbol s_4_43[3] = { 0xC9, 0xDB, 0xD8 };
189
+ static const symbol s_4_44[2] = { 0xCE, 0xD9 };
190
+ static const symbol s_4_45[3] = { 0xC5, 0xCE, 0xD9 };
191
+
192
+ static const struct among a_4[46] =
179
193
  {
180
194
  /* 0 */ { 1, s_4_0, -1, 2, 0},
181
195
  /* 1 */ { 2, s_4_1, 0, 2, 0},
@@ -225,44 +239,44 @@ static struct among a_4[46] =
225
239
  /* 45 */ { 3, s_4_45, 44, 2, 0}
226
240
  };
227
241
 
228
- static symbol s_5_0[1] = { 0xC0 };
229
- static symbol s_5_1[2] = { 0xC9, 0xC0 };
230
- static symbol s_5_2[2] = { 0xD8, 0xC0 };
231
- static symbol s_5_3[1] = { 0xC1 };
232
- static symbol s_5_4[1] = { 0xC5 };
233
- static symbol s_5_5[2] = { 0xC9, 0xC5 };
234
- static symbol s_5_6[2] = { 0xD8, 0xC5 };
235
- static symbol s_5_7[2] = { 0xC1, 0xC8 };
236
- static symbol s_5_8[2] = { 0xD1, 0xC8 };
237
- static symbol s_5_9[3] = { 0xC9, 0xD1, 0xC8 };
238
- static symbol s_5_10[1] = { 0xC9 };
239
- static symbol s_5_11[2] = { 0xC5, 0xC9 };
240
- static symbol s_5_12[2] = { 0xC9, 0xC9 };
241
- static symbol s_5_13[3] = { 0xC1, 0xCD, 0xC9 };
242
- static symbol s_5_14[3] = { 0xD1, 0xCD, 0xC9 };
243
- static symbol s_5_15[4] = { 0xC9, 0xD1, 0xCD, 0xC9 };
244
- static symbol s_5_16[1] = { 0xCA };
245
- static symbol s_5_17[2] = { 0xC5, 0xCA };
246
- static symbol s_5_18[3] = { 0xC9, 0xC5, 0xCA };
247
- static symbol s_5_19[2] = { 0xC9, 0xCA };
248
- static symbol s_5_20[2] = { 0xCF, 0xCA };
249
- static symbol s_5_21[2] = { 0xC1, 0xCD };
250
- static symbol s_5_22[2] = { 0xC5, 0xCD };
251
- static symbol s_5_23[3] = { 0xC9, 0xC5, 0xCD };
252
- static symbol s_5_24[2] = { 0xCF, 0xCD };
253
- static symbol s_5_25[2] = { 0xD1, 0xCD };
254
- static symbol s_5_26[3] = { 0xC9, 0xD1, 0xCD };
255
- static symbol s_5_27[1] = { 0xCF };
256
- static symbol s_5_28[1] = { 0xD1 };
257
- static symbol s_5_29[2] = { 0xC9, 0xD1 };
258
- static symbol s_5_30[2] = { 0xD8, 0xD1 };
259
- static symbol s_5_31[1] = { 0xD5 };
260
- static symbol s_5_32[2] = { 0xC5, 0xD7 };
261
- static symbol s_5_33[2] = { 0xCF, 0xD7 };
262
- static symbol s_5_34[1] = { 0xD8 };
263
- static symbol s_5_35[1] = { 0xD9 };
264
-
265
- static struct among a_5[36] =
242
+ static const symbol s_5_0[1] = { 0xC0 };
243
+ static const symbol s_5_1[2] = { 0xC9, 0xC0 };
244
+ static const symbol s_5_2[2] = { 0xD8, 0xC0 };
245
+ static const symbol s_5_3[1] = { 0xC1 };
246
+ static const symbol s_5_4[1] = { 0xC5 };
247
+ static const symbol s_5_5[2] = { 0xC9, 0xC5 };
248
+ static const symbol s_5_6[2] = { 0xD8, 0xC5 };
249
+ static const symbol s_5_7[2] = { 0xC1, 0xC8 };
250
+ static const symbol s_5_8[2] = { 0xD1, 0xC8 };
251
+ static const symbol s_5_9[3] = { 0xC9, 0xD1, 0xC8 };
252
+ static const symbol s_5_10[1] = { 0xC9 };
253
+ static const symbol s_5_11[2] = { 0xC5, 0xC9 };
254
+ static const symbol s_5_12[2] = { 0xC9, 0xC9 };
255
+ static const symbol s_5_13[3] = { 0xC1, 0xCD, 0xC9 };
256
+ static const symbol s_5_14[3] = { 0xD1, 0xCD, 0xC9 };
257
+ static const symbol s_5_15[4] = { 0xC9, 0xD1, 0xCD, 0xC9 };
258
+ static const symbol s_5_16[1] = { 0xCA };
259
+ static const symbol s_5_17[2] = { 0xC5, 0xCA };
260
+ static const symbol s_5_18[3] = { 0xC9, 0xC5, 0xCA };
261
+ static const symbol s_5_19[2] = { 0xC9, 0xCA };
262
+ static const symbol s_5_20[2] = { 0xCF, 0xCA };
263
+ static const symbol s_5_21[2] = { 0xC1, 0xCD };
264
+ static const symbol s_5_22[2] = { 0xC5, 0xCD };
265
+ static const symbol s_5_23[3] = { 0xC9, 0xC5, 0xCD };
266
+ static const symbol s_5_24[2] = { 0xCF, 0xCD };
267
+ static const symbol s_5_25[2] = { 0xD1, 0xCD };
268
+ static const symbol s_5_26[3] = { 0xC9, 0xD1, 0xCD };
269
+ static const symbol s_5_27[1] = { 0xCF };
270
+ static const symbol s_5_28[1] = { 0xD1 };
271
+ static const symbol s_5_29[2] = { 0xC9, 0xD1 };
272
+ static const symbol s_5_30[2] = { 0xD8, 0xD1 };
273
+ static const symbol s_5_31[1] = { 0xD5 };
274
+ static const symbol s_5_32[2] = { 0xC5, 0xD7 };
275
+ static const symbol s_5_33[2] = { 0xCF, 0xD7 };
276
+ static const symbol s_5_34[1] = { 0xD8 };
277
+ static const symbol s_5_35[1] = { 0xD9 };
278
+
279
+ static const struct among a_5[36] =
266
280
  {
267
281
  /* 0 */ { 1, s_5_0, -1, 1, 0},
268
282
  /* 1 */ { 2, s_5_1, 0, 1, 0},
@@ -302,21 +316,21 @@ static struct among a_5[36] =
302
316
  /* 35 */ { 1, s_5_35, -1, 1, 0}
303
317
  };
304
318
 
305
- static symbol s_6_0[3] = { 0xCF, 0xD3, 0xD4 };
306
- static symbol s_6_1[4] = { 0xCF, 0xD3, 0xD4, 0xD8 };
319
+ static const symbol s_6_0[3] = { 0xCF, 0xD3, 0xD4 };
320
+ static const symbol s_6_1[4] = { 0xCF, 0xD3, 0xD4, 0xD8 };
307
321
 
308
- static struct among a_6[2] =
322
+ static const struct among a_6[2] =
309
323
  {
310
324
  /* 0 */ { 3, s_6_0, -1, 1, 0},
311
325
  /* 1 */ { 4, s_6_1, -1, 1, 0}
312
326
  };
313
327
 
314
- static symbol s_7_0[4] = { 0xC5, 0xCA, 0xDB, 0xC5 };
315
- static symbol s_7_1[1] = { 0xCE };
316
- static symbol s_7_2[1] = { 0xD8 };
317
- static symbol s_7_3[3] = { 0xC5, 0xCA, 0xDB };
328
+ static const symbol s_7_0[4] = { 0xC5, 0xCA, 0xDB, 0xC5 };
329
+ static const symbol s_7_1[1] = { 0xCE };
330
+ static const symbol s_7_2[1] = { 0xD8 };
331
+ static const symbol s_7_3[3] = { 0xC5, 0xCA, 0xDB };
318
332
 
319
- static struct among a_7[4] =
333
+ static const struct among a_7[4] =
320
334
  {
321
335
  /* 0 */ { 4, s_7_0, -1, 1, 0},
322
336
  /* 1 */ { 1, s_7_1, -1, 2, 0},
@@ -324,55 +338,47 @@ static struct among a_7[4] =
324
338
  /* 3 */ { 3, s_7_3, -1, 1, 0}
325
339
  };
326
340
 
327
- static unsigned char g_v[] = { 35, 130, 34, 18 };
341
+ static const unsigned char g_v[] = { 35, 130, 34, 18 };
328
342
 
329
- static symbol s_0[] = { 0xC1 };
330
- static symbol s_1[] = { 0xD1 };
331
- static symbol s_2[] = { 0xC1 };
332
- static symbol s_3[] = { 0xD1 };
333
- static symbol s_4[] = { 0xC1 };
334
- static symbol s_5[] = { 0xD1 };
335
- static symbol s_6[] = { 0xCE };
336
- static symbol s_7[] = { 0xCE };
337
- static symbol s_8[] = { 0xCE };
338
- static symbol s_9[] = { 0xC9 };
343
+ static const symbol s_0[] = { 0xC1 };
344
+ static const symbol s_1[] = { 0xD1 };
345
+ static const symbol s_2[] = { 0xC1 };
346
+ static const symbol s_3[] = { 0xD1 };
347
+ static const symbol s_4[] = { 0xC1 };
348
+ static const symbol s_5[] = { 0xD1 };
349
+ static const symbol s_6[] = { 0xCE };
350
+ static const symbol s_7[] = { 0xCE };
351
+ static const symbol s_8[] = { 0xCE };
352
+ static const symbol s_9[] = { 0xC9 };
339
353
 
340
354
  static int r_mark_regions(struct SN_env * z) {
341
355
  z->I[0] = z->l;
342
356
  z->I[1] = z->l;
343
- { int c = z->c; /* do, line 63 */
344
- while(1) { /* gopast, line 64 */
345
- if (!(in_grouping(z, g_v, 192, 220))) goto lab1;
346
- break;
347
- lab1:
348
- if (z->c >= z->l) goto lab0;
349
- z->c++; /* gopast, line 64 */
357
+ { int c1 = z->c; /* do, line 63 */
358
+ { /* gopast */ /* grouping v, line 64 */
359
+ int ret = out_grouping(z, g_v, 192, 220, 1);
360
+ if (ret < 0) goto lab0;
361
+ z->c += ret;
350
362
  }
351
363
  z->I[0] = z->c; /* setmark pV, line 64 */
352
- while(1) { /* gopast, line 64 */
353
- if (!(out_grouping(z, g_v, 192, 220))) goto lab2;
354
- break;
355
- lab2:
356
- if (z->c >= z->l) goto lab0;
357
- z->c++; /* gopast, line 64 */
364
+ { /* gopast */ /* non v, line 64 */
365
+ int ret = in_grouping(z, g_v, 192, 220, 1);
366
+ if (ret < 0) goto lab0;
367
+ z->c += ret;
358
368
  }
359
- while(1) { /* gopast, line 65 */
360
- if (!(in_grouping(z, g_v, 192, 220))) goto lab3;
361
- break;
362
- lab3:
363
- if (z->c >= z->l) goto lab0;
364
- z->c++; /* gopast, line 65 */
369
+ { /* gopast */ /* grouping v, line 65 */
370
+ int ret = out_grouping(z, g_v, 192, 220, 1);
371
+ if (ret < 0) goto lab0;
372
+ z->c += ret;
365
373
  }
366
- while(1) { /* gopast, line 65 */
367
- if (!(out_grouping(z, g_v, 192, 220))) goto lab4;
368
- break;
369
- lab4:
370
- if (z->c >= z->l) goto lab0;
371
- z->c++; /* gopast, line 65 */
374
+ { /* gopast */ /* non v, line 65 */
375
+ int ret = in_grouping(z, g_v, 192, 220, 1);
376
+ if (ret < 0) goto lab0;
377
+ z->c += ret;
372
378
  }
373
379
  z->I[1] = z->c; /* setmark p2, line 65 */
374
380
  lab0:
375
- z->c = c;
381
+ z->c = c1;
376
382
  }
377
383
  return 1;
378
384
  }
@@ -385,28 +391,27 @@ static int r_R2(struct SN_env * z) {
385
391
  static int r_perfective_gerund(struct SN_env * z) {
386
392
  int among_var;
387
393
  z->ket = z->c; /* [, line 74 */
394
+ if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((25166336 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
388
395
  among_var = find_among_b(z, a_0, 9); /* substring, line 74 */
389
396
  if (!(among_var)) return 0;
390
397
  z->bra = z->c; /* ], line 74 */
391
398
  switch(among_var) {
392
399
  case 0: return 0;
393
400
  case 1:
394
- { int m = z->l - z->c; (void) m; /* or, line 78 */
401
+ { int m1 = z->l - z->c; (void)m1; /* or, line 78 */
395
402
  if (!(eq_s_b(z, 1, s_0))) goto lab1;
396
403
  goto lab0;
397
404
  lab1:
398
- z->c = z->l - m;
405
+ z->c = z->l - m1;
399
406
  if (!(eq_s_b(z, 1, s_1))) return 0;
400
407
  }
401
408
  lab0:
402
- { int ret;
403
- ret = slice_del(z); /* delete, line 78 */
409
+ { int ret = slice_del(z); /* delete, line 78 */
404
410
  if (ret < 0) return ret;
405
411
  }
406
412
  break;
407
413
  case 2:
408
- { int ret;
409
- ret = slice_del(z); /* delete, line 85 */
414
+ { int ret = slice_del(z); /* delete, line 85 */
410
415
  if (ret < 0) return ret;
411
416
  }
412
417
  break;
@@ -417,14 +422,14 @@ static int r_perfective_gerund(struct SN_env * z) {
417
422
  static int r_adjective(struct SN_env * z) {
418
423
  int among_var;
419
424
  z->ket = z->c; /* [, line 90 */
425
+ if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((2271009 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
420
426
  among_var = find_among_b(z, a_1, 26); /* substring, line 90 */
421
427
  if (!(among_var)) return 0;
422
428
  z->bra = z->c; /* ], line 90 */
423
429
  switch(among_var) {
424
430
  case 0: return 0;
425
431
  case 1:
426
- { int ret;
427
- ret = slice_del(z); /* delete, line 99 */
432
+ { int ret = slice_del(z); /* delete, line 99 */
428
433
  if (ret < 0) return ret;
429
434
  }
430
435
  break;
@@ -438,30 +443,29 @@ static int r_adjectival(struct SN_env * z) {
438
443
  if (ret == 0) return 0; /* call adjective, line 104 */
439
444
  if (ret < 0) return ret;
440
445
  }
441
- { int m = z->l - z->c; (void) m; /* try, line 111 */
446
+ { int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 111 */
442
447
  z->ket = z->c; /* [, line 112 */
448
+ if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((671113216 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->c = z->l - m_keep; goto lab0; }
443
449
  among_var = find_among_b(z, a_2, 8); /* substring, line 112 */
444
- if (!(among_var)) { z->c = z->l - m; goto lab0; }
450
+ if (!(among_var)) { z->c = z->l - m_keep; goto lab0; }
445
451
  z->bra = z->c; /* ], line 112 */
446
452
  switch(among_var) {
447
- case 0: { z->c = z->l - m; goto lab0; }
453
+ case 0: { z->c = z->l - m_keep; goto lab0; }
448
454
  case 1:
449
- { int m = z->l - z->c; (void) m; /* or, line 117 */
455
+ { int m1 = z->l - z->c; (void)m1; /* or, line 117 */
450
456
  if (!(eq_s_b(z, 1, s_2))) goto lab2;
451
457
  goto lab1;
452
458
  lab2:
453
- z->c = z->l - m;
454
- if (!(eq_s_b(z, 1, s_3))) { z->c = z->l - m; goto lab0; }
459
+ z->c = z->l - m1;
460
+ if (!(eq_s_b(z, 1, s_3))) { z->c = z->l - m_keep; goto lab0; }
455
461
  }
456
462
  lab1:
457
- { int ret;
458
- ret = slice_del(z); /* delete, line 117 */
463
+ { int ret = slice_del(z); /* delete, line 117 */
459
464
  if (ret < 0) return ret;
460
465
  }
461
466
  break;
462
467
  case 2:
463
- { int ret;
464
- ret = slice_del(z); /* delete, line 124 */
468
+ { int ret = slice_del(z); /* delete, line 124 */
465
469
  if (ret < 0) return ret;
466
470
  }
467
471
  break;
@@ -475,14 +479,14 @@ static int r_adjectival(struct SN_env * z) {
475
479
  static int r_reflexive(struct SN_env * z) {
476
480
  int among_var;
477
481
  z->ket = z->c; /* [, line 131 */
482
+ if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 209 && z->p[z->c - 1] != 216)) return 0;
478
483
  among_var = find_among_b(z, a_3, 2); /* substring, line 131 */
479
484
  if (!(among_var)) return 0;
480
485
  z->bra = z->c; /* ], line 131 */
481
486
  switch(among_var) {
482
487
  case 0: return 0;
483
488
  case 1:
484
- { int ret;
485
- ret = slice_del(z); /* delete, line 134 */
489
+ { int ret = slice_del(z); /* delete, line 134 */
486
490
  if (ret < 0) return ret;
487
491
  }
488
492
  break;
@@ -493,28 +497,27 @@ static int r_reflexive(struct SN_env * z) {
493
497
  static int r_verb(struct SN_env * z) {
494
498
  int among_var;
495
499
  z->ket = z->c; /* [, line 139 */
500
+ if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((51443235 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
496
501
  among_var = find_among_b(z, a_4, 46); /* substring, line 139 */
497
502
  if (!(among_var)) return 0;
498
503
  z->bra = z->c; /* ], line 139 */
499
504
  switch(among_var) {
500
505
  case 0: return 0;
501
506
  case 1:
502
- { int m = z->l - z->c; (void) m; /* or, line 145 */
507
+ { int m1 = z->l - z->c; (void)m1; /* or, line 145 */
503
508
  if (!(eq_s_b(z, 1, s_4))) goto lab1;
504
509
  goto lab0;
505
510
  lab1:
506
- z->c = z->l - m;
511
+ z->c = z->l - m1;
507
512
  if (!(eq_s_b(z, 1, s_5))) return 0;
508
513
  }
509
514
  lab0:
510
- { int ret;
511
- ret = slice_del(z); /* delete, line 145 */
515
+ { int ret = slice_del(z); /* delete, line 145 */
512
516
  if (ret < 0) return ret;
513
517
  }
514
518
  break;
515
519
  case 2:
516
- { int ret;
517
- ret = slice_del(z); /* delete, line 153 */
520
+ { int ret = slice_del(z); /* delete, line 153 */
518
521
  if (ret < 0) return ret;
519
522
  }
520
523
  break;
@@ -525,14 +528,14 @@ static int r_verb(struct SN_env * z) {
525
528
  static int r_noun(struct SN_env * z) {
526
529
  int among_var;
527
530
  z->ket = z->c; /* [, line 162 */
531
+ if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((60991267 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
528
532
  among_var = find_among_b(z, a_5, 36); /* substring, line 162 */
529
533
  if (!(among_var)) return 0;
530
534
  z->bra = z->c; /* ], line 162 */
531
535
  switch(among_var) {
532
536
  case 0: return 0;
533
537
  case 1:
534
- { int ret;
535
- ret = slice_del(z); /* delete, line 169 */
538
+ { int ret = slice_del(z); /* delete, line 169 */
536
539
  if (ret < 0) return ret;
537
540
  }
538
541
  break;
@@ -543,6 +546,7 @@ static int r_noun(struct SN_env * z) {
543
546
  static int r_derivational(struct SN_env * z) {
544
547
  int among_var;
545
548
  z->ket = z->c; /* [, line 178 */
549
+ if (z->c - 2 <= z->lb || (z->p[z->c - 1] != 212 && z->p[z->c - 1] != 216)) return 0;
546
550
  among_var = find_among_b(z, a_6, 2); /* substring, line 178 */
547
551
  if (!(among_var)) return 0;
548
552
  z->bra = z->c; /* ], line 178 */
@@ -553,8 +557,7 @@ static int r_derivational(struct SN_env * z) {
553
557
  switch(among_var) {
554
558
  case 0: return 0;
555
559
  case 1:
556
- { int ret;
557
- ret = slice_del(z); /* delete, line 181 */
560
+ { int ret = slice_del(z); /* delete, line 181 */
558
561
  if (ret < 0) return ret;
559
562
  }
560
563
  break;
@@ -565,35 +568,32 @@ static int r_derivational(struct SN_env * z) {
565
568
  static int r_tidy_up(struct SN_env * z) {
566
569
  int among_var;
567
570
  z->ket = z->c; /* [, line 186 */
571
+ if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((151011360 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
568
572
  among_var = find_among_b(z, a_7, 4); /* substring, line 186 */
569
573
  if (!(among_var)) return 0;
570
574
  z->bra = z->c; /* ], line 186 */
571
575
  switch(among_var) {
572
576
  case 0: return 0;
573
577
  case 1:
574
- { int ret;
575
- ret = slice_del(z); /* delete, line 190 */
578
+ { int ret = slice_del(z); /* delete, line 190 */
576
579
  if (ret < 0) return ret;
577
580
  }
578
581
  z->ket = z->c; /* [, line 191 */
579
582
  if (!(eq_s_b(z, 1, s_6))) return 0;
580
583
  z->bra = z->c; /* ], line 191 */
581
584
  if (!(eq_s_b(z, 1, s_7))) return 0;
582
- { int ret;
583
- ret = slice_del(z); /* delete, line 191 */
585
+ { int ret = slice_del(z); /* delete, line 191 */
584
586
  if (ret < 0) return ret;
585
587
  }
586
588
  break;
587
589
  case 2:
588
590
  if (!(eq_s_b(z, 1, s_8))) return 0;
589
- { int ret;
590
- ret = slice_del(z); /* delete, line 194 */
591
+ { int ret = slice_del(z); /* delete, line 194 */
591
592
  if (ret < 0) return ret;
592
593
  }
593
594
  break;
594
595
  case 3:
595
- { int ret;
596
- ret = slice_del(z); /* delete, line 196 */
596
+ { int ret = slice_del(z); /* delete, line 196 */
597
597
  if (ret < 0) return ret;
598
598
  }
599
599
  break;
@@ -602,54 +602,54 @@ static int r_tidy_up(struct SN_env * z) {
602
602
  }
603
603
 
604
604
  extern int russian_KOI8_R_stem(struct SN_env * z) {
605
- { int c = z->c; /* do, line 203 */
605
+ { int c1 = z->c; /* do, line 203 */
606
606
  { int ret = r_mark_regions(z);
607
607
  if (ret == 0) goto lab0; /* call mark_regions, line 203 */
608
608
  if (ret < 0) return ret;
609
609
  }
610
610
  lab0:
611
- z->c = c;
611
+ z->c = c1;
612
612
  }
613
613
  z->lb = z->c; z->c = z->l; /* backwards, line 204 */
614
614
 
615
- { int m3; /* setlimit, line 204 */
616
- int m = z->l - z->c; (void) m;
615
+ { int mlimit; /* setlimit, line 204 */
616
+ int m2 = z->l - z->c; (void)m2;
617
617
  if (z->c < z->I[0]) return 0;
618
618
  z->c = z->I[0]; /* tomark, line 204 */
619
- m3 = z->lb; z->lb = z->c;
620
- z->c = z->l - m;
621
- { int m = z->l - z->c; (void) m; /* do, line 205 */
622
- { int m = z->l - z->c; (void) m; /* or, line 206 */
619
+ mlimit = z->lb; z->lb = z->c;
620
+ z->c = z->l - m2;
621
+ { int m3 = z->l - z->c; (void)m3; /* do, line 205 */
622
+ { int m4 = z->l - z->c; (void)m4; /* or, line 206 */
623
623
  { int ret = r_perfective_gerund(z);
624
624
  if (ret == 0) goto lab3; /* call perfective_gerund, line 206 */
625
625
  if (ret < 0) return ret;
626
626
  }
627
627
  goto lab2;
628
628
  lab3:
629
- z->c = z->l - m;
630
- { int m = z->l - z->c; (void) m; /* try, line 207 */
629
+ z->c = z->l - m4;
630
+ { int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 207 */
631
631
  { int ret = r_reflexive(z);
632
- if (ret == 0) { z->c = z->l - m; goto lab4; } /* call reflexive, line 207 */
632
+ if (ret == 0) { z->c = z->l - m_keep; goto lab4; } /* call reflexive, line 207 */
633
633
  if (ret < 0) return ret;
634
634
  }
635
635
  lab4:
636
636
  ;
637
637
  }
638
- { int m = z->l - z->c; (void) m; /* or, line 208 */
638
+ { int m5 = z->l - z->c; (void)m5; /* or, line 208 */
639
639
  { int ret = r_adjectival(z);
640
640
  if (ret == 0) goto lab6; /* call adjectival, line 208 */
641
641
  if (ret < 0) return ret;
642
642
  }
643
643
  goto lab5;
644
644
  lab6:
645
- z->c = z->l - m;
645
+ z->c = z->l - m5;
646
646
  { int ret = r_verb(z);
647
647
  if (ret == 0) goto lab7; /* call verb, line 208 */
648
648
  if (ret < 0) return ret;
649
649
  }
650
650
  goto lab5;
651
651
  lab7:
652
- z->c = z->l - m;
652
+ z->c = z->l - m5;
653
653
  { int ret = r_noun(z);
654
654
  if (ret == 0) goto lab1; /* call noun, line 208 */
655
655
  if (ret < 0) return ret;
@@ -660,36 +660,35 @@ extern int russian_KOI8_R_stem(struct SN_env * z) {
660
660
  }
661
661
  lab2:
662
662
  lab1:
663
- z->c = z->l - m;
663
+ z->c = z->l - m3;
664
664
  }
665
- { int m = z->l - z->c; (void) m; /* try, line 211 */
665
+ { int m_keep = z->l - z->c;/* (void) m_keep;*/ /* try, line 211 */
666
666
  z->ket = z->c; /* [, line 211 */
667
- if (!(eq_s_b(z, 1, s_9))) { z->c = z->l - m; goto lab8; }
667
+ if (!(eq_s_b(z, 1, s_9))) { z->c = z->l - m_keep; goto lab8; }
668
668
  z->bra = z->c; /* ], line 211 */
669
- { int ret;
670
- ret = slice_del(z); /* delete, line 211 */
669
+ { int ret = slice_del(z); /* delete, line 211 */
671
670
  if (ret < 0) return ret;
672
671
  }
673
672
  lab8:
674
673
  ;
675
674
  }
676
- { int m = z->l - z->c; (void) m; /* do, line 214 */
675
+ { int m6 = z->l - z->c; (void)m6; /* do, line 214 */
677
676
  { int ret = r_derivational(z);
678
677
  if (ret == 0) goto lab9; /* call derivational, line 214 */
679
678
  if (ret < 0) return ret;
680
679
  }
681
680
  lab9:
682
- z->c = z->l - m;
681
+ z->c = z->l - m6;
683
682
  }
684
- { int m = z->l - z->c; (void) m; /* do, line 215 */
683
+ { int m7 = z->l - z->c; (void)m7; /* do, line 215 */
685
684
  { int ret = r_tidy_up(z);
686
685
  if (ret == 0) goto lab10; /* call tidy_up, line 215 */
687
686
  if (ret < 0) return ret;
688
687
  }
689
688
  lab10:
690
- z->c = z->l - m;
689
+ z->c = z->l - m7;
691
690
  }
692
- z->lb = m3;
691
+ z->lb = mlimit;
693
692
  }
694
693
  z->c = z->lb;
695
694
  return 1;
@@ -697,5 +696,5 @@ extern int russian_KOI8_R_stem(struct SN_env * z) {
697
696
 
698
697
  extern struct SN_env * russian_KOI8_R_create_env(void) { return SN_create_env(0, 2, 0); }
699
698
 
700
- extern void russian_KOI8_R_close_env(struct SN_env * z) { SN_close_env(z); }
699
+ extern void russian_KOI8_R_close_env(struct SN_env * z) { SN_close_env(z, 0); }
701
700