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
@@ -0,0 +1,339 @@
1
+
2
+ /* This file was generated automatically by the Snowball to ANSI C compiler */
3
+
4
+ #include "header.h"
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+ extern int danish_UTF_8_stem(struct SN_env * z);
10
+ #ifdef __cplusplus
11
+ }
12
+ #endif
13
+ static int r_undouble(struct SN_env * z);
14
+ static int r_other_suffix(struct SN_env * z);
15
+ static int r_consonant_pair(struct SN_env * z);
16
+ static int r_main_suffix(struct SN_env * z);
17
+ static int r_mark_regions(struct SN_env * z);
18
+ #ifdef __cplusplus
19
+ extern "C" {
20
+ #endif
21
+
22
+
23
+ extern struct SN_env * danish_UTF_8_create_env(void);
24
+ extern void danish_UTF_8_close_env(struct SN_env * z);
25
+
26
+
27
+ #ifdef __cplusplus
28
+ }
29
+ #endif
30
+ static const symbol s_0_0[3] = { 'h', 'e', 'd' };
31
+ static const symbol s_0_1[5] = { 'e', 't', 'h', 'e', 'd' };
32
+ static const symbol s_0_2[4] = { 'e', 'r', 'e', 'd' };
33
+ static const symbol s_0_3[1] = { 'e' };
34
+ static const symbol s_0_4[5] = { 'e', 'r', 'e', 'd', 'e' };
35
+ static const symbol s_0_5[4] = { 'e', 'n', 'd', 'e' };
36
+ static const symbol s_0_6[6] = { 'e', 'r', 'e', 'n', 'd', 'e' };
37
+ static const symbol s_0_7[3] = { 'e', 'n', 'e' };
38
+ static const symbol s_0_8[4] = { 'e', 'r', 'n', 'e' };
39
+ static const symbol s_0_9[3] = { 'e', 'r', 'e' };
40
+ static const symbol s_0_10[2] = { 'e', 'n' };
41
+ static const symbol s_0_11[5] = { 'h', 'e', 'd', 'e', 'n' };
42
+ static const symbol s_0_12[4] = { 'e', 'r', 'e', 'n' };
43
+ static const symbol s_0_13[2] = { 'e', 'r' };
44
+ static const symbol s_0_14[5] = { 'h', 'e', 'd', 'e', 'r' };
45
+ static const symbol s_0_15[4] = { 'e', 'r', 'e', 'r' };
46
+ static const symbol s_0_16[1] = { 's' };
47
+ static const symbol s_0_17[4] = { 'h', 'e', 'd', 's' };
48
+ static const symbol s_0_18[2] = { 'e', 's' };
49
+ static const symbol s_0_19[5] = { 'e', 'n', 'd', 'e', 's' };
50
+ static const symbol s_0_20[7] = { 'e', 'r', 'e', 'n', 'd', 'e', 's' };
51
+ static const symbol s_0_21[4] = { 'e', 'n', 'e', 's' };
52
+ static const symbol s_0_22[5] = { 'e', 'r', 'n', 'e', 's' };
53
+ static const symbol s_0_23[4] = { 'e', 'r', 'e', 's' };
54
+ static const symbol s_0_24[3] = { 'e', 'n', 's' };
55
+ static const symbol s_0_25[6] = { 'h', 'e', 'd', 'e', 'n', 's' };
56
+ static const symbol s_0_26[5] = { 'e', 'r', 'e', 'n', 's' };
57
+ static const symbol s_0_27[3] = { 'e', 'r', 's' };
58
+ static const symbol s_0_28[3] = { 'e', 't', 's' };
59
+ static const symbol s_0_29[5] = { 'e', 'r', 'e', 't', 's' };
60
+ static const symbol s_0_30[2] = { 'e', 't' };
61
+ static const symbol s_0_31[4] = { 'e', 'r', 'e', 't' };
62
+
63
+ static const struct among a_0[32] =
64
+ {
65
+ /* 0 */ { 3, s_0_0, -1, 1, 0},
66
+ /* 1 */ { 5, s_0_1, 0, 1, 0},
67
+ /* 2 */ { 4, s_0_2, -1, 1, 0},
68
+ /* 3 */ { 1, s_0_3, -1, 1, 0},
69
+ /* 4 */ { 5, s_0_4, 3, 1, 0},
70
+ /* 5 */ { 4, s_0_5, 3, 1, 0},
71
+ /* 6 */ { 6, s_0_6, 5, 1, 0},
72
+ /* 7 */ { 3, s_0_7, 3, 1, 0},
73
+ /* 8 */ { 4, s_0_8, 3, 1, 0},
74
+ /* 9 */ { 3, s_0_9, 3, 1, 0},
75
+ /* 10 */ { 2, s_0_10, -1, 1, 0},
76
+ /* 11 */ { 5, s_0_11, 10, 1, 0},
77
+ /* 12 */ { 4, s_0_12, 10, 1, 0},
78
+ /* 13 */ { 2, s_0_13, -1, 1, 0},
79
+ /* 14 */ { 5, s_0_14, 13, 1, 0},
80
+ /* 15 */ { 4, s_0_15, 13, 1, 0},
81
+ /* 16 */ { 1, s_0_16, -1, 2, 0},
82
+ /* 17 */ { 4, s_0_17, 16, 1, 0},
83
+ /* 18 */ { 2, s_0_18, 16, 1, 0},
84
+ /* 19 */ { 5, s_0_19, 18, 1, 0},
85
+ /* 20 */ { 7, s_0_20, 19, 1, 0},
86
+ /* 21 */ { 4, s_0_21, 18, 1, 0},
87
+ /* 22 */ { 5, s_0_22, 18, 1, 0},
88
+ /* 23 */ { 4, s_0_23, 18, 1, 0},
89
+ /* 24 */ { 3, s_0_24, 16, 1, 0},
90
+ /* 25 */ { 6, s_0_25, 24, 1, 0},
91
+ /* 26 */ { 5, s_0_26, 24, 1, 0},
92
+ /* 27 */ { 3, s_0_27, 16, 1, 0},
93
+ /* 28 */ { 3, s_0_28, 16, 1, 0},
94
+ /* 29 */ { 5, s_0_29, 28, 1, 0},
95
+ /* 30 */ { 2, s_0_30, -1, 1, 0},
96
+ /* 31 */ { 4, s_0_31, 30, 1, 0}
97
+ };
98
+
99
+ static const symbol s_1_0[2] = { 'g', 'd' };
100
+ static const symbol s_1_1[2] = { 'd', 't' };
101
+ static const symbol s_1_2[2] = { 'g', 't' };
102
+ static const symbol s_1_3[2] = { 'k', 't' };
103
+
104
+ static const struct among a_1[4] =
105
+ {
106
+ /* 0 */ { 2, s_1_0, -1, -1, 0},
107
+ /* 1 */ { 2, s_1_1, -1, -1, 0},
108
+ /* 2 */ { 2, s_1_2, -1, -1, 0},
109
+ /* 3 */ { 2, s_1_3, -1, -1, 0}
110
+ };
111
+
112
+ static const symbol s_2_0[2] = { 'i', 'g' };
113
+ static const symbol s_2_1[3] = { 'l', 'i', 'g' };
114
+ static const symbol s_2_2[4] = { 'e', 'l', 'i', 'g' };
115
+ static const symbol s_2_3[3] = { 'e', 'l', 's' };
116
+ static const symbol s_2_4[5] = { 'l', 0xC3, 0xB8, 's', 't' };
117
+
118
+ static const struct among a_2[5] =
119
+ {
120
+ /* 0 */ { 2, s_2_0, -1, 1, 0},
121
+ /* 1 */ { 3, s_2_1, 0, 1, 0},
122
+ /* 2 */ { 4, s_2_2, 1, 1, 0},
123
+ /* 3 */ { 3, s_2_3, -1, 1, 0},
124
+ /* 4 */ { 5, s_2_4, -1, 2, 0}
125
+ };
126
+
127
+ static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
128
+
129
+ static const unsigned char g_s_ending[] = { 239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 };
130
+
131
+ static const symbol s_0[] = { 's', 't' };
132
+ static const symbol s_1[] = { 'i', 'g' };
133
+ static const symbol s_2[] = { 'l', 0xC3, 0xB8, 's' };
134
+
135
+ static int r_mark_regions(struct SN_env * z) {
136
+ z->I[0] = z->l;
137
+ { int c_test = z->c; /* test, line 33 */
138
+ { int ret = skip_utf8(z->p, z->c, 0, z->l, + 3);
139
+ if (ret < 0) return 0;
140
+ z->c = ret; /* hop, line 33 */
141
+ }
142
+ z->I[1] = z->c; /* setmark x, line 33 */
143
+ z->c = c_test;
144
+ }
145
+ if (out_grouping_U(z, g_v, 97, 248, 1) < 0) return 0; /* goto */ /* grouping v, line 34 */
146
+ { /* gopast */ /* non v, line 34 */
147
+ int ret = in_grouping_U(z, g_v, 97, 248, 1);
148
+ if (ret < 0) return 0;
149
+ z->c += ret;
150
+ }
151
+ z->I[0] = z->c; /* setmark p1, line 34 */
152
+ /* try, line 35 */
153
+ if (!(z->I[0] < z->I[1])) goto lab0;
154
+ z->I[0] = z->I[1];
155
+ lab0:
156
+ return 1;
157
+ }
158
+
159
+ static int r_main_suffix(struct SN_env * z) {
160
+ int among_var;
161
+ { int mlimit; /* setlimit, line 41 */
162
+ int m1 = z->l - z->c; (void)m1;
163
+ if (z->c < z->I[0]) return 0;
164
+ z->c = z->I[0]; /* tomark, line 41 */
165
+ mlimit = z->lb; z->lb = z->c;
166
+ z->c = z->l - m1;
167
+ z->ket = z->c; /* [, line 41 */
168
+ if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1851440 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
169
+ among_var = find_among_b(z, a_0, 32); /* substring, line 41 */
170
+ if (!(among_var)) { z->lb = mlimit; return 0; }
171
+ z->bra = z->c; /* ], line 41 */
172
+ z->lb = mlimit;
173
+ }
174
+ switch(among_var) {
175
+ case 0: return 0;
176
+ case 1:
177
+ { int ret = slice_del(z); /* delete, line 48 */
178
+ if (ret < 0) return ret;
179
+ }
180
+ break;
181
+ case 2:
182
+ if (in_grouping_b_U(z, g_s_ending, 97, 229, 0)) return 0;
183
+ { int ret = slice_del(z); /* delete, line 50 */
184
+ if (ret < 0) return ret;
185
+ }
186
+ break;
187
+ }
188
+ return 1;
189
+ }
190
+
191
+ static int r_consonant_pair(struct SN_env * z) {
192
+ { int m_test = z->l - z->c; /* test, line 55 */
193
+ { int mlimit; /* setlimit, line 56 */
194
+ int m1 = z->l - z->c; (void)m1;
195
+ if (z->c < z->I[0]) return 0;
196
+ z->c = z->I[0]; /* tomark, line 56 */
197
+ mlimit = z->lb; z->lb = z->c;
198
+ z->c = z->l - m1;
199
+ z->ket = z->c; /* [, line 56 */
200
+ if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 100 && z->p[z->c - 1] != 116)) { z->lb = mlimit; return 0; }
201
+ if (!(find_among_b(z, a_1, 4))) { z->lb = mlimit; return 0; } /* substring, line 56 */
202
+ z->bra = z->c; /* ], line 56 */
203
+ z->lb = mlimit;
204
+ }
205
+ z->c = z->l - m_test;
206
+ }
207
+ { int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
208
+ if (ret < 0) return 0;
209
+ z->c = ret; /* next, line 62 */
210
+ }
211
+ z->bra = z->c; /* ], line 62 */
212
+ { int ret = slice_del(z); /* delete, line 62 */
213
+ if (ret < 0) return ret;
214
+ }
215
+ return 1;
216
+ }
217
+
218
+ static int r_other_suffix(struct SN_env * z) {
219
+ int among_var;
220
+ { int m1 = z->l - z->c; (void)m1; /* do, line 66 */
221
+ z->ket = z->c; /* [, line 66 */
222
+ if (!(eq_s_b(z, 2, s_0))) goto lab0;
223
+ z->bra = z->c; /* ], line 66 */
224
+ if (!(eq_s_b(z, 2, s_1))) goto lab0;
225
+ { int ret = slice_del(z); /* delete, line 66 */
226
+ if (ret < 0) return ret;
227
+ }
228
+ lab0:
229
+ z->c = z->l - m1;
230
+ }
231
+ { int mlimit; /* setlimit, line 67 */
232
+ int m2 = z->l - z->c; (void)m2;
233
+ if (z->c < z->I[0]) return 0;
234
+ z->c = z->I[0]; /* tomark, line 67 */
235
+ mlimit = z->lb; z->lb = z->c;
236
+ z->c = z->l - m2;
237
+ z->ket = z->c; /* [, line 67 */
238
+ if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1572992 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
239
+ among_var = find_among_b(z, a_2, 5); /* substring, line 67 */
240
+ if (!(among_var)) { z->lb = mlimit; return 0; }
241
+ z->bra = z->c; /* ], line 67 */
242
+ z->lb = mlimit;
243
+ }
244
+ switch(among_var) {
245
+ case 0: return 0;
246
+ case 1:
247
+ { int ret = slice_del(z); /* delete, line 70 */
248
+ if (ret < 0) return ret;
249
+ }
250
+ { int m3 = z->l - z->c; (void)m3; /* do, line 70 */
251
+ { int ret = r_consonant_pair(z);
252
+ if (ret == 0) goto lab1; /* call consonant_pair, line 70 */
253
+ if (ret < 0) return ret;
254
+ }
255
+ lab1:
256
+ z->c = z->l - m3;
257
+ }
258
+ break;
259
+ case 2:
260
+ { int ret = slice_from_s(z, 4, s_2); /* <-, line 72 */
261
+ if (ret < 0) return ret;
262
+ }
263
+ break;
264
+ }
265
+ return 1;
266
+ }
267
+
268
+ static int r_undouble(struct SN_env * z) {
269
+ { int mlimit; /* setlimit, line 76 */
270
+ int m1 = z->l - z->c; (void)m1;
271
+ if (z->c < z->I[0]) return 0;
272
+ z->c = z->I[0]; /* tomark, line 76 */
273
+ mlimit = z->lb; z->lb = z->c;
274
+ z->c = z->l - m1;
275
+ z->ket = z->c; /* [, line 76 */
276
+ if (out_grouping_b_U(z, g_v, 97, 248, 0)) { z->lb = mlimit; return 0; }
277
+ z->bra = z->c; /* ], line 76 */
278
+ z->S[0] = slice_to(z, z->S[0]); /* -> ch, line 76 */
279
+ if (z->S[0] == 0) return -1; /* -> ch, line 76 */
280
+ z->lb = mlimit;
281
+ }
282
+ if (!(eq_v_b(z, z->S[0]))) return 0; /* name ch, line 77 */
283
+ { int ret = slice_del(z); /* delete, line 78 */
284
+ if (ret < 0) return ret;
285
+ }
286
+ return 1;
287
+ }
288
+
289
+ extern int danish_UTF_8_stem(struct SN_env * z) {
290
+ { int c1 = z->c; /* do, line 84 */
291
+ { int ret = r_mark_regions(z);
292
+ if (ret == 0) goto lab0; /* call mark_regions, line 84 */
293
+ if (ret < 0) return ret;
294
+ }
295
+ lab0:
296
+ z->c = c1;
297
+ }
298
+ z->lb = z->c; z->c = z->l; /* backwards, line 85 */
299
+
300
+ { int m2 = z->l - z->c; (void)m2; /* do, line 86 */
301
+ { int ret = r_main_suffix(z);
302
+ if (ret == 0) goto lab1; /* call main_suffix, line 86 */
303
+ if (ret < 0) return ret;
304
+ }
305
+ lab1:
306
+ z->c = z->l - m2;
307
+ }
308
+ { int m3 = z->l - z->c; (void)m3; /* do, line 87 */
309
+ { int ret = r_consonant_pair(z);
310
+ if (ret == 0) goto lab2; /* call consonant_pair, line 87 */
311
+ if (ret < 0) return ret;
312
+ }
313
+ lab2:
314
+ z->c = z->l - m3;
315
+ }
316
+ { int m4 = z->l - z->c; (void)m4; /* do, line 88 */
317
+ { int ret = r_other_suffix(z);
318
+ if (ret == 0) goto lab3; /* call other_suffix, line 88 */
319
+ if (ret < 0) return ret;
320
+ }
321
+ lab3:
322
+ z->c = z->l - m4;
323
+ }
324
+ { int m5 = z->l - z->c; (void)m5; /* do, line 89 */
325
+ { int ret = r_undouble(z);
326
+ if (ret == 0) goto lab4; /* call undouble, line 89 */
327
+ if (ret < 0) return ret;
328
+ }
329
+ lab4:
330
+ z->c = z->l - m5;
331
+ }
332
+ z->c = z->lb;
333
+ return 1;
334
+ }
335
+
336
+ extern struct SN_env * danish_UTF_8_create_env(void) { return SN_create_env(1, 2, 0); }
337
+
338
+ extern void danish_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 1); }
339
+
@@ -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 dutch_UTF_8_stem(struct SN_env * z);
10
+ #ifdef __cplusplus
11
+ }
12
+ #endif
7
13
  static int r_standard_suffix(struct SN_env * z);
