ferret 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. data/Rakefile +23 -5
  2. data/TODO +2 -1
  3. data/ext/analysis.c +838 -177
  4. data/ext/analysis.h +55 -7
  5. data/ext/api.c +69 -0
  6. data/ext/api.h +27 -0
  7. data/ext/array.c +8 -5
  8. data/ext/compound_io.c +132 -96
  9. data/ext/document.c +58 -28
  10. data/ext/except.c +59 -0
  11. data/ext/except.h +88 -0
  12. data/ext/ferret.c +47 -3
  13. data/ext/ferret.h +3 -0
  14. data/ext/field.c +15 -9
  15. data/ext/filter.c +1 -1
  16. data/ext/fs_store.c +215 -34
  17. data/ext/global.c +72 -3
  18. data/ext/global.h +4 -3
  19. data/ext/hash.c +44 -3
  20. data/ext/hash.h +9 -0
  21. data/ext/header.h +58 -0
  22. data/ext/inc/except.h +88 -0
  23. data/ext/inc/lang.h +23 -13
  24. data/ext/ind.c +16 -10
  25. data/ext/index.h +2 -22
  26. data/ext/index_io.c +3 -11
  27. data/ext/index_rw.c +245 -193
  28. data/ext/lang.h +23 -13
  29. data/ext/libstemmer.c +92 -0
  30. data/ext/libstemmer.h +79 -0
  31. data/ext/modules.h +162 -0
  32. data/ext/q_boolean.c +34 -21
  33. data/ext/q_const_score.c +6 -12
  34. data/ext/q_filtered_query.c +206 -0
  35. data/ext/q_fuzzy.c +18 -15
  36. data/ext/q_match_all.c +3 -7
  37. data/ext/q_multi_phrase.c +10 -14
  38. data/ext/q_parser.c +29 -2
  39. data/ext/q_phrase.c +14 -21
  40. data/ext/q_prefix.c +15 -12
  41. data/ext/q_range.c +30 -28
  42. data/ext/q_span.c +13 -21
  43. data/ext/q_term.c +17 -26
  44. data/ext/r_analysis.c +693 -21
  45. data/ext/r_doc.c +11 -12
  46. data/ext/r_index_io.c +4 -1
  47. data/ext/r_qparser.c +21 -2
  48. data/ext/r_search.c +285 -18
  49. data/ext/ram_store.c +5 -2
  50. data/ext/search.c +11 -17
  51. data/ext/search.h +21 -45
  52. data/ext/similarity.h +67 -0
  53. data/ext/sort.c +30 -25
  54. data/ext/stem_ISO_8859_1_danish.c +338 -0
  55. data/ext/stem_ISO_8859_1_danish.h +16 -0
  56. data/ext/stem_ISO_8859_1_dutch.c +635 -0
  57. data/ext/stem_ISO_8859_1_dutch.h +16 -0
  58. data/ext/stem_ISO_8859_1_english.c +1156 -0
  59. data/ext/stem_ISO_8859_1_english.h +16 -0
  60. data/ext/stem_ISO_8859_1_finnish.c +792 -0
  61. data/ext/stem_ISO_8859_1_finnish.h +16 -0
  62. data/ext/stem_ISO_8859_1_french.c +1276 -0
  63. data/ext/stem_ISO_8859_1_french.h +16 -0
  64. data/ext/stem_ISO_8859_1_german.c +512 -0
  65. data/ext/stem_ISO_8859_1_german.h +16 -0
  66. data/ext/stem_ISO_8859_1_italian.c +1091 -0
  67. data/ext/stem_ISO_8859_1_italian.h +16 -0
  68. data/ext/stem_ISO_8859_1_norwegian.c +296 -0
  69. data/ext/stem_ISO_8859_1_norwegian.h +16 -0
  70. data/ext/stem_ISO_8859_1_porter.c +776 -0
  71. data/ext/stem_ISO_8859_1_porter.h +16 -0
  72. data/ext/stem_ISO_8859_1_portuguese.c +1035 -0
  73. data/ext/stem_ISO_8859_1_portuguese.h +16 -0
  74. data/ext/stem_ISO_8859_1_spanish.c +1119 -0
  75. data/ext/stem_ISO_8859_1_spanish.h +16 -0
  76. data/ext/stem_ISO_8859_1_swedish.c +307 -0
  77. data/ext/stem_ISO_8859_1_swedish.h +16 -0
  78. data/ext/stem_KOI8_R_russian.c +701 -0
  79. data/ext/stem_KOI8_R_russian.h +16 -0
  80. data/ext/stem_UTF_8_danish.c +344 -0
  81. data/ext/stem_UTF_8_danish.h +16 -0
  82. data/ext/stem_UTF_8_dutch.c +653 -0
  83. data/ext/stem_UTF_8_dutch.h +16 -0
  84. data/ext/stem_UTF_8_english.c +1176 -0
  85. data/ext/stem_UTF_8_english.h +16 -0
  86. data/ext/stem_UTF_8_finnish.c +808 -0
  87. data/ext/stem_UTF_8_finnish.h +16 -0
  88. data/ext/stem_UTF_8_french.c +1296 -0
  89. data/ext/stem_UTF_8_french.h +16 -0
  90. data/ext/stem_UTF_8_german.c +526 -0
  91. data/ext/stem_UTF_8_german.h +16 -0
  92. data/ext/stem_UTF_8_italian.c +1113 -0
  93. data/ext/stem_UTF_8_italian.h +16 -0
  94. data/ext/stem_UTF_8_norwegian.c +302 -0
  95. data/ext/stem_UTF_8_norwegian.h +16 -0
  96. data/ext/stem_UTF_8_porter.c +794 -0
  97. data/ext/stem_UTF_8_porter.h +16 -0
  98. data/ext/stem_UTF_8_portuguese.c +1055 -0
  99. data/ext/stem_UTF_8_portuguese.h +16 -0
  100. data/ext/stem_UTF_8_russian.c +709 -0
  101. data/ext/stem_UTF_8_russian.h +16 -0
  102. data/ext/stem_UTF_8_spanish.c +1137 -0
  103. data/ext/stem_UTF_8_spanish.h +16 -0
  104. data/ext/stem_UTF_8_swedish.c +313 -0
  105. data/ext/stem_UTF_8_swedish.h +16 -0
  106. data/ext/stopwords.c +325 -0
  107. data/ext/store.c +34 -2
  108. data/ext/tags +2953 -0
  109. data/ext/term.c +21 -15
  110. data/ext/termdocs.c +5 -3
  111. data/ext/utilities.c +446 -0
  112. data/ext/vector.c +27 -13
  113. data/lib/ferret/document/document.rb +1 -1
  114. data/lib/ferret/index/index.rb +44 -6
  115. data/lib/ferret/query_parser/query_parser.tab.rb +7 -3
  116. data/lib/rferret.rb +2 -1
  117. data/test/test_helper.rb +2 -2
  118. data/test/unit/analysis/ctc_analyzer.rb +401 -0
  119. data/test/unit/analysis/ctc_tokenstream.rb +423 -0
  120. data/test/unit/analysis/{tc_letter_tokenizer.rb → rtc_letter_tokenizer.rb} +0 -0
  121. data/test/unit/analysis/{tc_lower_case_filter.rb → rtc_lower_case_filter.rb} +0 -0
  122. data/test/unit/analysis/{tc_lower_case_tokenizer.rb → rtc_lower_case_tokenizer.rb} +0 -0
  123. data/test/unit/analysis/{tc_per_field_analyzer_wrapper.rb → rtc_per_field_analyzer_wrapper.rb} +0 -0
  124. data/test/unit/analysis/{tc_porter_stem_filter.rb → rtc_porter_stem_filter.rb} +0 -0
  125. data/test/unit/analysis/{tc_standard_analyzer.rb → rtc_standard_analyzer.rb} +0 -0
  126. data/test/unit/analysis/{tc_standard_tokenizer.rb → rtc_standard_tokenizer.rb} +0 -0
  127. data/test/unit/analysis/{tc_stop_analyzer.rb → rtc_stop_analyzer.rb} +0 -0
  128. data/test/unit/analysis/{tc_stop_filter.rb → rtc_stop_filter.rb} +0 -0
  129. data/test/unit/analysis/{tc_white_space_analyzer.rb → rtc_white_space_analyzer.rb} +0 -0
  130. data/test/unit/analysis/{tc_white_space_tokenizer.rb → rtc_white_space_tokenizer.rb} +0 -0
  131. data/test/unit/analysis/{tc_word_list_loader.rb → rtc_word_list_loader.rb} +0 -0
  132. data/test/unit/analysis/tc_analyzer.rb +1 -2
  133. data/test/unit/analysis/{c_token.rb → tc_token.rb} +0 -0
  134. data/test/unit/document/rtc_field.rb +28 -0
  135. data/test/unit/document/{c_document.rb → tc_document.rb} +0 -0
  136. data/test/unit/document/tc_field.rb +82 -12
  137. data/test/unit/index/{tc_compound_file_io.rb → rtc_compound_file_io.rb} +0 -0
  138. data/test/unit/index/{tc_field_infos.rb → rtc_field_infos.rb} +0 -0
  139. data/test/unit/index/{tc_fields_io.rb → rtc_fields_io.rb} +0 -0
  140. data/test/unit/index/{tc_multiple_term_doc_pos_enum.rb → rtc_multiple_term_doc_pos_enum.rb} +0 -0
  141. data/test/unit/index/{tc_segment_infos.rb → rtc_segment_infos.rb} +0 -0
  142. data/test/unit/index/{tc_segment_term_docs.rb → rtc_segment_term_docs.rb} +0 -0
  143. data/test/unit/index/{tc_segment_term_enum.rb → rtc_segment_term_enum.rb} +0 -0
  144. data/test/unit/index/{tc_segment_term_vector.rb → rtc_segment_term_vector.rb} +0 -0
  145. data/test/unit/index/{tc_term_buffer.rb → rtc_term_buffer.rb} +0 -0
  146. data/test/unit/index/{tc_term_info.rb → rtc_term_info.rb} +0 -0
  147. data/test/unit/index/{tc_term_infos_io.rb → rtc_term_infos_io.rb} +0 -0
  148. data/test/unit/index/{tc_term_vectors_io.rb → rtc_term_vectors_io.rb} +0 -0
  149. data/test/unit/index/{c_index.rb → tc_index.rb} +26 -6
  150. data/test/unit/index/{c_index_reader.rb → tc_index_reader.rb} +0 -0
  151. data/test/unit/index/{c_index_writer.rb → tc_index_writer.rb} +0 -0
  152. data/test/unit/index/{c_term.rb → tc_term.rb} +0 -0
  153. data/test/unit/index/{c_term_voi.rb → tc_term_voi.rb} +0 -0
  154. data/test/unit/query_parser/{c_query_parser.rb → rtc_query_parser.rb} +14 -14
  155. data/test/unit/query_parser/tc_query_parser.rb +24 -16
  156. data/test/unit/search/{tc_similarity.rb → rtc_similarity.rb} +0 -0
  157. data/test/unit/search/rtc_sort_field.rb +14 -0
  158. data/test/unit/search/{c_filter.rb → tc_filter.rb} +11 -11
  159. data/test/unit/search/{c_fuzzy_query.rb → tc_fuzzy_query.rb} +0 -0
  160. data/test/unit/search/{c_index_searcher.rb → tc_index_searcher.rb} +0 -0
  161. data/test/unit/search/{c_search_and_sort.rb → tc_search_and_sort.rb} +0 -0
  162. data/test/unit/search/{c_sort.rb → tc_sort.rb} +0 -0
  163. data/test/unit/search/tc_sort_field.rb +20 -7
  164. data/test/unit/search/{c_spans.rb → tc_spans.rb} +0 -0
  165. data/test/unit/store/rtc_fs_store.rb +62 -0
  166. data/test/unit/store/rtc_ram_store.rb +15 -0
  167. data/test/unit/store/rtm_store.rb +150 -0
  168. data/test/unit/store/rtm_store_lock.rb +2 -0
  169. data/test/unit/store/tc_fs_store.rb +54 -40
  170. data/test/unit/store/tc_ram_store.rb +20 -0
  171. data/test/unit/store/tm_store.rb +30 -146
  172. data/test/unit/store/tm_store_lock.rb +66 -0
  173. data/test/unit/utils/{tc_bit_vector.rb → rtc_bit_vector.rb} +0 -0
  174. data/test/unit/utils/{tc_date_tools.rb → rtc_date_tools.rb} +0 -0
  175. data/test/unit/utils/{tc_number_tools.rb → rtc_number_tools.rb} +0 -0
  176. data/test/unit/utils/{tc_parameter.rb → rtc_parameter.rb} +0 -0
  177. data/test/unit/utils/{tc_priority_queue.rb → rtc_priority_queue.rb} +0 -0
  178. data/test/unit/utils/{tc_string_helper.rb → rtc_string_helper.rb} +0 -0
  179. data/test/unit/utils/{tc_thread.rb → rtc_thread.rb} +0 -0
  180. data/test/unit/utils/{tc_weak_key_hash.rb → rtc_weak_key_hash.rb} +0 -0
  181. metadata +360 -289
  182. data/test/unit/document/c_field.rb +0 -98
  183. data/test/unit/search/c_sort_field.rb +0 -27
  184. data/test/unit/store/c_fs_store.rb +0 -76
  185. data/test/unit/store/c_ram_store.rb +0 -35
  186. data/test/unit/store/m_store.rb +0 -34
  187. data/test/unit/store/m_store_lock.rb +0 -68
@@ -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
+