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