8
14
  static int r_undouble(struct SN_env * z);
9
15
  static int r_R2(struct SN_env * z);
@@ -13,22 +19,30 @@ static int r_en_ending(struct SN_env * z);
13
19
  static int r_e_ending(struct SN_env * z);
14
20
  static int r_postlude(struct SN_env * z);
15
21
  static int r_prelude(struct SN_env * z);
22
+ #ifdef __cplusplus
23
+ extern "C" {
24
+ #endif
25
+
16
26
 
17
27
  extern struct SN_env * dutch_UTF_8_create_env(void);
18
28
  extern void dutch_UTF_8_close_env(struct SN_env * z);
19
29
 
20
- static symbol s_0_1[2] = { 0xC3, 0xA1 };
21
- static symbol s_0_2[2] = { 0xC3, 0xA4 };
22
- static symbol s_0_3[2] = { 0xC3, 0xA9 };
23
- static symbol s_0_4[2] = { 0xC3, 0xAB };
24
- static symbol s_0_5[2] = { 0xC3, 0xAD };
25
- static symbol s_0_6[2] = { 0xC3, 0xAF };
26
- static symbol s_0_7[2] = { 0xC3, 0xB3 };
27
- static symbol s_0_8[2] = { 0xC3, 0xB6 };
28
- static symbol s_0_9[2] = { 0xC3, 0xBA };
29
- static symbol s_0_10[2] = { 0xC3, 0xBC };
30
-
31
- static struct among a_0[11] =
30
+
31
+ #ifdef __cplusplus
32
+ }
33
+ #endif
34
+ static const symbol s_0_1[2] = { 0xC3, 0xA1 };
35
+ static const symbol s_0_2[2] = { 0xC3, 0xA4 };
36
+ static const symbol s_0_3[2] = { 0xC3, 0xA9 };
37
+ static const symbol s_0_4[2] = { 0xC3, 0xAB };
38
+ static const symbol s_0_5[2] = { 0xC3, 0xAD };
39
+ static const symbol s_0_6[2] = { 0xC3, 0xAF };
40
+ static const symbol s_0_7[2] = { 0xC3, 0xB3 };
41
+ static const symbol s_0_8[2] = { 0xC3, 0xB6 };
42
+ static const symbol s_0_9[2] = { 0xC3, 0xBA };
43
+ static const symbol s_0_10[2] = { 0xC3, 0xBC };
44
+
45
+ static const struct among a_0[11] =
32
46
  {
33
47
  /* 0 */ { 0, 0, -1, 6, 0},
34
48
  /* 1 */ { 2, s_0_1, 0, 1, 0},
@@ -43,34 +57,34 @@ static struct among a_0[11] =
43
57
  /* 10 */ { 2, s_0_10, 0, 5, 0}
44
58
  };
