sdsykes-ferret 0.11.6.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. data/CHANGELOG +24 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README +102 -0
  4. data/Rakefile +338 -0
  5. data/TODO +17 -0
  6. data/TUTORIAL +231 -0
  7. data/bin/ferret-browser +79 -0
  8. data/ext/analysis.c +1555 -0
  9. data/ext/analysis.h +219 -0
  10. data/ext/api.c +69 -0
  11. data/ext/api.h +27 -0
  12. data/ext/array.c +123 -0
  13. data/ext/array.h +53 -0
  14. data/ext/bitvector.c +540 -0
  15. data/ext/bitvector.h +272 -0
  16. data/ext/compound_io.c +383 -0
  17. data/ext/config.h +42 -0
  18. data/ext/document.c +156 -0
  19. data/ext/document.h +53 -0
  20. data/ext/except.c +120 -0
  21. data/ext/except.h +168 -0
  22. data/ext/extconf.rb +14 -0
  23. data/ext/ferret.c +402 -0
  24. data/ext/ferret.h +91 -0
  25. data/ext/filter.c +156 -0
  26. data/ext/fs_store.c +483 -0
  27. data/ext/global.c +418 -0
  28. data/ext/global.h +117 -0
  29. data/ext/hash.c +567 -0
  30. data/ext/hash.h +473 -0
  31. data/ext/hashset.c +170 -0
  32. data/ext/hashset.h +187 -0
  33. data/ext/header.h +58 -0
  34. data/ext/helper.c +62 -0
  35. data/ext/helper.h +13 -0
  36. data/ext/inc/lang.h +48 -0
  37. data/ext/inc/threading.h +31 -0
  38. data/ext/index.c +6425 -0
  39. data/ext/index.h +961 -0
  40. data/ext/lang.h +66 -0
  41. data/ext/libstemmer.c +92 -0
  42. data/ext/libstemmer.h +79 -0
  43. data/ext/mempool.c +87 -0
  44. data/ext/mempool.h +35 -0
  45. data/ext/modules.h +162 -0
  46. data/ext/multimapper.c +310 -0
  47. data/ext/multimapper.h +51 -0
  48. data/ext/posh.c +1006 -0
  49. data/ext/posh.h +1007 -0
  50. data/ext/priorityqueue.c +151 -0
  51. data/ext/priorityqueue.h +143 -0
  52. data/ext/q_boolean.c +1608 -0
  53. data/ext/q_const_score.c +161 -0
  54. data/ext/q_filtered_query.c +209 -0
  55. data/ext/q_fuzzy.c +268 -0
  56. data/ext/q_match_all.c +148 -0
  57. data/ext/q_multi_term.c +677 -0
  58. data/ext/q_parser.c +2825 -0
  59. data/ext/q_phrase.c +1126 -0
  60. data/ext/q_prefix.c +100 -0
  61. data/ext/q_range.c +350 -0
  62. data/ext/q_span.c +2402 -0
  63. data/ext/q_term.c +337 -0
  64. data/ext/q_wildcard.c +171 -0
  65. data/ext/r_analysis.c +2575 -0
  66. data/ext/r_index.c +3472 -0
  67. data/ext/r_qparser.c +585 -0
  68. data/ext/r_search.c +4105 -0
  69. data/ext/r_store.c +513 -0
  70. data/ext/r_utils.c +963 -0
  71. data/ext/ram_store.c +471 -0
  72. data/ext/search.c +1741 -0
  73. data/ext/search.h +885 -0
  74. data/ext/similarity.c +150 -0
  75. data/ext/similarity.h +82 -0
  76. data/ext/sort.c +983 -0
  77. data/ext/stem_ISO_8859_1_danish.c +338 -0
  78. data/ext/stem_ISO_8859_1_danish.h +16 -0
  79. data/ext/stem_ISO_8859_1_dutch.c +635 -0
  80. data/ext/stem_ISO_8859_1_dutch.h +16 -0
  81. data/ext/stem_ISO_8859_1_english.c +1156 -0
  82. data/ext/stem_ISO_8859_1_english.h +16 -0
  83. data/ext/stem_ISO_8859_1_finnish.c +792 -0
  84. data/ext/stem_ISO_8859_1_finnish.h +16 -0
  85. data/ext/stem_ISO_8859_1_french.c +1276 -0
  86. data/ext/stem_ISO_8859_1_french.h +16 -0
  87. data/ext/stem_ISO_8859_1_german.c +512 -0
  88. data/ext/stem_ISO_8859_1_german.h +16 -0
  89. data/ext/stem_ISO_8859_1_italian.c +1091 -0
  90. data/ext/stem_ISO_8859_1_italian.h +16 -0
  91. data/ext/stem_ISO_8859_1_norwegian.c +296 -0
  92. data/ext/stem_ISO_8859_1_norwegian.h +16 -0
  93. data/ext/stem_ISO_8859_1_porter.c +776 -0
  94. data/ext/stem_ISO_8859_1_porter.h +16 -0
  95. data/ext/stem_ISO_8859_1_portuguese.c +1035 -0
  96. data/ext/stem_ISO_8859_1_portuguese.h +16 -0
  97. data/ext/stem_ISO_8859_1_spanish.c +1119 -0
  98. data/ext/stem_ISO_8859_1_spanish.h +16 -0
  99. data/ext/stem_ISO_8859_1_swedish.c +307 -0
  100. data/ext/stem_ISO_8859_1_swedish.h +16 -0
  101. data/ext/stem_KOI8_R_russian.c +701 -0
  102. data/ext/stem_KOI8_R_russian.h +16 -0
  103. data/ext/stem_UTF_8_danish.c +344 -0
  104. data/ext/stem_UTF_8_danish.h +16 -0
  105. data/ext/stem_UTF_8_dutch.c +653 -0
  106. data/ext/stem_UTF_8_dutch.h +16 -0
  107. data/ext/stem_UTF_8_english.c +1176 -0
  108. data/ext/stem_UTF_8_english.h +16 -0
  109. data/ext/stem_UTF_8_finnish.c +808 -0
  110. data/ext/stem_UTF_8_finnish.h +16 -0
  111. data/ext/stem_UTF_8_french.c +1296 -0
  112. data/ext/stem_UTF_8_french.h +16 -0
  113. data/ext/stem_UTF_8_german.c +526 -0
  114. data/ext/stem_UTF_8_german.h +16 -0
  115. data/ext/stem_UTF_8_italian.c +1113 -0
  116. data/ext/stem_UTF_8_italian.h +16 -0
  117. data/ext/stem_UTF_8_norwegian.c +302 -0
  118. data/ext/stem_UTF_8_norwegian.h +16 -0
  119. data/ext/stem_UTF_8_porter.c +794 -0
  120. data/ext/stem_UTF_8_porter.h +16 -0
  121. data/ext/stem_UTF_8_portuguese.c +1055 -0
  122. data/ext/stem_UTF_8_portuguese.h +16 -0
  123. data/ext/stem_UTF_8_russian.c +709 -0
  124. data/ext/stem_UTF_8_russian.h +16 -0
  125. data/ext/stem_UTF_8_spanish.c +1137 -0
  126. data/ext/stem_UTF_8_spanish.h +16 -0
  127. data/ext/stem_UTF_8_swedish.c +313 -0
  128. data/ext/stem_UTF_8_swedish.h +16 -0
  129. data/ext/stopwords.c +401 -0
  130. data/ext/store.c +692 -0
  131. data/ext/store.h +777 -0
  132. data/ext/term_vectors.c +352 -0
  133. data/ext/threading.h +31 -0
  134. data/ext/utilities.c +446 -0
  135. data/ext/win32.h +54 -0
  136. data/lib/ferret.rb +29 -0
  137. data/lib/ferret/browser.rb +246 -0
  138. data/lib/ferret/browser/s/global.js +192 -0
  139. data/lib/ferret/browser/s/style.css +148 -0
  140. data/lib/ferret/browser/views/document/list.rhtml +49 -0
  141. data/lib/ferret/browser/views/document/show.rhtml +27 -0
  142. data/lib/ferret/browser/views/error/index.rhtml +7 -0
  143. data/lib/ferret/browser/views/help/index.rhtml +8 -0
  144. data/lib/ferret/browser/views/home/index.rhtml +29 -0
  145. data/lib/ferret/browser/views/layout.rhtml +22 -0
  146. data/lib/ferret/browser/views/term-vector/index.rhtml +4 -0
  147. data/lib/ferret/browser/views/term/index.rhtml +199 -0
  148. data/lib/ferret/browser/views/term/termdocs.rhtml +1 -0
  149. data/lib/ferret/browser/webrick.rb +14 -0
  150. data/lib/ferret/document.rb +130 -0
  151. data/lib/ferret/field_infos.rb +44 -0
  152. data/lib/ferret/index.rb +786 -0
  153. data/lib/ferret/number_tools.rb +157 -0
  154. data/lib/ferret_version.rb +3 -0
  155. data/setup.rb +1555 -0
  156. data/test/test_all.rb +5 -0
  157. data/test/test_helper.rb +24 -0
  158. data/test/threading/number_to_spoken.rb +132 -0
  159. data/test/threading/thread_safety_index_test.rb +79 -0
  160. data/test/threading/thread_safety_read_write_test.rb +76 -0
  161. data/test/threading/thread_safety_test.rb +133 -0
  162. data/test/unit/analysis/tc_analyzer.rb +548 -0
  163. data/test/unit/analysis/tc_token_stream.rb +646 -0
  164. data/test/unit/index/tc_index.rb +762 -0
  165. data/test/unit/index/tc_index_reader.rb +699 -0
  166. data/test/unit/index/tc_index_writer.rb +437 -0
  167. data/test/unit/index/th_doc.rb +315 -0
  168. data/test/unit/largefile/tc_largefile.rb +46 -0
  169. data/test/unit/query_parser/tc_query_parser.rb +238 -0
  170. data/test/unit/search/tc_filter.rb +135 -0
  171. data/test/unit/search/tc_fuzzy_query.rb +147 -0
  172. data/test/unit/search/tc_index_searcher.rb +61 -0
  173. data/test/unit/search/tc_multi_searcher.rb +128 -0
  174. data/test/unit/search/tc_multiple_search_requests.rb +58 -0
  175. data/test/unit/search/tc_search_and_sort.rb +179 -0
  176. data/test/unit/search/tc_sort.rb +49 -0
  177. data/test/unit/search/tc_sort_field.rb +27 -0
  178. data/test/unit/search/tc_spans.rb +190 -0
  179. data/test/unit/search/tm_searcher.rb +384 -0
  180. data/test/unit/store/tc_fs_store.rb +77 -0
  181. data/test/unit/store/tc_ram_store.rb +35 -0
  182. data/test/unit/store/tm_store.rb +34 -0
  183. data/test/unit/store/tm_store_lock.rb +68 -0
  184. data/test/unit/tc_document.rb +81 -0
  185. data/test/unit/ts_analysis.rb +2 -0
  186. data/test/unit/ts_index.rb +2 -0
  187. data/test/unit/ts_largefile.rb +4 -0
  188. data/test/unit/ts_query_parser.rb +2 -0
  189. data/test/unit/ts_search.rb +2 -0
  190. data/test/unit/ts_store.rb +2 -0
  191. data/test/unit/ts_utils.rb +2 -0
  192. data/test/unit/utils/tc_bit_vector.rb +295 -0
  193. data/test/unit/utils/tc_number_tools.rb +117 -0
  194. data/test/unit/utils/tc_priority_queue.rb +106 -0
  195. metadata +285 -0
