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