45
59
 
46
- static symbol s_1_1[1] = { 'I' };
47
- static symbol s_1_2[1] = { 'Y' };
60
+ static const symbol s_1_1[1] = { 'I' };
61
+ static const symbol s_1_2[1] = { 'Y' };
48
62
 
49
- static struct among a_1[3] =
63
+ static const struct among a_1[3] =
50
64
  {
51
65
  /* 0 */ { 0, 0, -1, 3, 0},
52
66
  /* 1 */ { 1, s_1_1, 0, 2, 0},
53
67
  /* 2 */ { 1, s_1_2, 0, 1, 0}
54
68
  };
55
69
 
56
- static symbol s_2_0[2] = { 'd', 'd' };
57
- static symbol s_2_1[2] = { 'k', 'k' };
58
- static symbol s_2_2[2] = { 't', 't' };
70
+ static const symbol s_2_0[2] = { 'd', 'd' };
71
+ static const symbol s_2_1[2] = { 'k', 'k' };
72
+ static const symbol s_2_2[2] = { 't', 't' };
59
73
 
60
- static struct among a_2[3] =
74
+ static const struct among a_2[3] =
61
75
  {
62
76
  /* 0 */ { 2, s_2_0, -1, -1, 0},
63
77
  /* 1 */ { 2, s_2_1, -1, -1, 0},
64
78
  /* 2 */ { 2, s_2_2, -1, -1, 0}
65
79
  };
