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_ISO_8859_1_create_env(void);
9
+ extern void french_ISO_8859_1_close_env(struct SN_env * z);
10
+
11
+ extern int french_ISO_8859_1_stem(struct SN_env * z);
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif
16
+
@@ -0,0 +1,512 @@
1
+
2
+ /* This file was generated automatically by the Snowball to ANSI C compiler */
3
+
4
+ #include "header.h"
5
+
6
+ extern int german_ISO_8859_1_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_ISO_8859_1_create_env(void);
15
+ extern void german_ISO_8859_1_close_env(struct SN_env * z);
16
+
17
+ static symbol s_0_1[1] = { 'U' };
18
+ static symbol s_0_2[1] = { 'Y' };
19
+ static symbol s_0_3[1] = { 0xE4 };
20
+ static symbol s_0_4[1] = { 0xF6 };
21
+ static symbol s_0_5[1] = { 0xFC };
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 */ { 1, s_0_3, 0, 3, 0},
29
+ /* 4 */ { 1, s_0_4, 0, 4, 0},
30
+ /* 5 */ { 1, 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[] = { 0xDF };
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, 1, 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
+ if (z->c >= z->l) goto lab0;
134
+ z->c++; /* next, line 33 */
135
+ }
136
+ lab1:
137
+ continue;
138
+ lab0:
139
+ z->c = c;
140
+ break;
141
+ }
142
+ z->c = c_test;
143
+ }
144
+ while(1) { /* repeat, line 36 */
145
+ int c = z->c;
146
+ while(1) { /* goto, line 36 */
147
+ int c = z->c;
148
+ if (!(in_grouping(z, g_v, 97, 252))) goto lab4;
149
+ z->bra = z->c; /* [, line 37 */
150
+ { int c = z->c; /* or, line 37 */
151
+ if (!(eq_s(z, 1, s_2))) goto lab6;
152
+ z->ket = z->c; /* ], line 37 */
153
+ if (!(in_grouping(z, g_v, 97, 252))) goto lab6;
154
+ { int ret;
155
+ ret = slice_from_s(z, 1, s_3); /* <-, line 37 */
156
+ if (ret < 0) return ret;
157
+ }
158
+ goto lab5;
159
+ lab6:
160
+ z->c = c;
161
+ if (!(eq_s(z, 1, s_4))) goto lab4;
162
+ z->ket = z->c; /* ], line 38 */
163
+ if (!(in_grouping(z, g_v, 97, 252))) goto lab4;
164
+ { int ret;
165
+ ret = slice_from_s(z, 1, s_5); /* <-, line 38 */
166
+ if (ret < 0) return ret;
167
+ }
168
+ }
169
+ lab5:
170
+ z->c = c;
171
+ break;
172
+ lab4:
173
+ z->c = c;
174
+ if (z->c >= z->l) goto lab3;
175
+ z->c++; /* goto, line 36 */
176
+ }
177
+ continue;
178
+ lab3:
179
+ z->c = c;
180
+ break;
181
+ }
182
+ return 1;
183
+ }
184
+
185
+ static int r_mark_regions(struct SN_env * z) {
186
+ z->I[0] = z->l;
187
+ z->I[1] = z->l;
188
+ { int c_test = z->c; /* test, line 47 */
189
+ { int c = z->c + 3;
190
+ if (0 > c || c > z->l) return 0;
191
+ z->c = c; /* hop, line 47 */
192
+ }
193
+ z->I[2] = z->c; /* setmark x, line 47 */
194
+ z->c = c_test;
195
+ }
196
+ while(1) { /* gopast, line 49 */
197
+ if (!(in_grouping(z, g_v, 97, 252))) goto lab0;
198
+ break;
199
+ lab0:
200
+ if (z->c >= z->l) return 0;
201
+ z->c++; /* gopast, line 49 */
202
+ }
203
+ while(1) { /* gopast, line 49 */
204
+ if (!(out_grouping(z, g_v, 97, 252))) goto lab1;
205
+ break;
206
+ lab1:
207
+ if (z->c >= z->l) return 0;
208
+ z->c++; /* gopast, line 49 */
209
+ }
210
+ z->I[0] = z->c; /* setmark p1, line 49 */
211
+ /* try, line 50 */
212
+ if (!(z->I[0] < z->I[2])) goto lab2;
213
+ z->I[0] = z->I[2];
214
+ lab2:
215
+ while(1) { /* gopast, line 51 */
216
+ if (!(in_grouping(z, g_v, 97, 252))) goto lab3;
217
+ break;
218
+ lab3:
219
+ if (z->c >= z->l) return 0;
220
+ z->c++; /* gopast, line 51 */
221
+ }
222
+ while(1) { /* gopast, line 51 */
223
+ if (!(out_grouping(z, g_v, 97, 252))) goto lab4;
224
+ break;
225
+ lab4:
226
+ if (z->c >= z->l) return 0;
227
+ z->c++; /* gopast, line 51 */
228
+ }
229
+ z->I[1] = z->c; /* setmark p2, line 51 */
230
+ return 1;
231
+ }
232
+
233
+ static int r_postlude(struct SN_env * z) {
234
+ int among_var;
235
+ while(1) { /* repeat, line 55 */
236
+ int c = z->c;
237
+ z->bra = z->c; /* [, line 57 */
238
+ among_var = find_among(z, a_0, 6); /* substring, line 57 */
239
+ if (!(among_var)) goto lab0;
240
+ z->ket = z->c; /* ], line 57 */
241
+ switch(among_var) {
242
+ case 0: goto lab0;
243
+ case 1:
244
+ { int ret;
245
+ ret = slice_from_s(z, 1, s_6); /* <-, line 58 */
246
+ if (ret < 0) return ret;
247
+ }
248
+ break;
249
+ case 2:
250
+ { int ret;
251
+ ret = slice_from_s(z, 1, s_7); /* <-, line 59 */
252
+ if (ret < 0) return ret;
253
+ }
254
+ break;
255
+ case 3:
256
+ { int ret;
257
+ ret = slice_from_s(z, 1, s_8); /* <-, line 60 */
258
+ if (ret < 0) return ret;
259
+ }
260
+ break;
261
+ case 4:
262
+ { int ret;
263
+ ret = slice_from_s(z, 1, s_9); /* <-, line 61 */
264
+ if (ret < 0) return ret;
265
+ }
266
+ break;
267
+ case 5:
268
+ { int ret;
269
+ ret = slice_from_s(z, 1, s_10); /* <-, line 62 */
270
+ if (ret < 0) return ret;
271
+ }
272
+ break;
273
+ case 6:
274
+ if (z->c >= z->l) goto lab0;
275
+ z->c++; /* next, line 63 */
276
+ break;
277
+ }
278
+ continue;
279
+ lab0:
280
+ z->c = c;
281
+ break;
282
+ }
283
+ return 1;
284
+ }
285
+
286
+ static int r_R1(struct SN_env * z) {
287
+ if (!(z->I[0] <= z->c)) return 0;
288
+ return 1;
289
+ }
290
+
291
+ static int r_R2(struct SN_env * z) {
292
+ if (!(z->I[1] <= z->c)) return 0;
293
+ return 1;
294
+ }
295
+
296
+ static int r_standard_suffix(struct SN_env * z) {
297
+ int among_var;
298
+ { int m = z->l - z->c; (void) m; /* do, line 74 */
299
+ z->ket = z->c; /* [, line 75 */
300
+ among_var = find_among_b(z, a_1, 7); /* substring, line 75 */
301
+ if (!(among_var)) goto lab0;
302
+ z->bra = z->c; /* ], line 75 */
303
+ { int ret = r_R1(z);
304
+ if (ret == 0) goto lab0; /* call R1, line 75 */
305
+ if (ret < 0) return ret;
306
+ }
307
+ switch(among_var) {
308
+ case 0: goto lab0;
309
+ case 1:
310
+ { int ret;
311
+ ret = slice_del(z); /* delete, line 77 */
312
+ if (ret < 0) return ret;
313
+ }
314
+ break;
315
+ case 2:
316
+ if (!(in_grouping_b(z, g_s_ending, 98, 116))) goto lab0;
317
+ { int ret;
318
+ ret = slice_del(z); /* delete, line 80 */
319
+ if (ret < 0) return ret;
320
+ }
321
+ break;
322
+ }
323
+ lab0:
324
+ z->c = z->l - m;
325
+ }
326
+ { int m = z->l - z->c; (void) m; /* do, line 84 */
327
+ z->ket = z->c; /* [, line 85 */
328
+ among_var = find_among_b(z, a_2, 4); /* substring, line 85 */
329
+ if (!(among_var)) goto lab1;
330
+ z->bra = z->c; /* ], line 85 */
331
+ { int ret = r_R1(z);
332
+ if (ret == 0) goto lab1; /* call R1, line 85 */
333
+ if (ret < 0) return ret;
334
+ }
335
+ switch(among_var) {
336
+ case 0: goto lab1;
337
+ case 1:
338
+ { int ret;
339
+ ret = slice_del(z); /* delete, line 87 */
340
+ if (ret < 0) return ret;
341
+ }
342
+ break;
343
+ case 2:
344
+ if (!(in_grouping_b(z, g_st_ending, 98, 116))) goto lab1;
345
+ { int c = z->c - 3;
346
+ if (z->lb > c || c > z->l) goto lab1;
347
+ z->c = c; /* hop, line 90 */
348
+ }
349
+ { int ret;
350
+ ret = slice_del(z); /* delete, line 90 */
351
+ if (ret < 0) return ret;
352
+ }
353
+ break;
354
+ }
355
+ lab1:
356
+ z->c = z->l - m;
357
+ }
358
+ { int m = z->l - z->c; (void) m; /* do, line 94 */
359
+ z->ket = z->c; /* [, line 95 */
360
+ among_var = find_among_b(z, a_4, 8); /* substring, line 95 */
361
+ if (!(among_var)) goto lab2;
362
+ z->bra = z->c; /* ], line 95 */
363
+ { int ret = r_R2(z);
364
+ if (ret == 0) goto lab2; /* call R2, line 95 */
365
+ if (ret < 0) return ret;
366
+ }
367
+ switch(among_var) {
368
+ case 0: goto lab2;
369
+ case 1:
370
+ { int ret;
371
+ ret = slice_del(z); /* delete, line 97 */
372
+ if (ret < 0) return ret;
373
+ }
374
+ { int m = z->l - z->c; (void) m; /* try, line 98 */
375
+ z->ket = z->c; /* [, line 98 */
376
+ if (!(eq_s_b(z, 2, s_11))) { z->c = z->l - m; goto lab3; }
377
+ z->bra = z->c; /* ], line 98 */
378
+ { int m = z->l - z->c; (void) m; /* not, line 98 */
379
+ if (!(eq_s_b(z, 1, s_12))) goto lab4;
380
+ { z->c = z->l - m; goto lab3; }
381
+ lab4:
382
+ z->c = z->l - m;
383
+ }
384
+ { int ret = r_R2(z);
385
+ if (ret == 0) { z->c = z->l - m; goto lab3; } /* call R2, line 98 */
386
+ if (ret < 0) return ret;
387
+ }
388
+ { int ret;
389
+ ret = slice_del(z); /* delete, line 98 */
390
+ if (ret < 0) return ret;
391
+ }
392
+ lab3:
393
+ ;
394
+ }
395
+ break;
396
+ case 2:
397
+ { int m = z->l - z->c; (void) m; /* not, line 101 */
398
+ if (!(eq_s_b(z, 1, s_13))) goto lab5;
399
+ goto lab2;
400
+ lab5:
401
+ z->c = z->l - m;
402
+ }
403
+ { int ret;
404
+ ret = slice_del(z); /* delete, line 101 */
405
+ if (ret < 0) return ret;
406
+ }
407
+ break;
408
+ case 3:
409
+ { int ret;
410
+ ret = slice_del(z); /* delete, line 104 */
411
+ if (ret < 0) return ret;
412
+ }
413
+ { int m = z->l - z->c; (void) m; /* try, line 105 */
414
+ z->ket = z->c; /* [, line 106 */
415
+ { int m = z->l - z->c; (void) m; /* or, line 106 */
416
+ if (!(eq_s_b(z, 2, s_14))) goto lab8;
417
+ goto lab7;
418
+ lab8:
419
+ z->c = z->l - m;
420
+ if (!(eq_s_b(z, 2, s_15))) { z->c = z->l - m; goto lab6; }
421
+ }
422
+ lab7:
423
+ z->bra = z->c; /* ], line 106 */
424
+ { int ret = r_R1(z);
425
+ if (ret == 0) { z->c = z->l - m; goto lab6; } /* call R1, line 106 */
426
+ if (ret < 0) return ret;
427
+ }
428
+ { int ret;
429
+ ret = slice_del(z); /* delete, line 106 */
430
+ if (ret < 0) return ret;
431
+ }
432
+ lab6:
433
+ ;
434
+ }
435
+ break;
436
+ case 4:
437
+ { int ret;
438
+ ret = slice_del(z); /* delete, line 110 */
439
+ if (ret < 0) return ret;
440
+ }
441
+ { int m = z->l - z->c; (void) m; /* try, line 111 */
442
+ z->ket = z->c; /* [, line 112 */
443
+ among_var = find_among_b(z, a_3, 2); /* substring, line 112 */
444
+ if (!(among_var)) { z->c = z->l - m; goto lab9; }
445
+ z->bra = z->c; /* ], line 112 */
446
+ { int ret = r_R2(z);
447
+ if (ret == 0) { z->c = z->l - m; goto lab9; } /* call R2, line 112 */
448
+ if (ret < 0) return ret;
449
+ }
450
+ switch(among_var) {
451
+ case 0: { z->c = z->l - m; goto lab9; }
452
+ case 1:
453
+ { int ret;
454
+ ret = slice_del(z); /* delete, line 114 */
455
+ if (ret < 0) return ret;
456
+ }
457
+ break;
458
+ }
459
+ lab9:
460
+ ;
461
+ }
462
+ break;
463
+ }
464
+ lab2:
465
+ z->c = z->l - m;
466
+ }
467
+ return 1;
468
+ }
469
+
470
+ extern int german_ISO_8859_1_stem(struct SN_env * z) {
471
+ { int c = z->c; /* do, line 125 */
472
+ { int ret = r_prelude(z);
473
+ if (ret == 0) goto lab0; /* call prelude, line 125 */
474
+ if (ret < 0) return ret;
475
+ }
476
+ lab0:
477
+ z->c = c;
478
+ }
479
+ { int c = z->c; /* do, line 126 */
480
+ { int ret = r_mark_regions(z);
481
+ if (ret == 0) goto lab1; /* call mark_regions, line 126 */
482
+ if (ret < 0) return ret;
483
+ }
484
+ lab1:
485
+ z->c = c;
486
+ }
487
+ z->lb = z->c; z->c = z->l; /* backwards, line 127 */
488
+
489
+ { int m = z->l - z->c; (void) m; /* do, line 128 */
490
+ { int ret = r_standard_suffix(z);
491
+ if (ret == 0) goto lab2; /* call standard_suffix, line 128 */
492
+ if (ret < 0) return ret;
493
+ }
494
+ lab2:
495
+ z->c = z->l - m;
496
+ }
497
+ z->c = z->lb;
498
+ { int c = z->c; /* do, line 129 */
499
+ { int ret = r_postlude(z);
500
+ if (ret == 0) goto lab3; /* call postlude, line 129 */
501
+ if (ret < 0) return ret;
502
+ }
503
+ lab3:
504
+ z->c = c;
505
+ }
506
+ return 1;
507
+ }
508
+
509
+ extern struct SN_env * german_ISO_8859_1_create_env(void) { return SN_create_env(0, 3, 0); }
510
+
511
+ extern void german_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z); }
512
+