sdsykes-ferret 0.11.6.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. data/CHANGELOG +24 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README +102 -0
  4. data/Rakefile +338 -0
  5. data/TODO +17 -0
  6. data/TUTORIAL +231 -0
  7. data/bin/ferret-browser +79 -0
  8. data/ext/analysis.c +1555 -0
  9. data/ext/analysis.h +219 -0
  10. data/ext/api.c +69 -0
  11. data/ext/api.h +27 -0
  12. data/ext/array.c +123 -0
  13. data/ext/array.h +53 -0
  14. data/ext/bitvector.c +540 -0
  15. data/ext/bitvector.h +272 -0
  16. data/ext/compound_io.c +383 -0
  17. data/ext/config.h +42 -0
  18. data/ext/document.c +156 -0
  19. data/ext/document.h +53 -0
  20. data/ext/except.c +120 -0
  21. data/ext/except.h +168 -0
  22. data/ext/extconf.rb +14 -0
  23. data/ext/ferret.c +402 -0
  24. data/ext/ferret.h +91 -0
  25. data/ext/filter.c +156 -0
  26. data/ext/fs_store.c +483 -0
  27. data/ext/global.c +418 -0
  28. data/ext/global.h +117 -0
  29. data/ext/hash.c +567 -0
  30. data/ext/hash.h +473 -0
  31. data/ext/hashset.c +170 -0
  32. data/ext/hashset.h +187 -0
  33. data/ext/header.h +58 -0
  34. data/ext/helper.c +62 -0
  35. data/ext/helper.h +13 -0
  36. data/ext/inc/lang.h +48 -0
  37. data/ext/inc/threading.h +31 -0
  38. data/ext/index.c +6425 -0
  39. data/ext/index.h +961 -0
  40. data/ext/lang.h +66 -0
  41. data/ext/libstemmer.c +92 -0
  42. data/ext/libstemmer.h +79 -0
  43. data/ext/mempool.c +87 -0
  44. data/ext/mempool.h +35 -0
  45. data/ext/modules.h +162 -0
  46. data/ext/multimapper.c +310 -0
  47. data/ext/multimapper.h +51 -0
  48. data/ext/posh.c +1006 -0
  49. data/ext/posh.h +1007 -0
  50. data/ext/priorityqueue.c +151 -0
  51. data/ext/priorityqueue.h +143 -0
  52. data/ext/q_boolean.c +1608 -0
  53. data/ext/q_const_score.c +161 -0
  54. data/ext/q_filtered_query.c +209 -0
  55. data/ext/q_fuzzy.c +268 -0
  56. data/ext/q_match_all.c +148 -0
  57. data/ext/q_multi_term.c +677 -0
  58. data/ext/q_parser.c +2825 -0
  59. data/ext/q_phrase.c +1126 -0
  60. data/ext/q_prefix.c +100 -0
  61. data/ext/q_range.c +350 -0
  62. data/ext/q_span.c +2402 -0
  63. data/ext/q_term.c +337 -0
  64. data/ext/q_wildcard.c +171 -0
  65. data/ext/r_analysis.c +2575 -0
  66. data/ext/r_index.c +3472 -0
  67. data/ext/r_qparser.c +585 -0
  68. data/ext/r_search.c +4105 -0
  69. data/ext/r_store.c +513 -0
  70. data/ext/r_utils.c +963 -0
  71. data/ext/ram_store.c +471 -0
  72. data/ext/search.c +1741 -0
  73. data/ext/search.h +885 -0
  74. data/ext/similarity.c +150 -0
  75. data/ext/similarity.h +82 -0
  76. data/ext/sort.c +983 -0
  77. data/ext/stem_ISO_8859_1_danish.c +338 -0
  78. data/ext/stem_ISO_8859_1_danish.h +16 -0
  79. data/ext/stem_ISO_8859_1_dutch.c +635 -0
  80. data/ext/stem_ISO_8859_1_dutch.h +16 -0
  81. data/ext/stem_ISO_8859_1_english.c +1156 -0
  82. data/ext/stem_ISO_8859_1_english.h +16 -0
  83. data/ext/stem_ISO_8859_1_finnish.c +792 -0
  84. data/ext/stem_ISO_8859_1_finnish.h +16 -0
  85. data/ext/stem_ISO_8859_1_french.c +1276 -0
  86. data/ext/stem_ISO_8859_1_french.h +16 -0
  87. data/ext/stem_ISO_8859_1_german.c +512 -0
  88. data/ext/stem_ISO_8859_1_german.h +16 -0
  89. data/ext/stem_ISO_8859_1_italian.c +1091 -0
  90. data/ext/stem_ISO_8859_1_italian.h +16 -0
  91. data/ext/stem_ISO_8859_1_norwegian.c +296 -0
  92. data/ext/stem_ISO_8859_1_norwegian.h +16 -0
  93. data/ext/stem_ISO_8859_1_porter.c +776 -0
  94. data/ext/stem_ISO_8859_1_porter.h +16 -0
  95. data/ext/stem_ISO_8859_1_portuguese.c +1035 -0
  96. data/ext/stem_ISO_8859_1_portuguese.h +16 -0
  97. data/ext/stem_ISO_8859_1_spanish.c +1119 -0
  98. data/ext/stem_ISO_8859_1_spanish.h +16 -0
  99. data/ext/stem_ISO_8859_1_swedish.c +307 -0
  100. data/ext/stem_ISO_8859_1_swedish.h +16 -0
  101. data/ext/stem_KOI8_R_russian.c +701 -0
  102. data/ext/stem_KOI8_R_russian.h +16 -0
  103. data/ext/stem_UTF_8_danish.c +344 -0
  104. data/ext/stem_UTF_8_danish.h +16 -0
  105. data/ext/stem_UTF_8_dutch.c +653 -0
  106. data/ext/stem_UTF_8_dutch.h +16 -0
  107. data/ext/stem_UTF_8_english.c +1176 -0
  108. data/ext/stem_UTF_8_english.h +16 -0
  109. data/ext/stem_UTF_8_finnish.c +808 -0
  110. data/ext/stem_UTF_8_finnish.h +16 -0
  111. data/ext/stem_UTF_8_french.c +1296 -0
  112. data/ext/stem_UTF_8_french.h +16 -0
  113. data/ext/stem_UTF_8_german.c +526 -0
  114. data/ext/stem_UTF_8_german.h +16 -0
  115. data/ext/stem_UTF_8_italian.c +1113 -0
  116. data/ext/stem_UTF_8_italian.h +16 -0
  117. data/ext/stem_UTF_8_norwegian.c +302 -0
  118. data/ext/stem_UTF_8_norwegian.h +16 -0
  119. data/ext/stem_UTF_8_porter.c +794 -0
  120. data/ext/stem_UTF_8_porter.h +16 -0
  121. data/ext/stem_UTF_8_portuguese.c +1055 -0
  122. data/ext/stem_UTF_8_portuguese.h +16 -0
  123. data/ext/stem_UTF_8_russian.c +709 -0
  124. data/ext/stem_UTF_8_russian.h +16 -0
  125. data/ext/stem_UTF_8_spanish.c +1137 -0
  126. data/ext/stem_UTF_8_spanish.h +16 -0
  127. data/ext/stem_UTF_8_swedish.c +313 -0
  128. data/ext/stem_UTF_8_swedish.h +16 -0
  129. data/ext/stopwords.c +401 -0
  130. data/ext/store.c +692 -0
  131. data/ext/store.h +777 -0
  132. data/ext/term_vectors.c +352 -0
  133. data/ext/threading.h +31 -0
  134. data/ext/utilities.c +446 -0
  135. data/ext/win32.h +54 -0
  136. data/lib/ferret.rb +29 -0
  137. data/lib/ferret/browser.rb +246 -0
  138. data/lib/ferret/browser/s/global.js +192 -0
  139. data/lib/ferret/browser/s/style.css +148 -0
  140. data/lib/ferret/browser/views/document/list.rhtml +49 -0
  141. data/lib/ferret/browser/views/document/show.rhtml +27 -0
  142. data/lib/ferret/browser/views/error/index.rhtml +7 -0
  143. data/lib/ferret/browser/views/help/index.rhtml +8 -0
  144. data/lib/ferret/browser/views/home/index.rhtml +29 -0
  145. data/lib/ferret/browser/views/layout.rhtml +22 -0
  146. data/lib/ferret/browser/views/term-vector/index.rhtml +4 -0
  147. data/lib/ferret/browser/views/term/index.rhtml +199 -0
  148. data/lib/ferret/browser/views/term/termdocs.rhtml +1 -0
  149. data/lib/ferret/browser/webrick.rb +14 -0
  150. data/lib/ferret/document.rb +130 -0
  151. data/lib/ferret/field_infos.rb +44 -0
  152. data/lib/ferret/index.rb +786 -0
  153. data/lib/ferret/number_tools.rb +157 -0
  154. data/lib/ferret_version.rb +3 -0
  155. data/setup.rb +1555 -0
  156. data/test/test_all.rb +5 -0
  157. data/test/test_helper.rb +24 -0
  158. data/test/threading/number_to_spoken.rb +132 -0
  159. data/test/threading/thread_safety_index_test.rb +79 -0
  160. data/test/threading/thread_safety_read_write_test.rb +76 -0
  161. data/test/threading/thread_safety_test.rb +133 -0
  162. data/test/unit/analysis/tc_analyzer.rb +548 -0
  163. data/test/unit/analysis/tc_token_stream.rb +646 -0
  164. data/test/unit/index/tc_index.rb +762 -0
  165. data/test/unit/index/tc_index_reader.rb +699 -0
  166. data/test/unit/index/tc_index_writer.rb +437 -0
  167. data/test/unit/index/th_doc.rb +315 -0
  168. data/test/unit/largefile/tc_largefile.rb +46 -0
  169. data/test/unit/query_parser/tc_query_parser.rb +238 -0
  170. data/test/unit/search/tc_filter.rb +135 -0
  171. data/test/unit/search/tc_fuzzy_query.rb +147 -0
  172. data/test/unit/search/tc_index_searcher.rb +61 -0
  173. data/test/unit/search/tc_multi_searcher.rb +128 -0
  174. data/test/unit/search/tc_multiple_search_requests.rb +58 -0
  175. data/test/unit/search/tc_search_and_sort.rb +179 -0
  176. data/test/unit/search/tc_sort.rb +49 -0
  177. data/test/unit/search/tc_sort_field.rb +27 -0
  178. data/test/unit/search/tc_spans.rb +190 -0
  179. data/test/unit/search/tm_searcher.rb +384 -0
  180. data/test/unit/store/tc_fs_store.rb +77 -0
  181. data/test/unit/store/tc_ram_store.rb +35 -0
  182. data/test/unit/store/tm_store.rb +34 -0
  183. data/test/unit/store/tm_store_lock.rb +68 -0
  184. data/test/unit/tc_document.rb +81 -0
  185. data/test/unit/ts_analysis.rb +2 -0
  186. data/test/unit/ts_index.rb +2 -0
  187. data/test/unit/ts_largefile.rb +4 -0
  188. data/test/unit/ts_query_parser.rb +2 -0
  189. data/test/unit/ts_search.rb +2 -0
  190. data/test/unit/ts_store.rb +2 -0
  191. data/test/unit/ts_utils.rb +2 -0
  192. data/test/unit/utils/tc_bit_vector.rb +295 -0
  193. data/test/unit/utils/tc_number_tools.rb +117 -0
  194. data/test/unit/utils/tc_priority_queue.rb +106 -0
  195. metadata +285 -0