66
80
 
67
- static symbol s_3_0[3] = { 'e', 'n', 'e' };
68
- static symbol s_3_1[2] = { 's', 'e' };
69
- static symbol s_3_2[2] = { 'e', 'n' };
70
- static symbol s_3_3[5] = { 'h', 'e', 'd', 'e', 'n' };
71
- static symbol s_3_4[1] = { 's' };
81
+ static const symbol s_3_0[3] = { 'e', 'n', 'e' };
82
+ static const symbol s_3_1[2] = { 's', 'e' };
83
+ static const symbol s_3_2[2] = { 'e', 'n' };
84
+ static const symbol s_3_3[5] = { 'h', 'e', 'd', 'e', 'n' };
85
+ static const symbol s_3_4[1] = { 's' };
72
86
 
73
- static struct among a_3[5] =
87
+ static const struct among a_3[5] =
74
88
  {
75
89
  /* 0 */ { 3, s_3_0, -1, 2, 0},
76
90
  /* 1 */ { 2, s_3_1, -1, 3, 0},
@@ -79,14 +93,14 @@ static struct among a_3[5] =
79
93
  /* 4 */ { 1, s_3_4, -1, 3, 0}
80
94
  };
81
95
 
82
- static symbol s_4_0[3] = { 'e', 'n', 'd' };
83
- static symbol s_4_1[2] = { 'i', 'g' };
84
- static symbol s_4_2[3] = { 'i', 'n', 'g' };
85
- static symbol s_4_3[4] = { 'l', 'i', 'j', 'k' };
86
- static symbol s_4_4[4] = { 'b', 'a', 'a', 'r' };
87
- static symbol s_4_5[3] = { 'b', 'a', 'r' };
96
+ static const symbol s_4_0[3] = { 'e', 'n', 'd' };
97
+ static const symbol s_4_1[2] = { 'i', 'g' };
98
+ static const symbol s_4_2[3] = { 'i', 'n', 'g' };
99
+ static const symbol s_4_3[4] = { 'l', 'i', 'j', 'k' };
100
+ static const symbol s_4_4[4] = { 'b', 'a', 'a', 'r' };
101
+ static const symbol s_4_5[3] = { 'b', 'a', 'r' };
88
102
 
89
- static struct among a_4[6] =
103
+ static const struct among a_4[6] =
90
104
  {
91
105
  /* 0 */ { 3, s_4_0, -1, 1, 0},
92
106
  /* 1 */ { 2, s_4_1, -1, 2, 0},
@@ -96,12 +110,12 @@ static struct among a_4[6] =
96
110
  /* 5 */ { 3, s_4_5, -1, 5, 0}
97
111
  };
98
112
 
99
- static symbol s_5_0[2] = { 'a', 'a' };
100
- static symbol s_5_1[2] = { 'e', 'e' };
101
- static symbol s_5_2[2] = { 'o', 'o' };
102
- static symbol s_5_3[2] = { 'u', 'u' };
113
+ static const symbol s_5_0[2] = { 'a', 'a' };
114
+ static const symbol s_5_1[2] = { 'e', 'e' };
115
+ static const symbol s_5_2[2] = { 'o', 'o' };
116
+ static const symbol s_5_3[2] = { 'u', 'u' };
103
117
 
104
- static struct among a_5[4] =
118
+ static const struct among a_5[4] =
105
119
  {
106
120
  /* 0 */ { 2, s_5_0, -1, -1, 0},
107
121
  /* 1 */ { 2, s_5_1, -1, -1, 0},
@@ -109,138 +123,131 @@ static struct among a_5[4] =
109
123
  /* 3 */ { 2, s_5_3, -1, -1, 0}
110
124
  };
111
125
 