@@ -0,0 +1,16 @@
1
+
2
+ /* This file was generated automatically by the Snowball to ANSI C compiler */
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ extern struct SN_env * french_UTF_8_create_env(void);
9
+ extern void french_UTF_8_close_env(struct SN_env * z);
10
+
11
+ extern int french_UTF_8_stem(struct SN_env * z);
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif
16
+
@@ -0,0 +1,526 @@
1
+
2
+ /* This file was generated automatically by the Snowball to ANSI C compiler */
3
+
4
+ #include "header.h"
5
+
6
+ extern int german_UTF_8_stem(struct SN_env * z);
7
+ static int r_standard_suffix(struct SN_env * z);
8
+ static int r_R2(struct SN_env * z);
9
+ static int r_R1(struct SN_env * z);
10
+ static int r_mark_regions(struct SN_env * z);
11
+ static int r_postlude(struct SN_env * z);
12
+ static int r_prelude(struct SN_env * z);
13
+
14
+ extern struct SN_env * german_UTF_8_create_env(void);
15
+ extern void german_UTF_8_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[2] = { 0xC3, 0xA4 };
20
+ static symbol s_0_4[2] = { 0xC3, 0xB6 };
21
+ static symbol s_0_5[2] = { 0xC3, 0xBC };
22
+
23
+ static struct among a_0[6] =
24
+ {
25
+ /* 0 */ { 0, 0, -1, 6, 0},
26
+ /* 1 */ { 1, s_0_1, 0, 2, 0},
27
+ /* 2 */ { 1, s_0_2, 0, 1, 0},
28
+ /* 3 */ { 2, s_0_3, 0, 3, 0},
29
+ /* 4 */ { 2, s_0_4, 0, 4, 0},
30
+ /* 5 */ { 2, s_0_5, 0, 5, 0}
31
+ };
32
+
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] =
42
+ {
43
+ /* 0 */ { 1, s_1_0, -1, 1, 0},
44
+ /* 1 */ { 2, s_1_1, -1, 1, 0},
45
+ /* 2 */ { 2, s_1_2, -1, 1, 0},
46
+ /* 3 */ { 3, s_1_3, -1, 1, 0},
47
+ /* 4 */ { 2, s_1_4, -1, 1, 0},
48
+ /* 5 */ { 1, s_1_5, -1, 2, 0},
49
+ /* 6 */ { 2, s_1_6, 5, 1, 0}
50
+ };
51
+
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] =
58
+ {
59
+ /* 0 */ { 2, s_2_0, -1, 1, 0},
60
+ /* 1 */ { 2, s_2_1, -1, 1, 0},
61
+ /* 2 */ { 2, s_2_2, -1, 2, 0},
62
+ /* 3 */ { 3, s_2_3, 2, 1, 0}
63
+ };
64
+
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] =
69
+ {
70
+ /* 0 */ { 2, s_3_0, -1, 1, 0},
71
+ /* 1 */ { 4, s_3_1, -1, 1, 0}
72
+ };
73
+
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] =
84
+ {
85
+ /* 0 */ { 3, s_4_0, -1, 1, 0},
86
+ /* 1 */ { 2, s_4_1, -1, 2, 0},
87
+ /* 2 */ { 3, s_4_2, -1, 1, 0},
88
+ /* 3 */ { 4, s_4_3, -1, 3, 0},
89
+ /* 4 */ { 4, s_4_4, -1, 2, 0},
90
+ /* 5 */ { 2, s_4_5, -1, 2, 0},
91
+ /* 6 */ { 4, s_4_6, -1, 3, 0},
92
+ /* 7 */ { 4, s_4_7, -1, 4, 0}
93
+ };
94
+
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[] = { 0xC3, 0x9F };
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' };
117
+
118
+ static int r_prelude(struct SN_env * z) {
119
+ { int c_test = z->c; /* test, line 30 */
120
+ while(1) { /* repeat, line 30 */
121
+ int c = z->c;
122
+ { int c = z->c; /* or, line 33 */
123
+ z->bra = z->c; /* [, line 32 */
124
+ if (!(eq_s(z, 2, s_0))) goto lab2;
125
+ z->ket = z->c; /* ], line 32 */
126
+ { int ret;
127
+ ret = slice_from_s(z, 2, s_1); /* <-, line 32 */
128
+ if (ret < 0) return ret;
129
+ }
130
+ goto lab1;
131
+ lab2:
132
+ z->c = c;
133
+ { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
134
+ if (c < 0) goto lab0;
135
+ z->c = c; /* next, line 33 */
136
+ }
137
+ }
138
+ lab1:
139
+ continue;
140
+ lab0:
141
+ z->c = c;
142
+ break;
143
+ }
144
+ z->c = c_test;
145
+ }
146
+ while(1) { /* repeat, line 36 */
147
+ int c = z->c;
148
+ while(1) { /* goto, line 36 */
149
+ int c = z->c;
150
+ if (!(in_grouping_U(z, g_v, 97, 252))) goto lab4;
151
+ z->bra = z->c; /* [, line 37 */
152
+ { int c = z->c; /* or, line 37 */
153
+ if (!(eq_s(z, 1, s_2))) goto lab6;
154
+ z->ket = z->c; /* ], line 37 */
155
+ if (!(in_grouping_U(z, g_v, 97, 252))) goto lab6;
156
+ { int ret;
157
+ ret = slice_from_s(z, 1, s_3); /* <-, line 37 */
158
+ if (ret < 0) return ret;
159
+ }
160
+ goto lab5;
161
+ lab6:
162
+ z->c = c;
163
+ if (!(eq_s(z, 1, s_4))) goto lab4;
164
+ z->ket = z->c; /* ], line 38 */
165
+ if (!(in_grouping_U(z, g_v, 97, 252))) goto lab4;
166
+ { int ret;
167
+ ret = slice_from_s(z, 1, s_5); /* <-, line 38 */
168
+ if (ret < 0) return ret;
169
+ }
170
+ }
171
+ lab5:
172
+ z->c = c;
173
+ break;
174
+ lab4:
175
+ z->c = c;
176
+ { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
177
+ if (c < 0) goto lab3;
178
+ z->c = c; /* goto, line 36 */
179
+ }
180
+ }
181
+ continue;
182
+ lab3:
183
+ z->c = c;
184
+ break;
185
+ }
186
+ return 1;
187
+ }
188
+
189
+ static int r_mark_regions(struct SN_env * z) {
190
+ z->I[0] = z->l;
191
+ z->I[1] = z->l;
192
+ { int c_test = z->c; /* test, line 47 */
193
+ { int c = skip_utf8(z->p, z->c, 0, z->l, + 3);
194
+ if (c < 0) return 0;
195
+ z->c = c; /* hop, line 47 */
196
+ }
197
+ z->I[2] = z->c; /* setmark x, line 47 */
198
+ z->c = c_test;
199
+ }
200
+ while(1) { /* gopast, line 49 */
201
+ if (!(in_grouping_U(z, g_v, 97, 252))) goto lab0;
202
+ break;
203
+ lab0:
204
+ { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
205
+ if (c < 0) return 0;
206
+ z->c = c; /* gopast, line 49 */
207
+ }
208
+ }
209
+ while(1) { /* gopast, line 49 */
210
+ if (!(out_grouping_U(z, g_v, 97, 252))) goto lab1;
211
+ break;
212
+ lab1:
213
+ { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
214
+ if (c < 0) return 0;
215
+ z->c = c; /* gopast, line 49 */
216
+ }
217
+ }
218
+ z->I[0] = z->c; /* setmark p1, line 49 */
219
+ /* try, line 50 */
220
+ if (!(z->I[0] < z->I[2])) goto lab2;
221
+ z->I[0] = z->I[2];
222
+ lab2:
223
+ while(1) { /* gopast, line 51 */
224
+ if (!(in_grouping_U(z, g_v, 97, 252))) goto lab3;
225
+ break;
226
+ lab3:
227
+ { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
228
+ if (c < 0) return 0;
229
+ z->c = c; /* gopast, line 51 */
230
+ }
231
+ }
232
+ while(1) { /* gopast, line 51 */
233
+ if (!(out_grouping_U(z, g_v, 97, 252))) goto lab4;
234
+ break;
235
+ lab4:
236
+ { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
237
+ if (c < 0) return 0;
238
+ z->c = c; /* gopast, line 51 */
239
+ }
240
+ }
241
+ z->I[1] = z->c; /* setmark p2, line 51 */
242
+ return 1;
243
+ }
244
+
245
+ static int r_postlude(struct SN_env * z) {
246
+ int among_var;
247
+ while(1) { /* repeat, line 55 */
248
+ int c = z->c;
249
+ z->bra = z->c; /* [, line 57 */
250
+ among_var = find_among(z, a_0, 6); /* substring, line 57 */
251
+ if (!(among_var)) goto lab0;
252
+ z->ket = z->c; /* ], line 57 */
253
+ switch(among_var) {
254
+ case 0: goto lab0;
255
+ case 1:
256
+ { int ret;
257
+ ret = slice_from_s(z, 1, s_6); /* <-, line 58 */
258
+ if (ret < 0) return ret;
259
+ }
260
+ break;
261
+ case 2:
262
+ { int ret;
263
+ ret = slice_from_s(z, 1, s_7); /* <-, line 59 */
264
+ if (ret < 0) return ret;
265
+ }
266
+ break;
267
+ case 3:
268
+ { int ret;
269
+ ret = slice_from_s(z, 1, s_8); /* <-, line 60 */
270
+ if (ret < 0) return ret;
271
+ }
272
+ break;
273
+ case 4:
274
+ { int ret;
275
+ ret = slice_from_s(z, 1, s_9); /* <-, line 61 */
276
+ if (ret < 0) return ret;
277
+ }
278
+ break;
279
+ case 5:
280
+ { int ret;
281
+ ret = slice_from_s(z, 1, s_10); /* <-, line 62 */
282
+ if (ret < 0) return ret;
283
+ }
284
+ break;
285
+ case 6:
286
+ { int c = skip_utf8(z->p, z->c, 0, z->l, 1);
287
+ if (c < 0) goto lab0;
288
+ z->c = c; /* next, line 63 */
289
+ }
290
+ break;
291
+ }
292
+ continue;
293
+ lab0:
294
+ z->c = c;
295
+ break;
296
+ }
297
+ return 1;
298
+ }
299
+
300
+ static int r_R1(struct SN_env * z) {
301
+ if (!(z->I[0] <= z->c)) return 0;
302
+ return 1;
303
+ }
304
+
305
+ static int r_R2(struct SN_env * z) {
306
+ if (!(z->I[1] <= z->c)) return 0;
307
+ return 1;
308
+ }
309
+
310
+ static int r_standard_suffix(struct SN_env * z) {
311
+ int among_var;
312
+ { int m = z->l - z->c; (void) m; /* do, line 74 */
313
+ z->ket = z->c; /* [, line 75 */
314
+ among_var = find_among_b(z, a_1, 7); /* substring, line 75 */
315
+ if (!(among_var)) goto lab0;
316
+ z->bra = z->c; /* ], line 75 */
317
+ { int ret = r_R1(z);
318
+ if (ret == 0) goto lab0; /* call R1, line 75 */
319
+ if (ret < 0) return ret;
320
+ }
321
+ switch(among_var) {
322
+ case 0: goto lab0;
323
+ case 1:
324
+ { int ret;
325
+ ret = slice_del(z); /* delete, line 77 */
326
+ if (ret < 0) return ret;
327
+ }
328
+ break;
329
+ case 2:
330
+ if (!(in_grouping_b_U(z, g_s_ending, 98, 116))) goto lab0;
331
+ { int ret;
332
+ ret = slice_del(z); /* delete, line 80 */
333
+ if (ret < 0) return ret;
334
+ }
335
+ break;
336
+ }
337
+ lab0:
338
+ z->c = z->l - m;
339
+ }
340
+ { int m = z->l - z->c; (void) m; /* do, line 84 */
341
+ z->ket = z->c; /* [, line 85 */
342
+ among_var = find_among_b(z, a_2, 4); /* substring, line 85 */
343
+ if (!(among_var)) goto lab1;
344
+ z->bra = z->c; /* ], line 85 */
345
+ { int ret = r_R1(z);
346
+ if (ret == 0) goto lab1; /* call R1, line 85 */
347
+ if (ret < 0) return ret;
348
+ }
349
+ switch(among_var) {
350
+ case 0: goto lab1;
351
+ case 1:
352
+ { int ret;
353
+ ret = slice_del(z); /* delete, line 87 */
354
+ if (ret < 0) return ret;
355
+ }
356
+ break;
357
+ case 2:
358
+ if (!(in_grouping_b_U(z, g_st_ending, 98, 116))) goto lab1;
359
+ { int c = skip_utf8(z->p, z->c, z->lb, z->l, - 3);
360
+ if (c < 0) goto lab1;
361
+ z->c = c; /* hop, line 90 */
362
+ }
363
+ { int ret;
364
+ ret = slice_del(z); /* delete, line 90 */
365
+ if (ret < 0) return ret;
366
+ }
367
+ break;
368
+ }
369
+ lab1:
370
+ z->c = z->l - m;
371
+ }
372
+ { int m = z->l - z->c; (void) m; /* do, line 94 */
373
+ z->ket = z->c; /* [, line 95 */
374
+ among_var = find_among_b(z, a_4, 8); /* substring, line 95 */
375
+ if (!(among_var)) goto lab2;
376
+ z->bra = z->c; /* ], line 95 */
377
+ { int ret = r_R2(z);
378
+ if (ret == 0) goto lab2; /* call R2, line 95 */
379
+ if (ret < 0) return ret;
380
+ }
381
+ switch(among_var) {
382
+ case 0: goto lab2;
383
+ case 1:
384
+ { int ret;
385
+ ret = slice_del(z); /* delete, line 97 */
386
+ if (ret < 0) return ret;
387
+ }
388
+ { int m = z->l - z->c; (void) m; /* try, line 98 */
389
+ z->ket = z->c; /* [, line 98 */
390
+ if (!(eq_s_b(z, 2, s_11))) { z->c = z->l - m; goto lab3; }
391
+ z->bra = z->c; /* ], line 98 */
392
+ { int m = z->l - z->c; (void) m; /* not, line 98 */
393
+ if (!(eq_s_b(z, 1, s_12))) goto lab4;
394
+ { z->c = z->l - m; goto lab3; }
395
+ lab4:
396
+ z->c = z->l - m;
397
+ }
398
+ { int ret = r_R2(z);
399
+ if (ret == 0) { z->c = z->l - m; goto lab3; } /* call R2, line 98 */
400
+ if (ret < 0) return ret;
401
+ }
402
+ { int ret;
403
+ ret = slice_del(z); /* delete, line 98 */
404
+ if (ret < 0) return ret;
405
+ }
406
+ lab3:
407
+ ;
408
+ }
409
+ break;
410
+ case 2:
411
+ { int m = z->l - z->c; (void) m; /* not, line 101 */
412
+ if (!(eq_s_b(z, 1, s_13))) goto lab5;
413
+ goto lab2;
414
+ lab5:
415
+ z->c = z->l - m;
416
+ }
417
+ { int ret;
418
+ ret = slice_del(z); /* delete, line 101 */
419
+ if (ret < 0) return ret;
420
+ }
421
+ break;
422
+ case 3:
423
+ { int ret;
424
+ ret = slice_del(z); /* delete, line 104 */
425
+ if (ret < 0) return ret;
426
+ }
427
+ { int m = z->l - z->c; (void) m; /* try, line 105 */
428
+ z->ket = z->c; /* [, line 106 */
429
+ { int m = z->l - z->c; (void) m; /* or, line 106 */
430
+ if (!(eq_s_b(z, 2, s_14))) goto lab8;
431
+ goto lab7;
432
+ lab8:
433
+ z->c = z->l - m;
434
+ if (!(eq_s_b(z, 2, s_15))) { z->c = z->l - m; goto lab6; }
435
+ }
436
+ lab7:
437
+ z->bra = z->c; /* ], line 106 */
438
+ { int ret = r_R1(z);
439
+ if (ret == 0) { z->c = z->l - m; goto lab6; } /* call R1, line 106 */
440
+ if (ret < 0) return ret;
441
+ }
442
+ { int ret;
443
+ ret = slice_del(z); /* delete, line 106 */
444
+ if (ret < 0) return ret;
445
+ }
446
+ lab6:
447
+ ;
448
+ }
449
+ break;
450
+ case 4:
451
+ { int ret;
452
+ ret = slice_del(z); /* delete, line 110 */
453
+ if (ret < 0) return ret;
454
+ }
455
+ { int m = z->l - z->c; (void) m; /* try, line 111 */
456
+ z->ket = z->c; /* [, line 112 */
457
+ among_var = find_among_b(z, a_3, 2); /* substring, line 112 */
458
+ if (!(among_var)) { z->c = z->l - m; goto lab9; }
459
+ z->bra = z->c; /* ], line 112 */
460
+ { int ret = r_R2(z);
461
+ if (ret == 0) { z->c = z->l - m; goto lab9; } /* call R2, line 112 */
462
+ if (ret < 0) return ret;
463
+ }
464
+ switch(among_var) {
465
+ case 0: { z->c = z->l - m; goto lab9; }
466
+ case 1:
467
+ { int ret;
468
+ ret = slice_del(z); /* delete, line 114 */
469
+ if (ret < 0) return ret;
470
+ }
471
+ break;
472
+ }
473
+ lab9:
474
+ ;
475
+ }
476
+ break;
477
+ }
478
+ lab2:
479
+ z->c = z->l - m;
480
+ }
481
+ return 1;
482
+ }
483
+
484
+ extern int german_UTF_8_stem(struct SN_env * z) {
485
+ { int c = z->c; /* do, line 125 */
486
+ { int ret = r_prelude(z);
487
+ if (ret == 0) goto lab0; /* call prelude, line 125 */
488
+ if (ret < 0) return ret;
489
+ }
490
+ lab0:
491
+ z->c = c;
492
+ }
493
+ { int c = z->c; /* do, line 126 */
494
+ { int ret = r_mark_regions(z);
495
+ if (ret == 0) goto lab1; /* call mark_regions, line 126 */
496
+ if (ret < 0) return ret;
497
+ }
498
+ lab1:
499
+ z->c = c;
500
+ }
501
+ z->lb = z->c; z->c = z->l; /* backwards, line 127 */
502
+
503
+ { int m = z->l - z->c; (void) m; /* do, line 128 */
504
+ { int ret = r_standard_suffix(z);
505
+ if (ret == 0) goto lab2; /* call standard_suffix, line 128 */
506
+ if (ret < 0) return ret;
507
+ }
508
+ lab2:
509
+ z->c = z->l - m;
510
+ }
511
+ z->c = z->lb;
512
+ { int c = z->c; /* do, line 129 */
513
+ { int ret = r_postlude(z);
514
+ if (ret == 0) goto lab3; /* call postlude, line 129 */
515
+ if (ret < 0) return ret;
516
+ }
517
+ lab3:
518
+ z->c = c;
519
+ }
520
+ return 1;
521
+ }
522
+
523
+ extern struct SN_env * german_UTF_8_create_env(void) { return SN_create_env(0, 3, 0); }
524
+
525
+ extern void german_UTF_8_close_env(struct SN_env * z) { SN_close_env(z); }
526
+