@@ -0,0 +1,16 @@
1
+
2
+ /* This file was generated automatically by the Snowball to ANSI C compiler */
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ extern struct SN_env * italian_ISO_8859_1_create_env(void);
9
+ extern void italian_ISO_8859_1_close_env(struct SN_env * z);
10
+
11
+ extern int italian_ISO_8859_1_stem(struct SN_env * z);
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif
16
+
@@ -0,0 +1,296 @@
1
+
2
+ /* This file was generated automatically by the Snowball to ANSI C compiler */
3
+
4
+ #include "header.h"
5
+
6
+ extern int norwegian_ISO_8859_1_stem(struct SN_env * z);
7
+ static int r_other_suffix(struct SN_env * z);
8
+ static int r_consonant_pair(struct SN_env * z);
9
+ static int r_main_suffix(struct SN_env * z);
10
+ static int r_mark_regions(struct SN_env * z);
11
+
12
+ extern struct SN_env * norwegian_ISO_8859_1_create_env(void);
13
+ extern void norwegian_ISO_8859_1_close_env(struct SN_env * z);
14
+
15
+ static symbol s_0_0[1] = { 'a' };
16
+ static symbol s_0_1[1] = { 'e' };
17
+ static symbol s_0_2[3] = { 'e', 'd', 'e' };
18
+ static symbol s_0_3[4] = { 'a', 'n', 'd', 'e' };
19
+ static symbol s_0_4[4] = { 'e', 'n', 'd', 'e' };
20
+ static symbol s_0_5[3] = { 'a', 'n', 'e' };
21
+ static symbol s_0_6[3] = { 'e', 'n', 'e' };
22
+ static symbol s_0_7[6] = { 'h', 'e', 't', 'e', 'n', 'e' };
23
+ static symbol s_0_8[4] = { 'e', 'r', 't', 'e' };
24
+ static symbol s_0_9[2] = { 'e', 'n' };
25
+ static symbol s_0_10[5] = { 'h', 'e', 't', 'e', 'n' };
26
+ static symbol s_0_11[2] = { 'a', 'r' };
27
+ static symbol s_0_12[2] = { 'e', 'r' };
28
+ static symbol s_0_13[5] = { 'h', 'e', 't', 'e', 'r' };
29
+ static symbol s_0_14[1] = { 's' };
30
+ static symbol s_0_15[2] = { 'a', 's' };
31
+ static symbol s_0_16[2] = { 'e', 's' };
32
+ static symbol s_0_17[4] = { 'e', 'd', 'e', 's' };
33
+ static symbol s_0_18[5] = { 'e', 'n', 'd', 'e', 's' };
34
+ static symbol s_0_19[4] = { 'e', 'n', 'e', 's' };
35
+ static symbol s_0_20[7] = { 'h', 'e', 't', 'e', 'n', 'e', 's' };
36
+ static symbol s_0_21[3] = { 'e', 'n', 's' };
37
+ static symbol s_0_22[6] = { 'h', 'e', 't', 'e', 'n', 's' };
38
+ static symbol s_0_23[3] = { 'e', 'r', 's' };
39
+ static symbol s_0_24[3] = { 'e', 't', 's' };
40
+ static symbol s_0_25[2] = { 'e', 't' };
41
+ static symbol s_0_26[3] = { 'h', 'e', 't' };
42
+ static symbol s_0_27[3] = { 'e', 'r', 't' };
43
+ static symbol s_0_28[3] = { 'a', 's', 't' };
44
+
45
+ static struct among a_0[29] =
46
+ {
47
+ /* 0 */ { 1, s_0_0, -1, 1, 0},
48
+ /* 1 */ { 1, s_0_1, -1, 1, 0},
49
+ /* 2 */ { 3, s_0_2, 1, 1, 0},
50
+ /* 3 */ { 4, s_0_3, 1, 1, 0},
51
+ /* 4 */ { 4, s_0_4, 1, 1, 0},
52
+ /* 5 */ { 3, s_0_5, 1, 1, 0},
53
+ /* 6 */ { 3, s_0_6, 1, 1, 0},
54
+ /* 7 */ { 6, s_0_7, 6, 1, 0},
55
+ /* 8 */ { 4, s_0_8, 1, 3, 0},
56
+ /* 9 */ { 2, s_0_9, -1, 1, 0},
57
+ /* 10 */ { 5, s_0_10, 9, 1, 0},
58
+ /* 11 */ { 2, s_0_11, -1, 1, 0},
59
+ /* 12 */ { 2, s_0_12, -1, 1, 0},
60
+ /* 13 */ { 5, s_0_13, 12, 1, 0},
61
+ /* 14 */ { 1, s_0_14, -1, 2, 0},
62
+ /* 15 */ { 2, s_0_15, 14, 1, 0},
63
+ /* 16 */ { 2, s_0_16, 14, 1, 0},
64
+ /* 17 */ { 4, s_0_17, 16, 1, 0},
65
+ /* 18 */ { 5, s_0_18, 16, 1, 0},
66
+ /* 19 */ { 4, s_0_19, 16, 1, 0},
67
+ /* 20 */ { 7, s_0_20, 19, 1, 0},
68
+ /* 21 */ { 3, s_0_21, 14, 1, 0},
69
+ /* 22 */ { 6, s_0_22, 21, 1, 0},
70
+ /* 23 */ { 3, s_0_23, 14, 1, 0},
71
+ /* 24 */ { 3, s_0_24, 14, 1, 0},
72
+ /* 25 */ { 2, s_0_25, -1, 1, 0},
73
+ /* 26 */ { 3, s_0_26, 25, 1, 0},
74
+ /* 27 */ { 3, s_0_27, -1, 3, 0},
75
+ /* 28 */ { 3, s_0_28, -1, 1, 0}
76
+ };
77
+
78
+ static symbol s_1_0[2] = { 'd', 't' };
79
+ static symbol s_1_1[2] = { 'v', 't' };
80
+
81
+ static struct among a_1[2] =
82
+ {
83
+ /* 0 */ { 2, s_1_0, -1, -1, 0},
84
+ /* 1 */ { 2, s_1_1, -1, -1, 0}
85
+ };
86
+
87
+ static symbol s_2_0[3] = { 'l', 'e', 'g' };
88
+ static symbol s_2_1[4] = { 'e', 'l', 'e', 'g' };
89
+ static symbol s_2_2[2] = { 'i', 'g' };
90
+ static symbol s_2_3[3] = { 'e', 'i', 'g' };
91
+ static symbol s_2_4[3] = { 'l', 'i', 'g' };
92
+ static symbol s_2_5[4] = { 'e', 'l', 'i', 'g' };
93
+ static symbol s_2_6[3] = { 'e', 'l', 's' };
94
+ static symbol s_2_7[3] = { 'l', 'o', 'v' };
95
+ static symbol s_2_8[4] = { 'e', 'l', 'o', 'v' };
96
+ static symbol s_2_9[4] = { 's', 'l', 'o', 'v' };
97
+ static symbol s_2_10[7] = { 'h', 'e', 't', 's', 'l', 'o', 'v' };
98
+
99
+ static struct among a_2[11] =
100
+ {
101
+ /* 0 */ { 3, s_2_0, -1, 1, 0},
102
+ /* 1 */ { 4, s_2_1, 0, 1, 0},
103
+ /* 2 */ { 2, s_2_2, -1, 1, 0},
104
+ /* 3 */ { 3, s_2_3, 2, 1, 0},
105
+ /* 4 */ { 3, s_2_4, 2, 1, 0},
106
+ /* 5 */ { 4, s_2_5, 4, 1, 0},
107
+ /* 6 */ { 3, s_2_6, -1, 1, 0},
108
+ /* 7 */ { 3, s_2_7, -1, 1, 0},
109
+ /* 8 */ { 4, s_2_8, 7, 1, 0},
110
+ /* 9 */ { 4, s_2_9, 7, 1, 0},
111
+ /* 10 */ { 7, s_2_10, 9, 1, 0}
112
+ };
113
+
114
+ static unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
115
+
116
+ static unsigned char g_s_ending[] = { 119, 125, 149, 1 };
117
+
118
+ static symbol s_0[] = { 'k' };
119
+ static symbol s_1[] = { 'e', 'r' };
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 30 */
124
+ { int c = z->c + 3;
125
+ if (0 > c || c > z->l) return 0;
126
+ z->c = c; /* hop, line 30 */
127
+ }
128
+ z->I[1] = z->c; /* setmark x, line 30 */
129
+ z->c = c_test;
130
+ }
131
+ while(1) { /* goto, line 31 */
132
+ int c = z->c;
133
+ if (!(in_grouping(z, g_v, 97, 248))) goto lab0;
134
+ z->c = c;
135
+ break;
136
+ lab0:
137
+ z->c = c;
138
+ if (z->c >= z->l) return 0;
139
+ z->c++; /* goto, line 31 */
140
+ }
141
+ while(1) { /* gopast, line 31 */
142
+ if (!(out_grouping(z, g_v, 97, 248))) goto lab1;
143
+ break;
144
+ lab1:
145
+ if (z->c >= z->l) return 0;
146
+ z->c++; /* gopast, line 31 */
147
+ }
148
+ z->I[0] = z->c; /* setmark p1, line 31 */
149
+ /* try, line 32 */
150
+ if (!(z->I[0] < z->I[1])) goto lab2;
151
+ z->I[0] = z->I[1];
152
+ lab2:
153
+ return 1;
154
+ }
155
+
156
+ static int r_main_suffix(struct SN_env * z) {
157
+ int among_var;
158
+ { int m3; /* setlimit, line 38 */
159
+ int m = z->l - z->c; (void) m;
160
+ if (z->c < z->I[0]) return 0;
161
+ z->c = z->I[0]; /* tomark, line 38 */
162
+ m3 = z->lb; z->lb = z->c;
163
+ z->c = z->l - m;
164
+ z->ket = z->c; /* [, line 38 */
165
+ among_var = find_among_b(z, a_0, 29); /* substring, line 38 */
166
+ if (!(among_var)) { z->lb = m3; return 0; }
167
+ z->bra = z->c; /* ], line 38 */
168
+ z->lb = m3;
169
+ }
170
+ switch(among_var) {
171
+ case 0: return 0;
172
+ case 1:
173
+ { int ret;
174
+ ret = slice_del(z); /* delete, line 44 */
175
+ if (ret < 0) return ret;
176
+ }
177
+ break;
178
+ case 2:
179
+ { int m = z->l - z->c; (void) m; /* or, line 46 */
180
+ if (!(in_grouping_b(z, g_s_ending, 98, 122))) goto lab1;
181
+ goto lab0;
182
+ lab1:
183
+ z->c = z->l - m;
184
+ if (!(eq_s_b(z, 1, s_0))) return 0;
185
+ if (!(out_grouping_b(z, g_v, 97, 248))) return 0;
186
+ }
187
+ lab0:
188
+ { int ret;
189
+ ret = slice_del(z); /* delete, line 46 */
190
+ if (ret < 0) return ret;
191
+ }
192
+ break;
193
+ case 3:
194
+ { int ret;
195
+ ret = slice_from_s(z, 2, s_1); /* <-, line 48 */
196
+ if (ret < 0) return ret;
197
+ }
198
+ break;
199
+ }
200
+ return 1;
201
+ }
202
+
203
+ static int r_consonant_pair(struct SN_env * z) {
204
+ { int m_test = z->l - z->c; /* test, line 53 */
205
+ { int m3; /* setlimit, line 54 */
206
+ int m = z->l - z->c; (void) m;
207
+ if (z->c < z->I[0]) return 0;
208
+ z->c = z->I[0]; /* tomark, line 54 */
209
+ m3 = z->lb; z->lb = z->c;
210
+ z->c = z->l - m;
211
+ z->ket = z->c; /* [, line 54 */
212
+ if (!(find_among_b(z, a_1, 2))) { z->lb = m3; return 0; } /* substring, line 54 */
213
+ z->bra = z->c; /* ], line 54 */
214
+ z->lb = m3;
215
+ }
216
+ z->c = z->l - m_test;
217
+ }
218
+ if (z->c <= z->lb) return 0;
219
+ z->c--; /* next, line 59 */
220
+ z->bra = z->c; /* ], line 59 */
221
+ { int ret;
222
+ ret = slice_del(z); /* delete, line 59 */
223
+ if (ret < 0) return ret;
224
+ }
225
+ return 1;
226
+ }
227
+
228
+ static int r_other_suffix(struct SN_env * z) {
229
+ int among_var;
230
+ { int m3; /* setlimit, line 63 */
231
+ int m = z->l - z->c; (void) m;
232
+ if (z->c < z->I[0]) return 0;
233
+ z->c = z->I[0]; /* tomark, line 63 */
234
+ m3 = z->lb; z->lb = z->c;
235
+ z->c = z->l - m;
236
+ z->ket = z->c; /* [, line 63 */
237
+ among_var = find_among_b(z, a_2, 11); /* substring, line 63 */
238
+ if (!(among_var)) { z->lb = m3; return 0; }
239
+ z->bra = z->c; /* ], line 63 */
240
+ z->lb = m3;
241
+ }
242
+ switch(among_var) {
243
+ case 0: return 0;
244
+ case 1:
245
+ { int ret;
246
+ ret = slice_del(z); /* delete, line 67 */
247
+ if (ret < 0) return ret;
248
+ }
249
+ break;
250
+ }
251
+ return 1;
252
+ }
253
+
254
+ extern int norwegian_ISO_8859_1_stem(struct SN_env * z) {
255
+ { int c = z->c; /* do, line 74 */
256
+ { int ret = r_mark_regions(z);
257
+ if (ret == 0) goto lab0; /* call mark_regions, line 74 */
258
+ if (ret < 0) return ret;
259
+ }
260
+ lab0:
261
+ z->c = c;
262
+ }
263
+ z->lb = z->c; z->c = z->l; /* backwards, line 75 */
264
+
265
+ { int m = z->l - z->c; (void) m; /* do, line 76 */
266
+ { int ret = r_main_suffix(z);
267
+ if (ret == 0) goto lab1; /* call main_suffix, line 76 */
268
+ if (ret < 0) return ret;
269
+ }
270
+ lab1:
271
+ z->c = z->l - m;
272
+ }
273
+ { int m = z->l - z->c; (void) m; /* do, line 77 */
274
+ { int ret = r_consonant_pair(z);
275
+ if (ret == 0) goto lab2; /* call consonant_pair, line 77 */
276
+ if (ret < 0) return ret;
277
+ }
278
+ lab2:
279
+ z->c = z->l - m;
280
+ }
281
+ { int m = z->l - z->c; (void) m; /* do, line 78 */
282
+ { int ret = r_other_suffix(z);
283
+ if (ret == 0) goto lab3; /* call other_suffix, line 78 */
284
+ if (ret < 0) return ret;
285
+ }
286
+ lab3:
287
+ z->c = z->l - m;
288
+ }
289
+ z->c = z->lb;
290
+ return 1;
291
+ }
292
+
293
+ extern struct SN_env * norwegian_ISO_8859_1_create_env(void) { return SN_create_env(0, 2, 0); }
294
+
295
+ extern void norwegian_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z); }
296
+
@@ -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 * norwegian_ISO_8859_1_create_env(void);
9
+ extern void norwegian_ISO_8859_1_close_env(struct SN_env * z);
10
+
11
+ extern int norwegian_ISO_8859_1_stem(struct SN_env * z);
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif
16
+
@@ -0,0 +1,776 @@
1
+
2
+ /* This file was generated automatically by the Snowball to ANSI C compiler */
3
+
4
+ #include "header.h"
5
+
6
+ extern int porter_ISO_8859_1_stem(struct SN_env * z);
7
+ static int r_Step_5b(struct SN_env * z);
8
+ static int r_Step_5a(struct SN_env * z);
9
+ static int r_Step_4(struct SN_env * z);
10
+ static int r_Step_3(struct SN_env * z);
11
+ static int r_Step_2(struct SN_env * z);
12
+ static int r_Step_1c(struct SN_env * z);
13
+ static int r_Step_1b(struct SN_env * z);
14
+ static int r_Step_1a(struct SN_env * z);
15
+ static int r_R2(struct SN_env * z);
16
+ static int r_R1(struct SN_env * z);
17
+ static int r_shortv(struct SN_env * z);
18
+
19
+ extern struct SN_env * porter_ISO_8859_1_create_env(void);
20
+ extern void porter_ISO_8859_1_close_env(struct SN_env * z);
21
+
22
+ static symbol s_0_0[1] = { 's' };
23
+ static symbol s_0_1[3] = { 'i', 'e', 's' };
24
+ static symbol s_0_2[4] = { 's', 's', 'e', 's' };
25
+ static symbol s_0_3[2] = { 's', 's' };
26
+
27
+ static struct among a_0[4] =
28
+ {
29
+ /* 0 */ { 1, s_0_0, -1, 3, 0},
30
+ /* 1 */ { 3, s_0_1, 0, 2, 0},
31
+ /* 2 */ { 4, s_0_2, 0, 1, 0},
32
+ /* 3 */ { 2, s_0_3, 0, -1, 0}
33
+ };
34
+
35
+ static symbol s_1_1[2] = { 'b', 'b' };
36
+ static symbol s_1_2[2] = { 'd', 'd' };
37
+ static symbol s_1_3[2] = { 'f', 'f' };
38
+ static symbol s_1_4[2] = { 'g', 'g' };
39
+ static symbol s_1_5[2] = { 'b', 'l' };
40
+ static symbol s_1_6[2] = { 'm', 'm' };
41
+ static symbol s_1_7[2] = { 'n', 'n' };
42
+ static symbol s_1_8[2] = { 'p', 'p' };
43
+ static symbol s_1_9[2] = { 'r', 'r' };
44
+ static symbol s_1_10[2] = { 'a', 't' };
45
+ static symbol s_1_11[2] = { 't', 't' };
46
+ static symbol s_1_12[2] = { 'i', 'z' };
47
+
48
+ static struct among a_1[13] =
49
+ {
50
+ /* 0 */ { 0, 0, -1, 3, 0},
51
+ /* 1 */ { 2, s_1_1, 0, 2, 0},
52
+ /* 2 */ { 2, s_1_2, 0, 2, 0},
53
+ /* 3 */ { 2, s_1_3, 0, 2, 0},
54
+ /* 4 */ { 2, s_1_4, 0, 2, 0},
55
+ /* 5 */ { 2, s_1_5, 0, 1, 0},
56
+ /* 6 */ { 2, s_1_6, 0, 2, 0},
57
+ /* 7 */ { 2, s_1_7, 0, 2, 0},
58
+ /* 8 */ { 2, s_1_8, 0, 2, 0},
59
+ /* 9 */ { 2, s_1_9, 0, 2, 0},
60
+ /* 10 */ { 2, s_1_10, 0, 1, 0},
61
+ /* 11 */ { 2, s_1_11, 0, 2, 0},
62
+ /* 12 */ { 2, s_1_12, 0, 1, 0}
63
+ };
64
+
65
+ static symbol s_2_0[2] = { 'e', 'd' };
66
+ static symbol s_2_1[3] = { 'e', 'e', 'd' };
67
+ static symbol s_2_2[3] = { 'i', 'n', 'g' };
68
+
69
+ static struct among a_2[3] =
70
+ {
71
+ /* 0 */ { 2, s_2_0, -1, 2, 0},
72
+ /* 1 */ { 3, s_2_1, 0, 1, 0},
73
+ /* 2 */ { 3, s_2_2, -1, 2, 0}
74
+ };
75
+
76
+ static symbol s_3_0[4] = { 'a', 'n', 'c', 'i' };
77
+ static symbol s_3_1[4] = { 'e', 'n', 'c', 'i' };
78
+ static symbol s_3_2[4] = { 'a', 'b', 'l', 'i' };
79
+ static symbol s_3_3[3] = { 'e', 'l', 'i' };
80
+ static symbol s_3_4[4] = { 'a', 'l', 'l', 'i' };
81
+ static symbol s_3_5[5] = { 'o', 'u', 's', 'l', 'i' };
82
+ static symbol s_3_6[5] = { 'e', 'n', 't', 'l', 'i' };
83
+ static symbol s_3_7[5] = { 'a', 'l', 'i', 't', 'i' };
84
+ static symbol s_3_8[6] = { 'b', 'i', 'l', 'i', 't', 'i' };
85
+ static symbol s_3_9[5] = { 'i', 'v', 'i', 't', 'i' };
86
+ static symbol s_3_10[6] = { 't', 'i', 'o', 'n', 'a', 'l' };
87
+ static symbol s_3_11[7] = { 'a', 't', 'i', 'o', 'n', 'a', 'l' };
88
+ static symbol s_3_12[5] = { 'a', 'l', 'i', 's', 'm' };
89
+ static symbol s_3_13[5] = { 'a', 't', 'i', 'o', 'n' };
90
+ static symbol s_3_14[7] = { 'i', 'z', 'a', 't', 'i', 'o', 'n' };
91
+ static symbol s_3_15[4] = { 'i', 'z', 'e', 'r' };
92
+ static symbol s_3_16[4] = { 'a', 't', 'o', 'r' };
93
+ static symbol s_3_17[7] = { 'i', 'v', 'e', 'n', 'e', 's', 's' };
94
+ static symbol s_3_18[7] = { 'f', 'u', 'l', 'n', 'e', 's', 's' };
95
+ static symbol s_3_19[7] = { 'o', 'u', 's', 'n', 'e', 's', 's' };
96
+
97
+ static struct among a_3[20] =
98
+ {
99
+ /* 0 */ { 4, s_3_0, -1, 3, 0},
100
+ /* 1 */ { 4, s_3_1, -1, 2, 0},
101
+ /* 2 */ { 4, s_3_2, -1, 4, 0},
102
+ /* 3 */ { 3, s_3_3, -1, 6, 0},
103
+ /* 4 */ { 4, s_3_4, -1, 9, 0},
104
+ /* 5 */ { 5, s_3_5, -1, 12, 0},
105
+ /* 6 */ { 5, s_3_6, -1, 5, 0},
106
+ /* 7 */ { 5, s_3_7, -1, 10, 0},
107
+ /* 8 */ { 6, s_3_8, -1, 14, 0},
108
+ /* 9 */ { 5, s_3_9, -1, 13, 0},
109
+ /* 10 */ { 6, s_3_10, -1, 1, 0},
110
+ /* 11 */ { 7, s_3_11, 10, 8, 0},
111
+ /* 12 */ { 5, s_3_12, -1, 10, 0},
112
+ /* 13 */ { 5, s_3_13, -1, 8, 0},
113
+ /* 14 */ { 7, s_3_14, 13, 7, 0},
114
+ /* 15 */ { 4, s_3_15, -1, 7, 0},
115
+ /* 16 */ { 4, s_3_16, -1, 8, 0},
116
+ /* 17 */ { 7, s_3_17, -1, 13, 0},
117
+ /* 18 */ { 7, s_3_18, -1, 11, 0},
118
+ /* 19 */ { 7, s_3_19, -1, 12, 0}
119
+ };
120
+
121
+ static symbol s_4_0[5] = { 'i', 'c', 'a', 't', 'e' };
122
+ static symbol s_4_1[5] = { 'a', 't', 'i', 'v', 'e' };
123
+ static symbol s_4_2[5] = { 'a', 'l', 'i', 'z', 'e' };
124
+ static symbol s_4_3[5] = { 'i', 'c', 'i', 't', 'i' };
125
+ static symbol s_4_4[4] = { 'i', 'c', 'a', 'l' };
126
+ static symbol s_4_5[3] = { 'f', 'u', 'l' };
127
+ static symbol s_4_6[4] = { 'n', 'e', 's', 's' };
128
+
129
+ static struct among a_4[7] =
130
+ {
131
+ /* 0 */ { 5, s_4_0, -1, 2, 0},
132
+ /* 1 */ { 5, s_4_1, -1, 3, 0},
133
+ /* 2 */ { 5, s_4_2, -1, 1, 0},
134
+ /* 3 */ { 5, s_4_3, -1, 2, 0},
135
+ /* 4 */ { 4, s_4_4, -1, 2, 0},
136
+ /* 5 */ { 3, s_4_5, -1, 3, 0},
137
+ /* 6 */ { 4, s_4_6, -1, 3, 0}
138
+ };
139
+
140
+ static symbol s_5_0[2] = { 'i', 'c' };
141
+ static symbol s_5_1[4] = { 'a', 'n', 'c', 'e' };
142
+ static symbol s_5_2[4] = { 'e', 'n', 'c', 'e' };
143
+ static symbol s_5_3[4] = { 'a', 'b', 'l', 'e' };
144
+ static symbol s_5_4[4] = { 'i', 'b', 'l', 'e' };
145
+ static symbol s_5_5[3] = { 'a', 't', 'e' };
146
+ static symbol s_5_6[3] = { 'i', 'v', 'e' };
147
+ static symbol s_5_7[3] = { 'i', 'z', 'e' };
148
+ static symbol s_5_8[3] = { 'i', 't', 'i' };
149
+ static symbol s_5_9[2] = { 'a', 'l' };
150
+ static symbol s_5_10[3] = { 'i', 's', 'm' };
151
+ static symbol s_5_11[3] = { 'i', 'o', 'n' };
152
+ static symbol s_5_12[2] = { 'e', 'r' };
153
+ static symbol s_5_13[3] = { 'o', 'u', 's' };
154
+ static symbol s_5_14[3] = { 'a', 'n', 't' };
155
+ static symbol s_5_15[3] = { 'e', 'n', 't' };
156
+ static symbol s_5_16[4] = { 'm', 'e', 'n', 't' };
157
+ static symbol s_5_17[5] = { 'e', 'm', 'e', 'n', 't' };
158
+ static symbol s_5_18[2] = { 'o', 'u' };
159
+
160
+ static struct among a_5[19] =
161
+ {
162
+ /* 0 */ { 2, s_5_0, -1, 1, 0},
163
+ /* 1 */ { 4, s_5_1, -1, 1, 0},
164
+ /* 2 */ { 4, s_5_2, -1, 1, 0},
165
+ /* 3 */ { 4, s_5_3, -1, 1, 0},
166
+ /* 4 */ { 4, s_5_4, -1, 1, 0},
167
+ /* 5 */ { 3, s_5_5, -1, 1, 0},
168
+ /* 6 */ { 3, s_5_6, -1, 1, 0},
169
+ /* 7 */ { 3, s_5_7, -1, 1, 0},
170
+ /* 8 */ { 3, s_5_8, -1, 1, 0},
171
+ /* 9 */ { 2, s_5_9, -1, 1, 0},
172
+ /* 10 */ { 3, s_5_10, -1, 1, 0},
173
+ /* 11 */ { 3, s_5_11, -1, 2, 0},
174
+ /* 12 */ { 2, s_5_12, -1, 1, 0},
175
+ /* 13 */ { 3, s_5_13, -1, 1, 0},
176
+ /* 14 */ { 3, s_5_14, -1, 1, 0},
177
+ /* 15 */ { 3, s_5_15, -1, 1, 0},
178
+ /* 16 */ { 4, s_5_16, 15, 1, 0},
179
+ /* 17 */ { 5, s_5_17, 16, 1, 0},
180
+ /* 18 */ { 2, s_5_18, -1, 1, 0}
181
+ };
182
+
183
+ static unsigned char g_v[] = { 17, 65, 16, 1 };
184
+
185
+ static unsigned char g_v_WXY[] = { 1, 17, 65, 208, 1 };
186
+
187
+ static symbol s_0[] = { 's', 's' };
188
+ static symbol s_1[] = { 'i' };
189
+ static symbol s_2[] = { 'e', 'e' };
190
+ static symbol s_3[] = { 'e' };
191
+ static symbol s_4[] = { 'e' };
192
+ static symbol s_5[] = { 'y' };
193
+ static symbol s_6[] = { 'Y' };
194
+ static symbol s_7[] = { 'i' };
195
+ static symbol s_8[] = { 't', 'i', 'o', 'n' };
196
+ static symbol s_9[] = { 'e', 'n', 'c', 'e' };
197
+ static symbol s_10[] = { 'a', 'n', 'c', 'e' };
198
+ static symbol s_11[] = { 'a', 'b', 'l', 'e' };
199
+ static symbol s_12[] = { 'e', 'n', 't' };
200
+ static symbol s_13[] = { 'e' };
201
+ static symbol s_14[] = { 'i', 'z', 'e' };
202
+ static symbol s_15[] = { 'a', 't', 'e' };
203
+ static symbol s_16[] = { 'a', 'l' };
204
+ static symbol s_17[] = { 'a', 'l' };
205
+ static symbol s_18[] = { 'f', 'u', 'l' };
206
+ static symbol s_19[] = { 'o', 'u', 's' };
207
+ static symbol s_20[] = { 'i', 'v', 'e' };
208
+ static symbol s_21[] = { 'b', 'l', 'e' };
209
+ static symbol s_22[] = { 'a', 'l' };
210
+ static symbol s_23[] = { 'i', 'c' };
211
+ static symbol s_24[] = { 's' };
212
+ static symbol s_25[] = { 't' };
213
+ static symbol s_26[] = { 'e' };
214
+ static symbol s_27[] = { 'l' };
215
+ static symbol s_28[] = { 'l' };
216
+ static symbol s_29[] = { 'y' };
217
+ static symbol s_30[] = { 'Y' };
218
+ static symbol s_31[] = { 'y' };
219
+ static symbol s_32[] = { 'Y' };
220
+ static symbol s_33[] = { 'Y' };
221
+ static symbol s_34[] = { 'y' };
222
+
223
+ static int r_shortv(struct SN_env * z) {
224
+ if (!(out_grouping_b(z, g_v_WXY, 89, 121))) return 0;
225
+ if (!(in_grouping_b(z, g_v, 97, 121))) return 0;
226
+ if (!(out_grouping_b(z, g_v, 97, 121))) return 0;
227
+ return 1;
228
+ }
229
+
230
+ static int r_R1(struct SN_env * z) {
231
+ if (!(z->I[0] <= z->c)) return 0;
232
+ return 1;
233
+ }
234
+
235
+ static int r_R2(struct SN_env * z) {
236
+ if (!(z->I[1] <= z->c)) return 0;
237
+ return 1;
238
+ }
239
+
240
+ static int r_Step_1a(struct SN_env * z) {
241
+ int among_var;
242
+ z->ket = z->c; /* [, line 25 */
243
+ among_var = find_among_b(z, a_0, 4); /* substring, line 25 */
244
+ if (!(among_var)) return 0;
245
+ z->bra = z->c; /* ], line 25 */
246
+ switch(among_var) {
247
+ case 0: return 0;
248
+ case 1:
249
+ { int ret;
250
+ ret = slice_from_s(z, 2, s_0); /* <-, line 26 */
251
+ if (ret < 0) return ret;
252
+ }
253
+ break;
254
+ case 2:
255
+ { int ret;
256
+ ret = slice_from_s(z, 1, s_1); /* <-, line 27 */
257
+ if (ret < 0) return ret;
258
+ }
259
+ break;
260
+ case 3:
261
+ { int ret;
262
+ ret = slice_del(z); /* delete, line 29 */
263
+ if (ret < 0) return ret;
264
+ }
265
+ break;
266
+ }
267
+ return 1;
268
+ }
269
+
270
+ static int r_Step_1b(struct SN_env * z) {
271
+ int among_var;
272
+ z->ket = z->c; /* [, line 34 */
273
+ among_var = find_among_b(z, a_2, 3); /* substring, line 34 */
274
+ if (!(among_var)) return 0;
275
+ z->bra = z->c; /* ], line 34 */
276
+ switch(among_var) {
277
+ case 0: return 0;
278
+ case 1:
279
+ { int ret = r_R1(z);
280
+ if (ret == 0) return 0; /* call R1, line 35 */
281
+ if (ret < 0) return ret;
282
+ }
283
+ { int ret;
284
+ ret = slice_from_s(z, 2, s_2); /* <-, line 35 */
285
+ if (ret < 0) return ret;
286
+ }
287
+ break;
288
+ case 2:
289
+ { int m_test = z->l - z->c; /* test, line 38 */
290
+ while(1) { /* gopast, line 38 */
291
+ if (!(in_grouping_b(z, g_v, 97, 121))) goto lab0;
292
+ break;
293
+ lab0:
294
+ if (z->c <= z->lb) return 0;
295
+ z->c--; /* gopast, line 38 */
296
+ }
297
+ z->c = z->l - m_test;
298
+ }
299
+ { int ret;
300
+ ret = slice_del(z); /* delete, line 38 */
301
+ if (ret < 0) return ret;
302
+ }
303
+ { int m_test = z->l - z->c; /* test, line 39 */
304
+ among_var = find_among_b(z, a_1, 13); /* substring, line 39 */
305
+ if (!(among_var)) return 0;
306
+ z->c = z->l - m_test;
307
+ }
308
+ switch(among_var) {
309
+ case 0: return 0;
310
+ case 1:
311
+ { int ret;
312
+ { int c = z->c;
313
+ ret = insert_s(z, z->c, z->c, 1, s_3); /* <+, line 41 */
314
+ z->c = c;
315
+ }
316
+ if (ret < 0) return ret;
317
+ }
318
+ break;
319
+ case 2:
320
+ z->ket = z->c; /* [, line 44 */
321
+ if (z->c <= z->lb) return 0;
322
+ z->c--; /* next, line 44 */
323
+ z->bra = z->c; /* ], line 44 */
324
+ { int ret;
325
+ ret = slice_del(z); /* delete, line 44 */
326
+ if (ret < 0) return ret;
327
+ }
328
+ break;
329
+ case 3:
330
+ if (z->c != z->I[0]) return 0; /* atmark, line 45 */
331
+ { int m_test = z->l - z->c; /* test, line 45 */
332
+ { int ret = r_shortv(z);
333
+ if (ret == 0) return 0; /* call shortv, line 45 */
334
+ if (ret < 0) return ret;
335
+ }
336
+ z->c = z->l - m_test;
337
+ }
338
+ { int ret;
339
+ { int c = z->c;
340
+ ret = insert_s(z, z->c, z->c, 1, s_4); /* <+, line 45 */
341
+ z->c = c;
342
+ }
343
+ if (ret < 0) return ret;
344
+ }
345
+ break;
346
+ }
347
+ break;
348
+ }
349
+ return 1;
350
+ }
351
+
352
+ static int r_Step_1c(struct SN_env * z) {
353
+ z->ket = z->c; /* [, line 52 */
354
+ { int m = z->l - z->c; (void) m; /* or, line 52 */
355
+ if (!(eq_s_b(z, 1, s_5))) goto lab1;
356
+ goto lab0;
357
+ lab1:
358
+ z->c = z->l - m;
359
+ if (!(eq_s_b(z, 1, s_6))) return 0;
360
+ }
361
+ lab0:
362
+ z->bra = z->c; /* ], line 52 */
363
+ while(1) { /* gopast, line 53 */
364
+ if (!(in_grouping_b(z, g_v, 97, 121))) goto lab2;
365
+ break;
366
+ lab2:
367
+ if (z->c <= z->lb) return 0;
368
+ z->c--; /* gopast, line 53 */
369
+ }
370
+ { int ret;
371
+ ret = slice_from_s(z, 1, s_7); /* <-, line 54 */
372
+ if (ret < 0) return ret;
373
+ }
374
+ return 1;
375
+ }
376
+
377
+ static int r_Step_2(struct SN_env * z) {
378
+ int among_var;
379
+ z->ket = z->c; /* [, line 58 */
380
+ among_var = find_among_b(z, a_3, 20); /* substring, line 58 */
381
+ if (!(among_var)) return 0;
382
+ z->bra = z->c; /* ], line 58 */
383
+ { int ret = r_R1(z);
384
+ if (ret == 0) return 0; /* call R1, line 58 */
385
+ if (ret < 0) return ret;
386
+ }
387
+ switch(among_var) {
388
+ case 0: return 0;
389
+ case 1:
390
+ { int ret;
391
+ ret = slice_from_s(z, 4, s_8); /* <-, line 59 */
392
+ if (ret < 0) return ret;
393
+ }
394
+ break;
395
+ case 2:
396
+ { int ret;
397
+ ret = slice_from_s(z, 4, s_9); /* <-, line 60 */
398
+ if (ret < 0) return ret;
399
+ }
400
+ break;
401
+ case 3:
402
+ { int ret;
403
+ ret = slice_from_s(z, 4, s_10); /* <-, line 61 */
404
+ if (ret < 0) return ret;
405
+ }
406
+ break;
407
+ case 4:
408
+ { int ret;
409
+ ret = slice_from_s(z, 4, s_11); /* <-, line 62 */
410
+ if (ret < 0) return ret;
411
+ }
412
+ break;
413
+ case 5:
414
+ { int ret;
415
+ ret = slice_from_s(z, 3, s_12); /* <-, line 63 */
416
+ if (ret < 0) return ret;
417
+ }
418
+ break;
419
+ case 6:
420
+ { int ret;
421
+ ret = slice_from_s(z, 1, s_13); /* <-, line 64 */
422
+ if (ret < 0) return ret;
423
+ }
424
+ break;
425
+ case 7:
426
+ { int ret;
427
+ ret = slice_from_s(z, 3, s_14); /* <-, line 66 */
428
+ if (ret < 0) return ret;
429
+ }
430
+ break;
431
+ case 8:
432
+ { int ret;
433
+ ret = slice_from_s(z, 3, s_15); /* <-, line 68 */
434
+ if (ret < 0) return ret;
435
+ }
436
+ break;
437
+ case 9:
438
+ { int ret;
439
+ ret = slice_from_s(z, 2, s_16); /* <-, line 69 */
440
+ if (ret < 0) return ret;
441
+ }
442
+ break;
443
+ case 10:
444
+ { int ret;
445
+ ret = slice_from_s(z, 2, s_17); /* <-, line 71 */
446
+ if (ret < 0) return ret;
447
+ }
448
+ break;
449
+ case 11:
450
+ { int ret;
451
+ ret = slice_from_s(z, 3, s_18); /* <-, line 72 */
452
+ if (ret < 0) return ret;
453
+ }
454
+ break;
455
+ case 12:
456
+ { int ret;
457
+ ret = slice_from_s(z, 3, s_19); /* <-, line 74 */
458
+ if (ret < 0) return ret;
459
+ }
460
+ break;
461
+ case 13:
462
+ { int ret;
463
+ ret = slice_from_s(z, 3, s_20); /* <-, line 76 */
464
+ if (ret < 0) return ret;
465
+ }
466
+ break;
467
+ case 14:
468
+ { int ret;
469
+ ret = slice_from_s(z, 3, s_21); /* <-, line 77 */
470
+ if (ret < 0) return ret;
471
+ }
472
+ break;
473
+ }
474
+ return 1;
475
+ }
476
+
477
+ static int r_Step_3(struct SN_env * z) {
478
+ int among_var;
479
+ z->ket = z->c; /* [, line 82 */
480
+ among_var = find_among_b(z, a_4, 7); /* substring, line 82 */
481
+ if (!(among_var)) return 0;
482
+ z->bra = z->c; /* ], line 82 */
483
+ { int ret = r_R1(z);
484
+ if (ret == 0) return 0; /* call R1, line 82 */
485
+ if (ret < 0) return ret;
486
+ }
487
+ switch(among_var) {
488
+ case 0: return 0;
489
+ case 1:
490
+ { int ret;
491
+ ret = slice_from_s(z, 2, s_22); /* <-, line 83 */
492
+ if (ret < 0) return ret;
493
+ }
494
+ break;
495
+ case 2:
496
+ { int ret;
497
+ ret = slice_from_s(z, 2, s_23); /* <-, line 85 */
498
+ if (ret < 0) return ret;
499
+ }
500
+ break;
501
+ case 3:
502
+ { int ret;
503
+ ret = slice_del(z); /* delete, line 87 */
504
+ if (ret < 0) return ret;
505
+ }
506
+ break;
507
+ }
508
+ return 1;
509
+ }
510
+
511
+ static int r_Step_4(struct SN_env * z) {
512
+ int among_var;
513
+ z->ket = z->c; /* [, line 92 */
514
+ among_var = find_among_b(z, a_5, 19); /* substring, line 92 */
515
+ if (!(among_var)) return 0;
516
+ z->bra = z->c; /* ], line 92 */
517
+ { int ret = r_R2(z);
518
+ if (ret == 0) return 0; /* call R2, line 92 */
519
+ if (ret < 0) return ret;
520
+ }
521
+ switch(among_var) {
522
+ case 0: return 0;
523
+ case 1:
524
+ { int ret;
525
+ ret = slice_del(z); /* delete, line 95 */
526
+ if (ret < 0) return ret;
527
+ }
528
+ break;
529
+ case 2:
530
+ { int m = z->l - z->c; (void) m; /* or, line 96 */
531
+ if (!(eq_s_b(z, 1, s_24))) goto lab1;
532
+ goto lab0;
533
+ lab1:
534
+ z->c = z->l - m;
535
+ if (!(eq_s_b(z, 1, s_25))) return 0;
536
+ }
537
+ lab0:
538
+ { int ret;
539
+ ret = slice_del(z); /* delete, line 96 */
540
+ if (ret < 0) return ret;
541
+ }
542
+ break;
543
+ }
544
+ return 1;
545
+ }
546
+
547
+ static int r_Step_5a(struct SN_env * z) {
548
+ z->ket = z->c; /* [, line 101 */
549
+ if (!(eq_s_b(z, 1, s_26))) return 0;
550
+ z->bra = z->c; /* ], line 101 */
551
+ { int m = z->l - z->c; (void) m; /* or, line 102 */
552
+ { int ret = r_R2(z);
553
+ if (ret == 0) goto lab1; /* call R2, line 102 */
554
+ if (ret < 0) return ret;
555
+ }
556
+ goto lab0;
557
+ lab1:
558
+ z->c = z->l - m;
559
+ { int ret = r_R1(z);
560
+ if (ret == 0) return 0; /* call R1, line 102 */
561
+ if (ret < 0) return ret;
562
+ }
563
+ { int m = z->l - z->c; (void) m; /* not, line 102 */
564
+ { int ret = r_shortv(z);
565
+ if (ret == 0) goto lab2; /* call shortv, line 102 */
566
+ if (ret < 0) return ret;
567
+ }
568
+ return 0;
569
+ lab2:
570
+ z->c = z->l - m;
571
+ }
572
+ }
573
+ lab0:
574
+ { int ret;
575
+ ret = slice_del(z); /* delete, line 103 */
576
+ if (ret < 0) return ret;
577
+ }
578
+ return 1;
579
+ }
580
+
581
+ static int r_Step_5b(struct SN_env * z) {
582
+ z->ket = z->c; /* [, line 107 */
583
+ if (!(eq_s_b(z, 1, s_27))) return 0;
584
+ z->bra = z->c; /* ], line 107 */
585
+ { int ret = r_R2(z);
586
+ if (ret == 0) return 0; /* call R2, line 108 */
587
+ if (ret < 0) return ret;
588
+ }
589
+ if (!(eq_s_b(z, 1, s_28))) return 0;
590
+ { int ret;
591
+ ret = slice_del(z); /* delete, line 109 */
592
+ if (ret < 0) return ret;
593
+ }
594
+ return 1;
595
+ }
596
+
597
+ extern int porter_ISO_8859_1_stem(struct SN_env * z) {
598
+ z->B[0] = 0; /* unset Y_found, line 115 */
599
+ { int c = z->c; /* do, line 116 */
600
+ z->bra = z->c; /* [, line 116 */
601
+ if (!(eq_s(z, 1, s_29))) goto lab0;
602
+ z->ket = z->c; /* ], line 116 */
603
+ { int ret;
604
+ ret = slice_from_s(z, 1, s_30); /* <-, line 116 */
605
+ if (ret < 0) return ret;
606
+ }
607
+ z->B[0] = 1; /* set Y_found, line 116 */
608
+ lab0:
609
+ z->c = c;
610
+ }
611
+ { int c = z->c; /* do, line 117 */
612
+ while(1) { /* repeat, line 117 */
613
+ int c = z->c;
614
+ while(1) { /* goto, line 117 */
615
+ int c = z->c;
616
+ if (!(in_grouping(z, g_v, 97, 121))) goto lab3;
617
+ z->bra = z->c; /* [, line 117 */
618
+ if (!(eq_s(z, 1, s_31))) goto lab3;
619
+ z->ket = z->c; /* ], line 117 */
620
+ z->c = c;
621
+ break;
622
+ lab3:
623
+ z->c = c;
624
+ if (z->c >= z->l) goto lab2;
625
+ z->c++; /* goto, line 117 */
626
+ }
627
+ { int ret;
628
+ ret = slice_from_s(z, 1, s_32); /* <-, line 117 */
629
+ if (ret < 0) return ret;
630
+ }
631
+ z->B[0] = 1; /* set Y_found, line 117 */
632
+ continue;
633
+ lab2:
634
+ z->c = c;
635
+ break;
636
+ }
637
+ z->c = c;
638
+ }
639
+ z->I[0] = z->l;
640
+ z->I[1] = z->l;
641
+ { int c = z->c; /* do, line 121 */
642
+ while(1) { /* gopast, line 122 */
643
+ if (!(in_grouping(z, g_v, 97, 121))) goto lab5;
644
+ break;
645
+ lab5:
646
+ if (z->c >= z->l) goto lab4;
647
+ z->c++; /* gopast, line 122 */
648
+ }
649
+ while(1) { /* gopast, line 122 */
650
+ if (!(out_grouping(z, g_v, 97, 121))) goto lab6;
651
+ break;
652
+ lab6:
653
+ if (z->c >= z->l) goto lab4;
654
+ z->c++; /* gopast, line 122 */
655
+ }
656
+ z->I[0] = z->c; /* setmark p1, line 122 */
657
+ while(1) { /* gopast, line 123 */
658
+ if (!(in_grouping(z, g_v, 97, 121))) goto lab7;
659
+ break;
660
+ lab7:
661
+ if (z->c >= z->l) goto lab4;
662
+ z->c++; /* gopast, line 123 */
663
+ }
664
+ while(1) { /* gopast, line 123 */
665
+ if (!(out_grouping(z, g_v, 97, 121))) goto lab8;
666
+ break;
667
+ lab8:
668
+ if (z->c >= z->l) goto lab4;
669
+ z->c++; /* gopast, line 123 */
670
+ }
671
+ z->I[1] = z->c; /* setmark p2, line 123 */
672
+ lab4:
673
+ z->c = c;
674
+ }
675
+ z->lb = z->c; z->c = z->l; /* backwards, line 126 */
676
+
677
+ { int m = z->l - z->c; (void) m; /* do, line 127 */
678
+ { int ret = r_Step_1a(z);
679
+ if (ret == 0) goto lab9; /* call Step_1a, line 127 */
680
+ if (ret < 0) return ret;
681
+ }
682
+ lab9:
683
+ z->c = z->l - m;
684
+ }
685
+ { int m = z->l - z->c; (void) m; /* do, line 128 */
686
+ { int ret = r_Step_1b(z);
687
+ if (ret == 0) goto lab10; /* call Step_1b, line 128 */
688
+ if (ret < 0) return ret;
689
+ }
690
+ lab10:
691
+ z->c = z->l - m;
692
+ }
693
+ { int m = z->l - z->c; (void) m; /* do, line 129 */
694
+ { int ret = r_Step_1c(z);
695
+ if (ret == 0) goto lab11; /* call Step_1c, line 129 */
696
+ if (ret < 0) return ret;
697
+ }
698
+ lab11:
699
+ z->c = z->l - m;
700
+ }
701
+ { int m = z->l - z->c; (void) m; /* do, line 130 */
702
+ { int ret = r_Step_2(z);
703
+ if (ret == 0) goto lab12; /* call Step_2, line 130 */
704
+ if (ret < 0) return ret;
705
+ }
706
+ lab12:
707
+ z->c = z->l - m;
708
+ }
709
+ { int m = z->l - z->c; (void) m; /* do, line 131 */
710
+ { int ret = r_Step_3(z);
711
+ if (ret == 0) goto lab13; /* call Step_3, line 131 */
712
+ if (ret < 0) return ret;
713
+ }
714
+ lab13:
715
+ z->c = z->l - m;
716
+ }
717
+ { int m = z->l - z->c; (void) m; /* do, line 132 */
718
+ { int ret = r_Step_4(z);
719
+ if (ret == 0) goto lab14; /* call Step_4, line 132 */
720
+ if (ret < 0) return ret;
721
+ }
722
+ lab14:
723
+ z->c = z->l - m;
724
+ }
725
+ { int m = z->l - z->c; (void) m; /* do, line 133 */
726
+ { int ret = r_Step_5a(z);
727
+ if (ret == 0) goto lab15; /* call Step_5a, line 133 */
728
+ if (ret < 0) return ret;
729
+ }
730
+ lab15:
731
+ z->c = z->l - m;
732
+ }
733
+ { int m = z->l - z->c; (void) m; /* do, line 134 */
734
+ { int ret = r_Step_5b(z);
735
+ if (ret == 0) goto lab16; /* call Step_5b, line 134 */
736
+ if (ret < 0) return ret;
737
+ }
738
+ lab16:
739
+ z->c = z->l - m;
740
+ }
741
+ z->c = z->lb;
742
+ { int c = z->c; /* do, line 137 */
743
+ if (!(z->B[0])) goto lab17; /* Boolean test Y_found, line 137 */
744
+ while(1) { /* repeat, line 137 */
745
+ int c = z->c;
746
+ while(1) { /* goto, line 137 */
747
+ int c = z->c;
748
+ z->bra = z->c; /* [, line 137 */
749
+ if (!(eq_s(z, 1, s_33))) goto lab19;
750
+ z->ket = z->c; /* ], line 137 */
751
+ z->c = c;
752
+ break;
753
+ lab19:
754
+ z->c = c;
755
+ if (z->c >= z->l) goto lab18;
756
+ z->c++; /* goto, line 137 */
757
+ }
758
+ { int ret;
759
+ ret = slice_from_s(z, 1, s_34); /* <-, line 137 */
760
+ if (ret < 0) return ret;
761
+ }
762
+ continue;
763
+ lab18:
764
+ z->c = c;
765
+ break;
766
+ }
767
+ lab17:
768
+ z->c = c;
769
+ }
770
+ return 1;
771
+ }
772
+
773
+ extern struct SN_env * porter_ISO_8859_1_create_env(void) { return SN_create_env(0, 2, 1); }
774
+
775
+ extern void porter_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z); }
776
+