112
- static unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
113
-
114
- static unsigned char g_v_I[] = { 1, 0, 0, 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
115
-
116
- static unsigned char g_v_j[] = { 17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
117
-
118
- static symbol s_0[] = { 'a' };
119
- static symbol s_1[] = { 'e' };
120
- static symbol s_2[] = { 'i' };
121
- static symbol s_3[] = { 'o' };
122
- static symbol s_4[] = { 'u' };
123
- static symbol s_5[] = { 'y' };
124
- static symbol s_6[] = { 'Y' };
125
- static symbol s_7[] = { 'i' };
126
- static symbol s_8[] = { 'I' };
127
- static symbol s_9[] = { 'y' };
128
- static symbol s_10[] = { 'Y' };
129
- static symbol s_11[] = { 'y' };
130
- static symbol s_12[] = { 'i' };
131
- static symbol s_13[] = { 'e' };
132
- static symbol s_14[] = { 'g', 'e', 'm' };
133
- static symbol s_15[] = { 'h', 'e', 'i', 'd' };
134
- static symbol s_16[] = { 'h', 'e', 'i', 'd' };
135
- static symbol s_17[] = { 'c' };
136
- static symbol s_18[] = { 'e', 'n' };
137
- static symbol s_19[] = { 'i', 'g' };
138
- static symbol s_20[] = { 'e' };
139
- static symbol s_21[] = { 'e' };
126
+ static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
127
+
128
+ static const unsigned char g_v_I[] = { 1, 0, 0, 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
129
+
130
+ static const unsigned char g_v_j[] = { 17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128 };
131
+
132
+ static const symbol s_0[] = { 'a' };
133
+ static const symbol s_1[] = { 'e' };
134
+ static const symbol s_2[] = { 'i' };
135
+ static const symbol s_3[] = { 'o' };
136
+ static const symbol s_4[] = { 'u' };
137
+ static const symbol s_5[] = { 'y' };
138
+ static const symbol s_6[] = { 'Y' };
139
+ static const symbol s_7[] = { 'i' };
140
+ static const symbol s_8[] = { 'I' };
141
+ static const symbol s_9[] = { 'y' };
142
+ static const symbol s_10[] = { 'Y' };
143
+ static const symbol s_11[] = { 'y' };
144
+ static const symbol s_12[] = { 'i' };
145
+ static const symbol s_13[] = { 'e' };
146
+ static const symbol s_14[] = { 'g', 'e', 'm' };
147
+ static const symbol s_15[] = { 'h', 'e', 'i', 'd' };
148
+ static const symbol s_16[] = { 'h', 'e', 'i', 'd' };
149
+ static const symbol s_17[] = { 'c' };
150
+ static const symbol s_18[] = { 'e', 'n' };
151
+ static const symbol s_19[] = { 'i', 'g' };
152
+ static const symbol s_20[] = { 'e' };
153
+ static const symbol s_21[] = { 'e' };
140
154
 
141
155
  static int r_prelude(struct SN_env * z) {
142
156
  int among_var;
143
157
  { int c_test = z->c; /* test, line 42 */
144
158
  while(1) { /* repeat, line 42 */
145
- int c = z->c;
159
+ int c1 = z->c;
146
160
  z->bra = z->c; /* [, line 43 */
161
+ if (z->c + 1 >= z->l || z->p[z->c + 1] >> 5 != 5 || !((340306450 >> (z->p[z->c + 1] & 0x1f)) & 1)) among_var = 6; else
147
162
  among_var = find_among(z, a_0, 11); /* substring, line 43 */
148
163
  if (!(among_var)) goto lab0;
149
164
  z->ket = z->c; /* ], line 43 */
150
165
  switch(among_var) {
151
166
  case 0: goto lab0;
152
167
  case 1:
153
- { int ret;
154
- ret = slice_from_s(z, 1, s_0); /* <-, line 45 */
168
+ { int ret = slice_from_s(z, 1, s_0); /* <-, line 45 */
155
169
  if (ret < 0) return ret;
156
170
  }
157
171
  break;
158
172
  case 2:
159
- { int ret;
160
- ret = slice_from_s(z, 1, s_1); /* <-, line 47 */
173
+ { int ret = slice_from_s(z, 1, s_1); /* <-, line 47 */
161
174
  if (ret < 0) return ret;
162
175
  }
163
176
  break;
164
177
  case 3:
165
- { int ret;
166
- ret = slice_from_s(z, 1, s_2); /* <-, line 49 */
178
+ { int ret = slice_from_s(z, 1, s_2); /* <-, line 49 */
167
179
  if (ret < 0) return ret;
168
180
  }
169
181
  break;
170
182
  case 4:
171
- { int ret;
172
- ret = slice_from_s(z, 1, s_3); /* <-, line 51 */
183
+ { int ret = slice_from_s(z, 1, s_3); /* <-, line 51 */
173
184
  if (ret < 0) return ret;
174
185
  }
175
186
  break;
176
187
  case 5:
177
- { int ret;
178
- ret = slice_from_s(z, 1, s_4); /* <-, line 53 */
188
+ { int ret = slice_from_s(z, 1, s_4); /* <-, line 53 */
179
189
  if (ret < 0) return ret;
180
190
  }
181
191
  break;
182
192
  case 6:
183
- { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
184
- if (c < 0) goto lab0;
185
- z->c = c; /* next, line 54 */
193
+ { int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
194
+ if (ret < 0) goto lab0;
195
+ z->c = ret; /* next, line 54 */
186
196
  }
187
197
  break;
188
198
  }
189
199
  continue;
190
200
  lab0:
191
- z->c = c;
201
+ z->c = c1;
192
202
  break;
193
203
  }
194
204
  z->c = c_test;
195
205
  }
196
- { int c = z->c; /* try, line 57 */
206
+ { int c_keep = z->c; /* try, line 57 */
197
207
  z->bra = z->c; /* [, line 57 */
198
- if (!(eq_s(z, 1, s_5))) { z->c = c; goto lab1; }
208
+ if (!(eq_s(z, 1, s_5))) { z->c = c_keep; goto lab1; }
199
209
  z->ket = z->c; /* ], line 57 */
200
- { int ret;
201
- ret = slice_from_s(z, 1, s_6); /* <-, line 57 */
210
+ { int ret = slice_from_s(z, 1, s_6); /* <-, line 57 */
202
211
  if (ret < 0) return ret;
203
212
  }
204
213
  lab1:
205
214
  ;
206
215
  }
207
216
  while(1) { /* repeat, line 58 */
208
- int c = z->c;
217
+ int c2 = z->c;
209
218
  while(1) { /* goto, line 58 */
210
- int c = z->c;
211
- if (!(in_grouping_U(z, g_v, 97, 232))) goto lab3;
219
+ int c3 = z->c;
220
+ if (in_grouping_U(z, g_v, 97, 232, 0)) goto lab3;
212
221
  z->bra = z->c; /* [, line 59 */
213
- { int c = z->c; /* or, line 59 */
222
+ { int c4 = z->c; /* or, line 59 */
214
223
  if (!(eq_s(z, 1, s_7))) goto lab5;
215
224
  z->ket = z->c; /* ], line 59 */
216
- if (!(in_grouping_U(z, g_v, 97, 232))) goto lab5;
217
- { int ret;
218
- ret = slice_from_s(z, 1, s_8); /* <-, line 59 */
225
+ if (in_grouping_U(z, g_v, 97, 232, 0)) goto lab5;
226
+ { int ret = slice_from_s(z, 1, s_8); /* <-, line 59 */
219
227
  if (ret < 0) return ret;
220
228
  }
221
229
  goto lab4;
222
230
  lab5:
223
- z->c = c;
231
+ z->c = c4;
224
232
  if (!(eq_s(z, 1, s_9))) goto lab3;
225
233
  z->ket = z->c; /* ], line 60 */
226
- { int ret;
227
- ret = slice_from_s(z, 1, s_10); /* <-, line 60 */
234
+ { int ret = slice_from_s(z, 1, s_10); /* <-, line 60 */
228
235
  if (ret < 0) return ret;
229
236
  }
230
237
  }
231
238
  lab4:
232
- z->c = c;
239
+ z->c = c3;
233
240
  break;
234
241
  lab3:
235
- z->c = c;
236
- { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
237
- if (c < 0) goto lab2;
238
- z->c = c; /* goto, line 58 */
242
+ z->c = c3;
243
+ { int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
244
+ if (ret < 0) goto lab2;
245
+ z->c = ret; /* goto, line 58 */
239
246
  }
240
247
  }
241
248
  continue;
242
249
  lab2:
243
- z->c = c;
250
+ z->c = c2;
244
251
  break;
245
252
  }
246
253
  return 1;
@@ -249,46 +256,30 @@ static int r_prelude(struct SN_env * z) {
249
256
  static int r_mark_regions(struct SN_env * z) {
250
257
  z->I[0] = z->l;
251
258
  z->I[1] = z->l;
252
- while(1) { /* gopast, line 69 */
253
- if (!(in_grouping_U(z, g_v, 97, 232))) goto lab0;
254
- break;
255
- lab0:
256
- { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
257
- if (c < 0) return 0;
258
- z->c = c; /* gopast, line 69 */
259
- }
259
+ { /* gopast */ /* grouping v, line 69 */
260
+ int ret = out_grouping_U(z, g_v, 97, 232, 1);
261
+ if (ret < 0) return 0;
262
+ z->c += ret;
260
263
  }
261
- while(1) { /* gopast, line 69 */
262
- if (!(out_grouping_U(z, g_v, 97, 232))) goto lab1;
263
- break;
264
- lab1:
265
- { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
266
- if (c < 0) return 0;
267
- z->c = c; /* gopast, line 69 */
268
- }
264
+ { /* gopast */ /* non v, line 69 */
265
+ int ret = in_grouping_U(z, g_v, 97, 232, 1);
266
+ if (ret < 0) return 0;
267
+ z->c += ret;
269
268
  }
270
269
  z->I[0] = z->c; /* setmark p1, line 69 */
271
270
  /* try, line 70 */
272
- if (!(z->I[0] < 3)) goto lab2;
271
+ if (!(z->I[0] < 3)) goto lab0;
273
272
  z->I[0] = 3;
274
- lab2:
275
- while(1) { /* gopast, line 71 */
276
- if (!(in_grouping_U(z, g_v, 97, 232))) goto lab3;
277
- break;
278
- lab3:
279
- { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
280
- if (c < 0) return 0;
281
- z->c = c; /* gopast, line 71 */
282
- }
273
+ lab0:
274
+ { /* gopast */ /* grouping v, line 71 */
275
+ int ret = out_grouping_U(z, g_v, 97, 232, 1);
276
+ if (ret < 0) return 0;
277
+ z->c += ret;
283
278
  }
284
- while(1) { /* gopast, line 71 */
285
- if (!(out_grouping_U(z, g_v, 97, 232))) goto lab4;
286
- break;
287
- lab4:
288
- { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
289
- if (c < 0) return 0;
290
- z->c = c; /* gopast, line 71 */
291
- }
279
+ { /* gopast */ /* non v, line 71 */
280
+ int ret = in_grouping_U(z, g_v, 97, 232, 1);
281
+ if (ret < 0) return 0;
282
+ z->c += ret;
292
283
  }
293
284
  z->I[1] = z->c; /* setmark p2, line 71 */
294
285
  return 1;
@@ -297,35 +288,34 @@ lab2:
297
288
  static int r_postlude(struct SN_env * z) {
298
289
  int among_var;
299
290
  while(1) { /* repeat, line 75 */
300
- int c = z->c;
291
+ int c1 = z->c;
301
292
  z->bra = z->c; /* [, line 77 */
293
+ if (z->c >= z->l || (z->p[z->c + 0] != 73 && z->p[z->c + 0] != 89)) among_var = 3; else
302
294
  among_var = find_among(z, a_1, 3); /* substring, line 77 */
303
295
  if (!(among_var)) goto lab0;
304
296
  z->ket = z->c; /* ], line 77 */
305
297
  switch(among_var) {
306
298
  case 0: goto lab0;
307
299
  case 1:
308
- { int ret;
309
- ret = slice_from_s(z, 1, s_11); /* <-, line 78 */
300
+ { int ret = slice_from_s(z, 1, s_11); /* <-, line 78 */
310
301
  if (ret < 0) return ret;
311
302
  }
312
303
  break;
313
304
  case 2:
314
- { int ret;
315
- ret = slice_from_s(z, 1, s_12); /* <-, line 79 */
305
+ { int ret = slice_from_s(z, 1, s_12); /* <-, line 79 */
316
306
  if (ret < 0) return ret;
317
307
  }
318
308
  break;
319
309
  case 3:
320
- { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
321
- if (c < 0) goto lab0;
322
- z->c = c; /* next, line 80 */
310
+ { int ret = skip_utf8(z->p, z->c, 0, z->l, 1);
311
+ if (ret < 0) goto lab0;
312
+ z->c = ret; /* next, line 80 */
323
313
  }
324
314
  break;
325
315
  }
326
316
  continue;
327
317
  lab0:
328
- z->c = c;
318
+ z->c = c1;
329
319
  break;
330
320
  }
331
321
  return 1;
@@ -343,17 +333,17 @@ static int r_R2(struct SN_env * z) {
343
333
 
344
334
  static int r_undouble(struct SN_env * z) {
345
335
  { int m_test = z->l - z->c; /* test, line 91 */
336
+ if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1050640 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
346
337
  if (!(find_among_b(z, a_2, 3))) return 0; /* among, line 91 */
347
338
  z->c = z->l - m_test;
348
339
  }
349
340
  z->ket = z->c; /* [, line 91 */
350
- { int c = skip_utf8(z->p, z->c, z->lb, 0, -1);
351
- if (c < 0) return 0;
352
- z->c = c; /* next, line 91 */
341
+ { int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
342
+ if (ret < 0) return 0;
343
+ z->c = ret; /* next, line 91 */
353
344
  }
354
345
  z->bra = z->c; /* ], line 91 */
355
- { int ret;
356
- ret = slice_del(z); /* delete, line 91 */
346
+ { int ret = slice_del(z); /* delete, line 91 */
357
347
  if (ret < 0) return ret;
358
348
  }
359
349
  return 1;
@@ -369,11 +359,10 @@ static int r_e_ending(struct SN_env * z) {
369
359
  if (ret < 0) return ret;
370
360
  }
371
361
  { int m_test = z->l - z->c; /* test, line 96 */
372
- if (!(out_grouping_b_U(z, g_v, 97, 232))) return 0;
362
+ if (out_grouping_b_U(z, g_v, 97, 232, 0)) return 0;
373
363
  z->c = z->l - m_test;
374
364
  }
375
- { int ret;
376
- ret = slice_del(z); /* delete, line 96 */
365
+ { int ret = slice_del(z); /* delete, line 96 */
377
366
  if (ret < 0) return ret;
378
367
  }
379
368
  z->B[0] = 1; /* set e_found, line 97 */
@@ -389,18 +378,17 @@ static int r_en_ending(struct SN_env * z) {
389
378
  if (ret == 0) return 0; /* call R1, line 102 */
390
379
  if (ret < 0) return ret;
391
380
  }
392
- { int m = z->l - z->c; (void) m; /* and, line 102 */
393
- if (!(out_grouping_b_U(z, g_v, 97, 232))) return 0;
394
- z->c = z->l - m;
395
- { int m = z->l - z->c; (void) m; /* not, line 102 */
381
+ { int m1 = z->l - z->c; (void)m1; /* and, line 102 */
382
+ if (out_grouping_b_U(z, g_v, 97, 232, 0)) return 0;
383
+ z->c = z->l - m1;
384
+ { int m2 = z->l - z->c; (void)m2; /* not, line 102 */
396
385
  if (!(eq_s_b(z, 3, s_14))) goto lab0;
397
386
  return 0;
398
387
  lab0:
399
- z->c = z->l - m;
388
+ z->c = z->l - m2;
400
389
  }
401
390
  }
402
- { int ret;
403
- ret = slice_del(z); /* delete, line 102 */
391
+ { int ret = slice_del(z); /* delete, line 102 */
404
392
  if (ret < 0) return ret;
405
393
  }
406
394
  { int ret = r_undouble(z);
@@ -412,8 +400,9 @@ static int r_en_ending(struct SN_env * z) {
412
400
 
413
401
  static int r_standard_suffix(struct SN_env * z) {
414
402
  int among_var;
415
- { int m = z->l - z->c; (void) m; /* do, line 107 */
403
+ { int m1 = z->l - z->c; (void)m1; /* do, line 107 */
416
404
  z->ket = z->c; /* [, line 108 */
405
+ if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((540704 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab0;
417
406
  among_var = find_among_b(z, a_3, 5); /* substring, line 108 */
418
407
  if (!(among_var)) goto lab0;
419
408
  z->bra = z->c; /* ], line 108 */
@@ -424,8 +413,7 @@ static int r_standard_suffix(struct SN_env * z) {
424
413
  if (ret == 0) goto lab0; /* call R1, line 110 */
425
414
  if (ret < 0) return ret;
426
415
  }
427
- { int ret;
428
- ret = slice_from_s(z, 4, s_15); /* <-, line 110 */
416
+ { int ret = slice_from_s(z, 4, s_15); /* <-, line 110 */
429
417
  if (ret < 0) return ret;
430
418
  }
431
419
  break;
@@ -440,25 +428,24 @@ static int r_standard_suffix(struct SN_env * z) {
440
428
  if (ret == 0) goto lab0; /* call R1, line 116 */
441
429
  if (ret < 0) return ret;
442
430
  }
443
- if (!(out_grouping_b_U(z, g_v_j, 97, 232))) goto lab0;
444
- { int ret;
445
- ret = slice_del(z); /* delete, line 116 */
431
+ if (out_grouping_b_U(z, g_v_j, 97, 232, 0)) goto lab0;
432
+ { int ret = slice_del(z); /* delete, line 116 */
446
433
  if (ret < 0) return ret;
447
434
  }
448
435
  break;
449
436
  }
450
437
  lab0:
451
- z->c = z->l - m;
438
+ z->c = z->l - m1;
452
439
  }
453
- { int m = z->l - z->c; (void) m; /* do, line 120 */
440
+ { int m2 = z->l - z->c; (void)m2; /* do, line 120 */
454
441
  { int ret = r_e_ending(z);
455
442
  if (ret == 0) goto lab1; /* call e_ending, line 120 */
456
443
  if (ret < 0) return ret;
457
444
  }
458
445
  lab1:
459
- z->c = z->l - m;
446
+ z->c = z->l - m2;
460
447
  }
461
- { int m = z->l - z->c; (void) m; /* do, line 122 */
448
+ { int m3 = z->l - z->c; (void)m3; /* do, line 122 */
462
449
  z->ket = z->c; /* [, line 122 */
463
450
  if (!(eq_s_b(z, 4, s_16))) goto lab2;
464
451
  z->bra = z->c; /* ], line 122 */
@@ -466,14 +453,13 @@ static int r_standard_suffix(struct SN_env * z) {
466
453
  if (ret == 0) goto lab2; /* call R2, line 122 */
467
454
  if (ret < 0) return ret;
468
455
  }
469
- { int m = z->l - z->c; (void) m; /* not, line 122 */
456
+ { int m4 = z->l - z->c; (void)m4; /* not, line 122 */
470
457
  if (!(eq_s_b(z, 1, s_17))) goto lab3;
471
458
  goto lab2;
472
459
  lab3:
473
- z->c = z->l - m;
460
+ z->c = z->l - m4;
474
461
  }
475
- { int ret;
476
- ret = slice_del(z); /* delete, line 122 */
462
+ { int ret = slice_del(z); /* delete, line 122 */
477
463
  if (ret < 0) return ret;
478
464
  }
479
465
  z->ket = z->c; /* [, line 123 */
@@ -484,10 +470,11 @@ static int r_standard_suffix(struct SN_env * z) {
484
470
  if (ret < 0) return ret;
485
471
  }
486
472
  lab2:
487
- z->c = z->l - m;
473
+ z->c = z->l - m3;
488
474
  }
489
- { int m = z->l - z->c; (void) m; /* do, line 126 */
475
+ { int m5 = z->l - z->c; (void)m5; /* do, line 126 */
490
476
  z->ket = z->c; /* [, line 127 */
477
+ if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((264336 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab4;
491
478
  among_var = find_among_b(z, a_4, 6); /* substring, line 127 */
492
479
  if (!(among_var)) goto lab4;
493
480
  z->bra = z->c; /* ], line 127 */
@@ -498,11 +485,10 @@ static int r_standard_suffix(struct SN_env * z) {
498
485
  if (ret == 0) goto lab4; /* call R2, line 129 */
499
486
  if (ret < 0) return ret;
500
487
  }
501
- { int ret;
502
- ret = slice_del(z); /* delete, line 129 */
488
+ { int ret = slice_del(z); /* delete, line 129 */
503
489
  if (ret < 0) return ret;
504
490
  }
505
- { int m = z->l - z->c; (void) m; /* or, line 130 */
491
+ { int m6 = z->l - z->c; (void)m6; /* or, line 130 */
506
492
  z->ket = z->c; /* [, line 130 */
507
493
  if (!(eq_s_b(z, 2, s_19))) goto lab6;
508
494
  z->bra = z->c; /* ], line 130 */
@@ -510,19 +496,18 @@ static int r_standard_suffix(struct SN_env * z) {
510
496
  if (ret == 0) goto lab6; /* call R2, line 130 */
511
497
  if (ret < 0) return ret;
512
498
  }
513
- { int m = z->l - z->c; (void) m; /* not, line 130 */
499
+ { int m7 = z->l - z->c; (void)m7; /* not, line 130 */
514
500
  if (!(eq_s_b(z, 1, s_20))) goto lab7;
515
501
  goto lab6;
516
502
  lab7:
517
- z->c = z->l - m;
503
+ z->c = z->l - m7;
518
504
  }
519
- { int ret;
520
- ret = slice_del(z); /* delete, line 130 */
505
+ { int ret = slice_del(z); /* delete, line 130 */
521
506
  if (ret < 0) return ret;
522
507
  }
523
508
  goto lab5;
524
509
  lab6:
525
- z->c = z->l - m;
510
+ z->c = z->l - m6;
526
511
  { int ret = r_undouble(z);
527
512
  if (ret == 0) goto lab4; /* call undouble, line 130 */
528
513
  if (ret < 0) return ret;
@@ -535,14 +520,13 @@ static int r_standard_suffix(struct SN_env * z) {
535
520
  if (ret == 0) goto lab4; /* call R2, line 133 */
536
521
  if (ret < 0) return ret;
537
522
  }
538
- { int m = z->l - z->c; (void) m; /* not, line 133 */
523
+ { int m8 = z->l - z->c; (void)m8; /* not, line 133 */
539
524
  if (!(eq_s_b(z, 1, s_21))) goto lab8;
540
525
  goto lab4;
541
526
  lab8:
542
- z->c = z->l - m;
527
+ z->c = z->l - m8;
543
528
  }
544
- { int ret;
545
- ret = slice_del(z); /* delete, line 133 */
529
+ { int ret = slice_del(z); /* delete, line 133 */
546
530
  if (ret < 0) return ret;
547
531
  }
548
532
  break;
@@ -551,8 +535,7 @@ static int r_standard_suffix(struct SN_env * z) {
551
535
  if (ret == 0) goto lab4; /* call R2, line 136 */
552
536
  if (ret < 0) return ret;
553
537
  }
554
- { int ret;
555
- ret = slice_del(z); /* delete, line 136 */
538
+ { int ret = slice_del(z); /* delete, line 136 */
556
539
  if (ret < 0) return ret;
557
540
  }
558
541
  { int ret = r_e_ending(z);
@@ -565,8 +548,7 @@ static int r_standard_suffix(struct SN_env * z) {
565
548
  if (ret == 0) goto lab4; /* call R2, line 139 */
566
549
  if (ret < 0) return ret;
567
550
  }
568
- { int ret;
569
- ret = slice_del(z); /* delete, line 139 */
551
+ { int ret = slice_del(z); /* delete, line 139 */
570
552
  if (ret < 0) return ret;
571
553
  }
572
554
  break;
@@ -576,78 +558,77 @@ static int r_standard_suffix(struct SN_env * z) {
576
558
  if (ret < 0) return ret;
577
559
  }
578
560
  if (!(z->B[0])) goto lab4; /* Boolean test e_found, line 142 */
579
- { int ret;
580
- ret = slice_del(z); /* delete, line 142 */
561
+ { int ret = slice_del(z); /* delete, line 142 */
581
562
  if (ret < 0) return ret;
582
563
  }
583
564
  break;
584
565
  }
585
566
  lab4:
586
- z->c = z->l - m;
567
+ z->c = z->l - m5;
587
568
  }
588
- { int m = z->l - z->c; (void) m; /* do, line 146 */
589
- if (!(out_grouping_b_U(z, g_v_I, 73, 232))) goto lab9;
569
+ { int m9 = z->l - z->c; (void)m9; /* do, line 146 */
570
+ if (out_grouping_b_U(z, g_v_I, 73, 232, 0)) goto lab9;
590
571
  { int m_test = z->l - z->c; /* test, line 148 */
572
+ if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((2129954 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab9;
591
573
  if (!(find_among_b(z, a_5, 4))) goto lab9; /* among, line 149 */
592
- if (!(out_grouping_b_U(z, g_v, 97, 232))) goto lab9;
574
+ if (out_grouping_b_U(z, g_v, 97, 232, 0)) goto lab9;
593
575
  z->c = z->l - m_test;
594
576
  }
595
577
  z->ket = z->c; /* [, line 152 */
596
- { int c = skip_utf8(z->p, z->c, z->lb, 0, -1);
597
- if (c < 0) goto lab9;
598
- z->c = c; /* next, line 152 */
578
+ { int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
579
+ if (ret < 0) goto lab9;
580
+ z->c = ret; /* next, line 152 */
599
581
  }
600
582
  z->bra = z->c; /* ], line 152 */
601
- { int ret;
602
- ret = slice_del(z); /* delete, line 152 */
583
+ { int ret = slice_del(z); /* delete, line 152 */
603
584
  if (ret < 0) return ret;
604
585
  }
605
586
  lab9:
606
- z->c = z->l - m;
587
+ z->c = z->l - m9;
607
588
  }
608
589
  return 1;
609
590
  }
610
591
 
611
592
  extern int dutch_UTF_8_stem(struct SN_env * z) {
612
- { int c = z->c; /* do, line 159 */
593
+ { int c1 = z->c; /* do, line 159 */
613
594
  { int ret = r_prelude(z);
614
595
  if (ret == 0) goto lab0; /* call prelude, line 159 */
615
596
  if (ret < 0) return ret;
616
597
  }
617
598
  lab0:
618
- z->c = c;
599
+ z->c = c1;
619
600
  }
620
- { int c = z->c; /* do, line 160 */
601
+ { int c2 = z->c; /* do, line 160 */
621
602
  { int ret = r_mark_regions(z);
622
603
  if (ret == 0) goto lab1; /* call mark_regions, line 160 */
623
604
  if (ret < 0) return ret;
624
605
  }
625
606
  lab1:
626
- z->c = c;
607
+ z->c = c2;
627
608
  }
628
609
  z->lb = z->c; z->c = z->l; /* backwards, line 161 */
629
610
 
630
- { int m = z->l - z->c; (void) m; /* do, line 162 */
611
+ { int m3 = z->l - z->c; (void)m3; /* do, line 162 */
631
612
  { int ret = r_standard_suffix(z);
632
613
  if (ret == 0) goto lab2; /* call standard_suffix, line 162 */
633
614
  if (ret < 0) return ret;
634
615
  }
635
616
  lab2:
636
- z->c = z->l - m;
617
+ z->c = z->l - m3;
637
618
  }
638
619
  z->c = z->lb;
639
- { int c = z->c; /* do, line 163 */
620
+ { int c4 = z->c; /* do, line 163 */
640
621
  { int ret = r_postlude(z);
641
622
  if (ret == 0) goto lab3; /* call postlude, line 163 */
642
623
  if (ret < 0) return ret;
643
624
  }
644
625
  lab3:
645
- z->c = c;
626
+ z->c = c4;
646
627
  }
647
628
  return 1;
648
629
  }
649
630
 
650
631
  extern struct SN_env * dutch_UTF_8_create_env(void) { return SN_create_env(0, 2, 1); }
651
632
 
652
- extern void dutch_UTF_8_close_env(struct SN_env * z) { SN_close_env(z); }
633
+ extern void dutch_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }
653
634