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 * spanish_ISO_8859_1_create_env(void);
9
+ extern void spanish_ISO_8859_1_close_env(struct SN_env * z);
10
+
11
+ extern int spanish_ISO_8859_1_stem(struct SN_env * z);
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif
16
+
@@ -0,0 +1,307 @@
1
+
2
+ /* This file was generated automatically by the Snowball to ANSI C compiler */
3
+
4
+ #include "header.h"
5
+
6
+ extern int swedish_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 * swedish_ISO_8859_1_create_env(void);
13
+ extern void swedish_ISO_8859_1_close_env(struct SN_env * z);
14
+
15
+ static symbol s_0_0[1] = { 'a' };
16
+ static symbol s_0_1[4] = { 'a', 'r', 'n', 'a' };
17
+ static symbol s_0_2[4] = { 'e', 'r', 'n', 'a' };
18
+ static symbol s_0_3[7] = { 'h', 'e', 't', 'e', 'r', 'n', 'a' };
19
+ static symbol s_0_4[4] = { 'o', 'r', 'n', 'a' };
20
+ static symbol s_0_5[2] = { 'a', 'd' };
21
+ static symbol s_0_6[1] = { 'e' };
22
+ static symbol s_0_7[3] = { 'a', 'd', 'e' };
23
+ static symbol s_0_8[4] = { 'a', 'n', 'd', 'e' };
24
+ static symbol s_0_9[4] = { 'a', 'r', 'n', 'e' };
25
+ static symbol s_0_10[3] = { 'a', 'r', 'e' };
26
+ static symbol s_0_11[4] = { 'a', 's', 't', 'e' };
27
+ static symbol s_0_12[2] = { 'e', 'n' };
28
+ static symbol s_0_13[5] = { 'a', 'n', 'd', 'e', 'n' };
29
+ static symbol s_0_14[4] = { 'a', 'r', 'e', 'n' };
30
+ static symbol s_0_15[5] = { 'h', 'e', 't', 'e', 'n' };
31
+ static symbol s_0_16[3] = { 'e', 'r', 'n' };
32
+ static symbol s_0_17[2] = { 'a', 'r' };
33
+ static symbol s_0_18[2] = { 'e', 'r' };
34
+ static symbol s_0_19[5] = { 'h', 'e', 't', 'e', 'r' };
35
+ static symbol s_0_20[2] = { 'o', 'r' };
36
+ static symbol s_0_21[1] = { 's' };
37
+ static symbol s_0_22[2] = { 'a', 's' };
38
+ static symbol s_0_23[5] = { 'a', 'r', 'n', 'a', 's' };
39
+ static symbol s_0_24[5] = { 'e', 'r', 'n', 'a', 's' };
40
+ static symbol s_0_25[5] = { 'o', 'r', 'n', 'a', 's' };
41
+ static symbol s_0_26[2] = { 'e', 's' };
42
+ static symbol s_0_27[4] = { 'a', 'd', 'e', 's' };
43
+ static symbol s_0_28[5] = { 'a', 'n', 'd', 'e', 's' };
44
+ static symbol s_0_29[3] = { 'e', 'n', 's' };
45
+ static symbol s_0_30[5] = { 'a', 'r', 'e', 'n', 's' };
46
+ static symbol s_0_31[6] = { 'h', 'e', 't', 'e', 'n', 's' };
47
+ static symbol s_0_32[4] = { 'e', 'r', 'n', 's' };
48
+ static symbol s_0_33[2] = { 'a', 't' };
49
+ static symbol s_0_34[5] = { 'a', 'n', 'd', 'e', 't' };
50
+ static symbol s_0_35[3] = { 'h', 'e', 't' };
51
+ static symbol s_0_36[3] = { 'a', 's', 't' };
52
+
53
+ static struct among a_0[37] =
54
+ {
55
+ /* 0 */ { 1, s_0_0, -1, 1, 0},
56
+ /* 1 */ { 4, s_0_1, 0, 1, 0},
57
+ /* 2 */ { 4, s_0_2, 0, 1, 0},
58
+ /* 3 */ { 7, s_0_3, 2, 1, 0},
59
+ /* 4 */ { 4, s_0_4, 0, 1, 0},
60
+ /* 5 */ { 2, s_0_5, -1, 1, 0},
61
+ /* 6 */ { 1, s_0_6, -1, 1, 0},
62
+ /* 7 */ { 3, s_0_7, 6, 1, 0},
63
+ /* 8 */ { 4, s_0_8, 6, 1, 0},
64
+ /* 9 */ { 4, s_0_9, 6, 1, 0},
65
+ /* 10 */ { 3, s_0_10, 6, 1, 0},
66
+ /* 11 */ { 4, s_0_11, 6, 1, 0},
67
+ /* 12 */ { 2, s_0_12, -1, 1, 0},
68
+ /* 13 */ { 5, s_0_13, 12, 1, 0},
69
+ /* 14 */ { 4, s_0_14, 12, 1, 0},
70
+ /* 15 */ { 5, s_0_15, 12, 1, 0},
71
+ /* 16 */ { 3, s_0_16, -1, 1, 0},
72
+ /* 17 */ { 2, s_0_17, -1, 1, 0},
73
+ /* 18 */ { 2, s_0_18, -1, 1, 0},
74
+ /* 19 */ { 5, s_0_19, 18, 1, 0},
75
+ /* 20 */ { 2, s_0_20, -1, 1, 0},
76
+ /* 21 */ { 1, s_0_21, -1, 2, 0},
77
+ /* 22 */ { 2, s_0_22, 21, 1, 0},
78
+ /* 23 */ { 5, s_0_23, 22, 1, 0},
79
+ /* 24 */ { 5, s_0_24, 22, 1, 0},
80
+ /* 25 */ { 5, s_0_25, 22, 1, 0},
81
+ /* 26 */ { 2, s_0_26, 21, 1, 0},
82
+ /* 27 */ { 4, s_0_27, 26, 1, 0},
83
+ /* 28 */ { 5, s_0_28, 26, 1, 0},
84
+ /* 29 */ { 3, s_0_29, 21, 1, 0},
85
+ /* 30 */ { 5, s_0_30, 29, 1, 0},
86
+ /* 31 */ { 6, s_0_31, 29, 1, 0},
87
+ /* 32 */ { 4, s_0_32, 21, 1, 0},
88
+ /* 33 */ { 2, s_0_33, -1, 1, 0},
89
+ /* 34 */ { 5, s_0_34, -1, 1, 0},
90
+ /* 35 */ { 3, s_0_35, -1, 1, 0},
91
+ /* 36 */ { 3, s_0_36, -1, 1, 0}
92
+ };
93
+
94
+ static symbol s_1_0[2] = { 'd', 'd' };
95
+ static symbol s_1_1[2] = { 'g', 'd' };
96
+ static symbol s_1_2[2] = { 'n', 'n' };
97
+ static symbol s_1_3[2] = { 'd', 't' };
98
+ static symbol s_1_4[2] = { 'g', 't' };
99
+ static symbol s_1_5[2] = { 'k', 't' };
100
+ static symbol s_1_6[2] = { 't', 't' };
101
+
102
+ static struct among a_1[7] =
103
+ {
104
+ /* 0 */ { 2, s_1_0, -1, -1, 0},
105
+ /* 1 */ { 2, s_1_1, -1, -1, 0},
106
+ /* 2 */ { 2, s_1_2, -1, -1, 0},
107
+ /* 3 */ { 2, s_1_3, -1, -1, 0},
108
+ /* 4 */ { 2, s_1_4, -1, -1, 0},
109
+ /* 5 */ { 2, s_1_5, -1, -1, 0},
110
+ /* 6 */ { 2, s_1_6, -1, -1, 0}
111
+ };
112
+
113
+ static symbol s_2_0[2] = { 'i', 'g' };
114
+ static symbol s_2_1[3] = { 'l', 'i', 'g' };
115
+ static symbol s_2_2[3] = { 'e', 'l', 's' };
116
+ static symbol s_2_3[5] = { 'f', 'u', 'l', 'l', 't' };
117
+ static symbol s_2_4[4] = { 'l', 0xF6, 's', 't' };
118
+
119
+ static struct among a_2[5] =
120
+ {
121
+ /* 0 */ { 2, s_2_0, -1, 1, 0},
122
+ /* 1 */ { 3, s_2_1, 0, 1, 0},
123
+ /* 2 */ { 3, s_2_2, -1, 1, 0},
124
+ /* 3 */ { 5, s_2_3, -1, 3, 0},
125
+ /* 4 */ { 4, s_2_4, -1, 2, 0}
126
+ };
127
+
128
+ static unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32 };
129
+
130
+ static unsigned char g_s_ending[] = { 119, 127, 149 };
131
+
132
+ static symbol s_0[] = { 'l', 0xF6, 's' };
133
+ static symbol s_1[] = { 'f', 'u', 'l', 'l' };
134
+
135
+ static int r_mark_regions(struct SN_env * z) {
136
+ z->I[0] = z->l;
137
+ { int c_test = z->c; /* test, line 29 */
138
+ { int c = z->c + 3;
139
+ if (0 > c || c > z->l) return 0;
140
+ z->c = c; /* hop, line 29 */
141
+ }
142
+ z->I[1] = z->c; /* setmark x, line 29 */
143
+ z->c = c_test;
144
+ }
145
+ while(1) { /* goto, line 30 */
146
+ int c = z->c;
147
+ if (!(in_grouping(z, g_v, 97, 246))) goto lab0;
148
+ z->c = c;
149
+ break;
150
+ lab0:
151
+ z->c = c;
152
+ if (z->c >= z->l) return 0;
153
+ z->c++; /* goto, line 30 */
154
+ }
155
+ while(1) { /* gopast, line 30 */
156
+ if (!(out_grouping(z, g_v, 97, 246))) goto lab1;
157
+ break;
158
+ lab1:
159
+ if (z->c >= z->l) return 0;
160
+ z->c++; /* gopast, line 30 */
161
+ }
162
+ z->I[0] = z->c; /* setmark p1, line 30 */
163
+ /* try, line 31 */
164
+ if (!(z->I[0] < z->I[1])) goto lab2;
165
+ z->I[0] = z->I[1];
166
+ lab2:
167
+ return 1;
168
+ }
169
+
170
+ static int r_main_suffix(struct SN_env * z) {
171
+ int among_var;
172
+ { int m3; /* setlimit, line 37 */
173
+ int m = z->l - z->c; (void) m;
174
+ if (z->c < z->I[0]) return 0;
175
+ z->c = z->I[0]; /* tomark, line 37 */
176
+ m3 = z->lb; z->lb = z->c;
177
+ z->c = z->l - m;
178
+ z->ket = z->c; /* [, line 37 */
179
+ among_var = find_among_b(z, a_0, 37); /* substring, line 37 */
180
+ if (!(among_var)) { z->lb = m3; return 0; }
181
+ z->bra = z->c; /* ], line 37 */
182
+ z->lb = m3;
183
+ }
184
+ switch(among_var) {
185
+ case 0: return 0;
186
+ case 1:
187
+ { int ret;
188
+ ret = slice_del(z); /* delete, line 44 */
189
+ if (ret < 0) return ret;
190
+ }
191
+ break;
192
+ case 2:
193
+ if (!(in_grouping_b(z, g_s_ending, 98, 121))) return 0;
194
+ { int ret;
195
+ ret = slice_del(z); /* delete, line 46 */
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 m3; /* setlimit, line 50 */
205
+ int m = z->l - z->c; (void) m;
206
+ if (z->c < z->I[0]) return 0;
207
+ z->c = z->I[0]; /* tomark, line 50 */
208
+ m3 = z->lb; z->lb = z->c;
209
+ z->c = z->l - m;
210
+ { int m = z->l - z->c; (void) m; /* and, line 52 */
211
+ if (!(find_among_b(z, a_1, 7))) { z->lb = m3; return 0; } /* among, line 51 */
212
+ z->c = z->l - m;
213
+ z->ket = z->c; /* [, line 52 */
214
+ if (z->c <= z->lb) { z->lb = m3; return 0; }
215
+ z->c--; /* next, line 52 */
216
+ z->bra = z->c; /* ], line 52 */
217
+ { int ret;
218
+ ret = slice_del(z); /* delete, line 52 */
219
+ if (ret < 0) return ret;
220
+ }
221
+ }
222
+ z->lb = m3;
223
+ }
224
+ return 1;
225
+ }
226
+
227
+ static int r_other_suffix(struct SN_env * z) {
228
+ int among_var;
229
+ { int m3; /* setlimit, line 55 */
230
+ int m = z->l - z->c; (void) m;
231
+ if (z->c < z->I[0]) return 0;
232
+ z->c = z->I[0]; /* tomark, line 55 */
233
+ m3 = z->lb; z->lb = z->c;
234
+ z->c = z->l - m;
235
+ z->ket = z->c; /* [, line 56 */
236
+ among_var = find_among_b(z, a_2, 5); /* substring, line 56 */
237
+ if (!(among_var)) { z->lb = m3; return 0; }
238
+ z->bra = z->c; /* ], line 56 */
239
+ switch(among_var) {
240
+ case 0: { z->lb = m3; return 0; }
241
+ case 1:
242
+ { int ret;
243
+ ret = slice_del(z); /* delete, line 57 */
244
+ if (ret < 0) return ret;
245
+ }
246
+ break;
247
+ case 2:
248
+ { int ret;
249
+ ret = slice_from_s(z, 3, s_0); /* <-, line 58 */
250
+ if (ret < 0) return ret;
251
+ }
252
+ break;
253
+ case 3:
254
+ { int ret;
255
+ ret = slice_from_s(z, 4, s_1); /* <-, line 59 */
256
+ if (ret < 0) return ret;
257
+ }
258
+ break;
259
+ }
260
+ z->lb = m3;
261
+ }
262
+ return 1;
263
+ }
264
+
265
+ extern int swedish_ISO_8859_1_stem(struct SN_env * z) {
266
+ { int c = z->c; /* do, line 66 */
267
+ { int ret = r_mark_regions(z);
268
+ if (ret == 0) goto lab0; /* call mark_regions, line 66 */
269
+ if (ret < 0) return ret;
270
+ }
271
+ lab0:
272
+ z->c = c;
273
+ }
274
+ z->lb = z->c; z->c = z->l; /* backwards, line 67 */
275
+
276
+ { int m = z->l - z->c; (void) m; /* do, line 68 */
277
+ { int ret = r_main_suffix(z);
278
+ if (ret == 0) goto lab1; /* call main_suffix, line 68 */
279
+ if (ret < 0) return ret;
280
+ }
281
+ lab1:
282
+ z->c = z->l - m;
283
+ }
284
+ { int m = z->l - z->c; (void) m; /* do, line 69 */
285
+ { int ret = r_consonant_pair(z);
286
+ if (ret == 0) goto lab2; /* call consonant_pair, line 69 */
287
+ if (ret < 0) return ret;
288
+ }
289
+ lab2:
290
+ z->c = z->l - m;
291
+ }
292
+ { int m = z->l - z->c; (void) m; /* do, line 70 */
293
+ { int ret = r_other_suffix(z);
294
+ if (ret == 0) goto lab3; /* call other_suffix, line 70 */
295
+ if (ret < 0) return ret;
296
+ }
297
+ lab3:
298
+ z->c = z->l - m;
299
+ }
300
+ z->c = z->lb;
301
+ return 1;
302
+ }
303
+
304
+ extern struct SN_env * swedish_ISO_8859_1_create_env(void) { return SN_create_env(0, 2, 0); }
305
+
306
+ extern void swedish_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z); }
307
+
@@ -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 * swedish_ISO_8859_1_create_env(void);
9
+ extern void swedish_ISO_8859_1_close_env(struct SN_env * z);
10
+
11
+ extern int swedish_ISO_8859_1_stem(struct SN_env * z);
12
+
13
+ #ifdef __cplusplus
14
+ }
15
+ #endif
16
+
@@ -0,0 +1,701 @@
1
+
2
+ /* This file was generated automatically by the Snowball to ANSI C compiler */
3
+
4
+ #include "header.h"
5
+
6
+ extern int russian_KOI8_R_stem(struct SN_env * z);
7
+ static int r_tidy_up(struct SN_env * z);
8
+ static int r_derivational(struct SN_env * z);
9
+ static int r_noun(struct SN_env * z);
10
+ static int r_verb(struct SN_env * z);
11
+ static int r_reflexive(struct SN_env * z);
12
+ static int r_adjectival(struct SN_env * z);
13
+ static int r_adjective(struct SN_env * z);
14
+ static int r_perfective_gerund(struct SN_env * z);
15
+ static int r_R2(struct SN_env * z);
16
+ static int r_mark_regions(struct SN_env * z);
17
+
18
+ extern struct SN_env * russian_KOI8_R_create_env(void);
19
+ extern void russian_KOI8_R_close_env(struct SN_env * z);
20
+
21
+ static symbol s_0_0[3] = { 0xD7, 0xDB, 0xC9 };
22
+ static symbol s_0_1[4] = { 0xC9, 0xD7, 0xDB, 0xC9 };
23
+ static symbol s_0_2[4] = { 0xD9, 0xD7, 0xDB, 0xC9 };
24
+ static symbol s_0_3[1] = { 0xD7 };
25
+ static symbol s_0_4[2] = { 0xC9, 0xD7 };
26
+ static symbol s_0_5[2] = { 0xD9, 0xD7 };
27
+ static symbol s_0_6[5] = { 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
28
+ static symbol s_0_7[6] = { 0xC9, 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
29
+ static symbol s_0_8[6] = { 0xD9, 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
30
+
31
+ static struct among a_0[9] =
32
+ {
33
+ /* 0 */ { 3, s_0_0, -1, 1, 0},
34
+ /* 1 */ { 4, s_0_1, 0, 2, 0},
35
+ /* 2 */ { 4, s_0_2, 0, 2, 0},
36
+ /* 3 */ { 1, s_0_3, -1, 1, 0},
37
+ /* 4 */ { 2, s_0_4, 3, 2, 0},
38
+ /* 5 */ { 2, s_0_5, 3, 2, 0},
39
+ /* 6 */ { 5, s_0_6, -1, 1, 0},
40
+ /* 7 */ { 6, s_0_7, 6, 2, 0},
41
+ /* 8 */ { 6, s_0_8, 6, 2, 0}
42
+ };
43
+
44
+ static symbol s_1_0[2] = { 0xC0, 0xC0 };
45
+ static symbol s_1_1[2] = { 0xC5, 0xC0 };
46
+ static symbol s_1_2[2] = { 0xCF, 0xC0 };
47
+ static symbol s_1_3[2] = { 0xD5, 0xC0 };
48
+ static symbol s_1_4[2] = { 0xC5, 0xC5 };
49
+ static symbol s_1_5[2] = { 0xC9, 0xC5 };
50
+ static symbol s_1_6[2] = { 0xCF, 0xC5 };
51
+ static symbol s_1_7[2] = { 0xD9, 0xC5 };
52
+ static symbol s_1_8[2] = { 0xC9, 0xC8 };
53
+ static symbol s_1_9[2] = { 0xD9, 0xC8 };
54
+ static symbol s_1_10[3] = { 0xC9, 0xCD, 0xC9 };
55
+ static symbol s_1_11[3] = { 0xD9, 0xCD, 0xC9 };
56
+ static symbol s_1_12[2] = { 0xC5, 0xCA };
57
+ static symbol s_1_13[2] = { 0xC9, 0xCA };
58
+ static symbol s_1_14[2] = { 0xCF, 0xCA };
59
+ static symbol s_1_15[2] = { 0xD9, 0xCA };
60
+ static symbol s_1_16[2] = { 0xC5, 0xCD };
61
+ static symbol s_1_17[2] = { 0xC9, 0xCD };
62
+ static symbol s_1_18[2] = { 0xCF, 0xCD };
63
+ static symbol s_1_19[2] = { 0xD9, 0xCD };
64
+ static symbol s_1_20[3] = { 0xC5, 0xC7, 0xCF };
65
+ static symbol s_1_21[3] = { 0xCF, 0xC7, 0xCF };
66
+ static symbol s_1_22[2] = { 0xC1, 0xD1 };
67
+ static symbol s_1_23[2] = { 0xD1, 0xD1 };
68
+ static symbol s_1_24[3] = { 0xC5, 0xCD, 0xD5 };
69
+ static symbol s_1_25[3] = { 0xCF, 0xCD, 0xD5 };
70
+
71
+ static struct among a_1[26] =
72
+ {
73
+ /* 0 */ { 2, s_1_0, -1, 1, 0},
74
+ /* 1 */ { 2, s_1_1, -1, 1, 0},
75
+ /* 2 */ { 2, s_1_2, -1, 1, 0},
76
+ /* 3 */ { 2, s_1_3, -1, 1, 0},
77
+ /* 4 */ { 2, s_1_4, -1, 1, 0},
78
+ /* 5 */ { 2, s_1_5, -1, 1, 0},
79
+ /* 6 */ { 2, s_1_6, -1, 1, 0},
80
+ /* 7 */ { 2, s_1_7, -1, 1, 0},
81
+ /* 8 */ { 2, s_1_8, -1, 1, 0},
82
+ /* 9 */ { 2, s_1_9, -1, 1, 0},
83
+ /* 10 */ { 3, s_1_10, -1, 1, 0},
84
+ /* 11 */ { 3, s_1_11, -1, 1, 0},
85
+ /* 12 */ { 2, s_1_12, -1, 1, 0},
86
+ /* 13 */ { 2, s_1_13, -1, 1, 0},
87
+ /* 14 */ { 2, s_1_14, -1, 1, 0},
88
+ /* 15 */ { 2, s_1_15, -1, 1, 0},
89
+ /* 16 */ { 2, s_1_16, -1, 1, 0},
90
+ /* 17 */ { 2, s_1_17, -1, 1, 0},
91
+ /* 18 */ { 2, s_1_18, -1, 1, 0},
92
+ /* 19 */ { 2, s_1_19, -1, 1, 0},
93
+ /* 20 */ { 3, s_1_20, -1, 1, 0},
94
+ /* 21 */ { 3, s_1_21, -1, 1, 0},
95
+ /* 22 */ { 2, s_1_22, -1, 1, 0},
96
+ /* 23 */ { 2, s_1_23, -1, 1, 0},
97
+ /* 24 */ { 3, s_1_24, -1, 1, 0},
98
+ /* 25 */ { 3, s_1_25, -1, 1, 0}
99
+ };
100
+
101
+ static symbol s_2_0[2] = { 0xC5, 0xCD };
102
+ static symbol s_2_1[2] = { 0xCE, 0xCE };
103
+ static symbol s_2_2[2] = { 0xD7, 0xDB };
104
+ static symbol s_2_3[3] = { 0xC9, 0xD7, 0xDB };
105
+ static symbol s_2_4[3] = { 0xD9, 0xD7, 0xDB };
106
+ static symbol s_2_5[1] = { 0xDD };
107
+ static symbol s_2_6[2] = { 0xC0, 0xDD };
108
+ static symbol s_2_7[3] = { 0xD5, 0xC0, 0xDD };
109
+
110
+ static struct among a_2[8] =
111
+ {
112
+ /* 0 */ { 2, s_2_0, -1, 1, 0},
113
+ /* 1 */ { 2, s_2_1, -1, 1, 0},
114
+ /* 2 */ { 2, s_2_2, -1, 1, 0},
115
+ /* 3 */ { 3, s_2_3, 2, 2, 0},
116
+ /* 4 */ { 3, s_2_4, 2, 2, 0},
117
+ /* 5 */ { 1, s_2_5, -1, 1, 0},
118
+ /* 6 */ { 2, s_2_6, 5, 1, 0},
119
+ /* 7 */ { 3, s_2_7, 6, 2, 0}
120
+ };
121
+
122
+ static symbol s_3_0[2] = { 0xD3, 0xD1 };
123
+ static symbol s_3_1[2] = { 0xD3, 0xD8 };
124
+
125
+ static struct among a_3[2] =
126
+ {
127
+ /* 0 */ { 2, s_3_0, -1, 1, 0},
128
+ /* 1 */ { 2, s_3_1, -1, 1, 0}
129
+ };
130
+
131
+ static symbol s_4_0[1] = { 0xC0 };
132
+ static symbol s_4_1[2] = { 0xD5, 0xC0 };
133
+ static symbol s_4_2[2] = { 0xCC, 0xC1 };
134
+ static symbol s_4_3[3] = { 0xC9, 0xCC, 0xC1 };
135
+ static symbol s_4_4[3] = { 0xD9, 0xCC, 0xC1 };
136
+ static symbol s_4_5[2] = { 0xCE, 0xC1 };
137
+ static symbol s_4_6[3] = { 0xC5, 0xCE, 0xC1 };
138
+ static symbol s_4_7[3] = { 0xC5, 0xD4, 0xC5 };
139
+ static symbol s_4_8[3] = { 0xC9, 0xD4, 0xC5 };
140
+ static symbol s_4_9[3] = { 0xCA, 0xD4, 0xC5 };
141
+ static symbol s_4_10[4] = { 0xC5, 0xCA, 0xD4, 0xC5 };
142
+ static symbol s_4_11[4] = { 0xD5, 0xCA, 0xD4, 0xC5 };
143
+ static symbol s_4_12[2] = { 0xCC, 0xC9 };
144
+ static symbol s_4_13[3] = { 0xC9, 0xCC, 0xC9 };
145
+ static symbol s_4_14[3] = { 0xD9, 0xCC, 0xC9 };
146
+ static symbol s_4_15[1] = { 0xCA };
147
+ static symbol s_4_16[2] = { 0xC5, 0xCA };
148
+ static symbol s_4_17[2] = { 0xD5, 0xCA };
149
+ static symbol s_4_18[1] = { 0xCC };
150
+ static symbol s_4_19[2] = { 0xC9, 0xCC };
151
+ static symbol s_4_20[2] = { 0xD9, 0xCC };
152
+ static symbol s_4_21[2] = { 0xC5, 0xCD };
153
+ static symbol s_4_22[2] = { 0xC9, 0xCD };
154
+ static symbol s_4_23[2] = { 0xD9, 0xCD };
155
+ static symbol s_4_24[1] = { 0xCE };
156
+ static symbol s_4_25[2] = { 0xC5, 0xCE };
157
+ static symbol s_4_26[2] = { 0xCC, 0xCF };
158
+ static symbol s_4_27[3] = { 0xC9, 0xCC, 0xCF };
159
+ static symbol s_4_28[3] = { 0xD9, 0xCC, 0xCF };
160
+ static symbol s_4_29[2] = { 0xCE, 0xCF };
161
+ static symbol s_4_30[3] = { 0xC5, 0xCE, 0xCF };
162
+ static symbol s_4_31[3] = { 0xCE, 0xCE, 0xCF };
163
+ static symbol s_4_32[2] = { 0xC0, 0xD4 };
164
+ static symbol s_4_33[3] = { 0xD5, 0xC0, 0xD4 };
165
+ static symbol s_4_34[2] = { 0xC5, 0xD4 };
166
+ static symbol s_4_35[3] = { 0xD5, 0xC5, 0xD4 };
167
+ static symbol s_4_36[2] = { 0xC9, 0xD4 };
168
+ static symbol s_4_37[2] = { 0xD1, 0xD4 };
169
+ static symbol s_4_38[2] = { 0xD9, 0xD4 };
170
+ static symbol s_4_39[2] = { 0xD4, 0xD8 };
171
+ static symbol s_4_40[3] = { 0xC9, 0xD4, 0xD8 };
172
+ static symbol s_4_41[3] = { 0xD9, 0xD4, 0xD8 };
173
+ static symbol s_4_42[3] = { 0xC5, 0xDB, 0xD8 };
174
+ static symbol s_4_43[3] = { 0xC9, 0xDB, 0xD8 };
175
+ static symbol s_4_44[2] = { 0xCE, 0xD9 };
176
+ static symbol s_4_45[3] = { 0xC5, 0xCE, 0xD9 };
177
+
178
+ static struct among a_4[46] =
179
+ {
180
+ /* 0 */ { 1, s_4_0, -1, 2, 0},
181
+ /* 1 */ { 2, s_4_1, 0, 2, 0},
182
+ /* 2 */ { 2, s_4_2, -1, 1, 0},
183
+ /* 3 */ { 3, s_4_3, 2, 2, 0},
184
+ /* 4 */ { 3, s_4_4, 2, 2, 0},
185
+ /* 5 */ { 2, s_4_5, -1, 1, 0},
186
+ /* 6 */ { 3, s_4_6, 5, 2, 0},
187
+ /* 7 */ { 3, s_4_7, -1, 1, 0},
188
+ /* 8 */ { 3, s_4_8, -1, 2, 0},
189
+ /* 9 */ { 3, s_4_9, -1, 1, 0},
190
+ /* 10 */ { 4, s_4_10, 9, 2, 0},
191
+ /* 11 */ { 4, s_4_11, 9, 2, 0},
192
+ /* 12 */ { 2, s_4_12, -1, 1, 0},
193
+ /* 13 */ { 3, s_4_13, 12, 2, 0},
194
+ /* 14 */ { 3, s_4_14, 12, 2, 0},
195
+ /* 15 */ { 1, s_4_15, -1, 1, 0},
196
+ /* 16 */ { 2, s_4_16, 15, 2, 0},
197
+ /* 17 */ { 2, s_4_17, 15, 2, 0},
198
+ /* 18 */ { 1, s_4_18, -1, 1, 0},
199
+ /* 19 */ { 2, s_4_19, 18, 2, 0},
200
+ /* 20 */ { 2, s_4_20, 18, 2, 0},
201
+ /* 21 */ { 2, s_4_21, -1, 1, 0},
202
+ /* 22 */ { 2, s_4_22, -1, 2, 0},
203
+ /* 23 */ { 2, s_4_23, -1, 2, 0},
204
+ /* 24 */ { 1, s_4_24, -1, 1, 0},
205
+ /* 25 */ { 2, s_4_25, 24, 2, 0},
206
+ /* 26 */ { 2, s_4_26, -1, 1, 0},
207
+ /* 27 */ { 3, s_4_27, 26, 2, 0},
208
+ /* 28 */ { 3, s_4_28, 26, 2, 0},
209
+ /* 29 */ { 2, s_4_29, -1, 1, 0},
210
+ /* 30 */ { 3, s_4_30, 29, 2, 0},
211
+ /* 31 */ { 3, s_4_31, 29, 1, 0},
212
+ /* 32 */ { 2, s_4_32, -1, 1, 0},
213
+ /* 33 */ { 3, s_4_33, 32, 2, 0},
214
+ /* 34 */ { 2, s_4_34, -1, 1, 0},
215
+ /* 35 */ { 3, s_4_35, 34, 2, 0},
216
+ /* 36 */ { 2, s_4_36, -1, 2, 0},
217
+ /* 37 */ { 2, s_4_37, -1, 2, 0},
218
+ /* 38 */ { 2, s_4_38, -1, 2, 0},
219
+ /* 39 */ { 2, s_4_39, -1, 1, 0},
220
+ /* 40 */ { 3, s_4_40, 39, 2, 0},
221
+ /* 41 */ { 3, s_4_41, 39, 2, 0},
222
+ /* 42 */ { 3, s_4_42, -1, 1, 0},
223
+ /* 43 */ { 3, s_4_43, -1, 2, 0},
224
+ /* 44 */ { 2, s_4_44, -1, 1, 0},
225
+ /* 45 */ { 3, s_4_45, 44, 2, 0}
226
+ };
227
+
228
+ static symbol s_5_0[1] = { 0xC0 };
229
+ static symbol s_5_1[2] = { 0xC9, 0xC0 };
230
+ static symbol s_5_2[2] = { 0xD8, 0xC0 };
231
+ static symbol s_5_3[1] = { 0xC1 };
232
+ static symbol s_5_4[1] = { 0xC5 };
233
+ static symbol s_5_5[2] = { 0xC9, 0xC5 };
234
+ static symbol s_5_6[2] = { 0xD8, 0xC5 };
235
+ static symbol s_5_7[2] = { 0xC1, 0xC8 };
236
+ static symbol s_5_8[2] = { 0xD1, 0xC8 };
237
+ static symbol s_5_9[3] = { 0xC9, 0xD1, 0xC8 };
238
+ static symbol s_5_10[1] = { 0xC9 };
239
+ static symbol s_5_11[2] = { 0xC5, 0xC9 };
240
+ static symbol s_5_12[2] = { 0xC9, 0xC9 };
241
+ static symbol s_5_13[3] = { 0xC1, 0xCD, 0xC9 };
242
+ static symbol s_5_14[3] = { 0xD1, 0xCD, 0xC9 };
243
+ static symbol s_5_15[4] = { 0xC9, 0xD1, 0xCD, 0xC9 };
244
+ static symbol s_5_16[1] = { 0xCA };
245
+ static symbol s_5_17[2] = { 0xC5, 0xCA };
246
+ static symbol s_5_18[3] = { 0xC9, 0xC5, 0xCA };
247
+ static symbol s_5_19[2] = { 0xC9, 0xCA };
248
+ static symbol s_5_20[2] = { 0xCF, 0xCA };
249
+ static symbol s_5_21[2] = { 0xC1, 0xCD };
250
+ static symbol s_5_22[2] = { 0xC5, 0xCD };
251
+ static symbol s_5_23[3] = { 0xC9, 0xC5, 0xCD };
252
+ static symbol s_5_24[2] = { 0xCF, 0xCD };
253
+ static symbol s_5_25[2] = { 0xD1, 0xCD };
254
+ static symbol s_5_26[3] = { 0xC9, 0xD1, 0xCD };
255
+ static symbol s_5_27[1] = { 0xCF };
256
+ static symbol s_5_28[1] = { 0xD1 };
257
+ static symbol s_5_29[2] = { 0xC9, 0xD1 };
258
+ static symbol s_5_30[2] = { 0xD8, 0xD1 };
259
+ static symbol s_5_31[1] = { 0xD5 };
260
+ static symbol s_5_32[2] = { 0xC5, 0xD7 };
261
+ static symbol s_5_33[2] = { 0xCF, 0xD7 };
262
+ static symbol s_5_34[1] = { 0xD8 };
263
+ static symbol s_5_35[1] = { 0xD9 };
264
+
265
+ static struct among a_5[36] =
266
+ {
267
+ /* 0 */ { 1, s_5_0, -1, 1, 0},
268
+ /* 1 */ { 2, s_5_1, 0, 1, 0},
269
+ /* 2 */ { 2, s_5_2, 0, 1, 0},
270
+ /* 3 */ { 1, s_5_3, -1, 1, 0},
271
+ /* 4 */ { 1, s_5_4, -1, 1, 0},
272
+ /* 5 */ { 2, s_5_5, 4, 1, 0},
273
+ /* 6 */ { 2, s_5_6, 4, 1, 0},
274
+ /* 7 */ { 2, s_5_7, -1, 1, 0},
275
+ /* 8 */ { 2, s_5_8, -1, 1, 0},
276
+ /* 9 */ { 3, s_5_9, 8, 1, 0},
277
+ /* 10 */ { 1, s_5_10, -1, 1, 0},
278
+ /* 11 */ { 2, s_5_11, 10, 1, 0},
279
+ /* 12 */ { 2, s_5_12, 10, 1, 0},
280
+ /* 13 */ { 3, s_5_13, 10, 1, 0},
281
+ /* 14 */ { 3, s_5_14, 10, 1, 0},
282
+ /* 15 */ { 4, s_5_15, 14, 1, 0},
283
+ /* 16 */ { 1, s_5_16, -1, 1, 0},
284
+ /* 17 */ { 2, s_5_17, 16, 1, 0},
285
+ /* 18 */ { 3, s_5_18, 17, 1, 0},
286
+ /* 19 */ { 2, s_5_19, 16, 1, 0},
287
+ /* 20 */ { 2, s_5_20, 16, 1, 0},
288
+ /* 21 */ { 2, s_5_21, -1, 1, 0},
289
+ /* 22 */ { 2, s_5_22, -1, 1, 0},
290
+ /* 23 */ { 3, s_5_23, 22, 1, 0},
291
+ /* 24 */ { 2, s_5_24, -1, 1, 0},
292
+ /* 25 */ { 2, s_5_25, -1, 1, 0},
293
+ /* 26 */ { 3, s_5_26, 25, 1, 0},
294
+ /* 27 */ { 1, s_5_27, -1, 1, 0},
295
+ /* 28 */ { 1, s_5_28, -1, 1, 0},
296
+ /* 29 */ { 2, s_5_29, 28, 1, 0},
297
+ /* 30 */ { 2, s_5_30, 28, 1, 0},
298
+ /* 31 */ { 1, s_5_31, -1, 1, 0},
299
+ /* 32 */ { 2, s_5_32, -1, 1, 0},
300
+ /* 33 */ { 2, s_5_33, -1, 1, 0},
301
+ /* 34 */ { 1, s_5_34, -1, 1, 0},
302
+ /* 35 */ { 1, s_5_35, -1, 1, 0}
303
+ };
304
+
305
+ static symbol s_6_0[3] = { 0xCF, 0xD3, 0xD4 };
306
+ static symbol s_6_1[4] = { 0xCF, 0xD3, 0xD4, 0xD8 };
307
+
308
+ static struct among a_6[2] =
309
+ {
310
+ /* 0 */ { 3, s_6_0, -1, 1, 0},
311
+ /* 1 */ { 4, s_6_1, -1, 1, 0}
312
+ };
313
+
314
+ static symbol s_7_0[4] = { 0xC5, 0xCA, 0xDB, 0xC5 };
315
+ static symbol s_7_1[1] = { 0xCE };
316
+ static symbol s_7_2[1] = { 0xD8 };
317
+ static symbol s_7_3[3] = { 0xC5, 0xCA, 0xDB };
318
+
319
+ static struct among a_7[4] =
320
+ {
321
+ /* 0 */ { 4, s_7_0, -1, 1, 0},
322
+ /* 1 */ { 1, s_7_1, -1, 2, 0},
323
+ /* 2 */ { 1, s_7_2, -1, 3, 0},
324
+ /* 3 */ { 3, s_7_3, -1, 1, 0}
325
+ };
326
+
327
+ static unsigned char g_v[] = { 35, 130, 34, 18 };
328
+
329
+ static symbol s_0[] = { 0xC1 };
330
+ static symbol s_1[] = { 0xD1 };
331
+ static symbol s_2[] = { 0xC1 };
332
+ static symbol s_3[] = { 0xD1 };
333
+ static symbol s_4[] = { 0xC1 };
334
+ static symbol s_5[] = { 0xD1 };
335
+ static symbol s_6[] = { 0xCE };
336
+ static symbol s_7[] = { 0xCE };
337
+ static symbol s_8[] = { 0xCE };
338
+ static symbol s_9[] = { 0xC9 };
339
+
340
+ static int r_mark_regions(struct SN_env * z) {
341
+ z->I[0] = z->l;
342
+ z->I[1] = z->l;
343
+ { int c = z->c; /* do, line 63 */
344
+ while(1) { /* gopast, line 64 */
345
+ if (!(in_grouping(z, g_v, 192, 220))) goto lab1;
346
+ break;
347
+ lab1:
348
+ if (z->c >= z->l) goto lab0;
349
+ z->c++; /* gopast, line 64 */
350
+ }
351
+ z->I[0] = z->c; /* setmark pV, line 64 */
352
+ while(1) { /* gopast, line 64 */
353
+ if (!(out_grouping(z, g_v, 192, 220))) goto lab2;
354
+ break;
355
+ lab2:
356
+ if (z->c >= z->l) goto lab0;
357
+ z->c++; /* gopast, line 64 */
358
+ }
359
+ while(1) { /* gopast, line 65 */
360
+ if (!(in_grouping(z, g_v, 192, 220))) goto lab3;
361
+ break;
362
+ lab3:
363
+ if (z->c >= z->l) goto lab0;
364
+ z->c++; /* gopast, line 65 */
365
+ }
366
+ while(1) { /* gopast, line 65 */
367
+ if (!(out_grouping(z, g_v, 192, 220))) goto lab4;
368
+ break;
369
+ lab4:
370
+ if (z->c >= z->l) goto lab0;
371
+ z->c++; /* gopast, line 65 */
372
+ }
373
+ z->I[1] = z->c; /* setmark p2, line 65 */
374
+ lab0:
375
+ z->c = c;
376
+ }
377
+ return 1;
378
+ }
379
+
380
+ static int r_R2(struct SN_env * z) {
381
+ if (!(z->I[1] <= z->c)) return 0;
382
+ return 1;
383
+ }
384
+
385
+ static int r_perfective_gerund(struct SN_env * z) {
386
+ int among_var;
387
+ z->ket = z->c; /* [, line 74 */
388
+ among_var = find_among_b(z, a_0, 9); /* substring, line 74 */
389
+ if (!(among_var)) return 0;
390
+ z->bra = z->c; /* ], line 74 */
391
+ switch(among_var) {
392
+ case 0: return 0;
393
+ case 1:
394
+ { int m = z->l - z->c; (void) m; /* or, line 78 */
395
+ if (!(eq_s_b(z, 1, s_0))) goto lab1;
396
+ goto lab0;
397
+ lab1:
398
+ z->c = z->l - m;
399
+ if (!(eq_s_b(z, 1, s_1))) return 0;
400
+ }
401
+ lab0:
402
+ { int ret;
403
+ ret = slice_del(z); /* delete, line 78 */
404
+ if (ret < 0) return ret;
405
+ }
406
+ break;
407
+ case 2:
408
+ { int ret;
409
+ ret = slice_del(z); /* delete, line 85 */
410
+ if (ret < 0) return ret;
411
+ }
412
+ break;
413
+ }
414
+ return 1;
415
+ }
416
+
417
+ static int r_adjective(struct SN_env * z) {
418
+ int among_var;
419
+ z->ket = z->c; /* [, line 90 */
420
+ among_var = find_among_b(z, a_1, 26); /* substring, line 90 */
421
+ if (!(among_var)) return 0;
422
+ z->bra = z->c; /* ], line 90 */
423
+ switch(among_var) {
424
+ case 0: return 0;
425
+ case 1:
426
+ { int ret;
427
+ ret = slice_del(z); /* delete, line 99 */
428
+ if (ret < 0) return ret;
429
+ }
430
+ break;
431
+ }
432
+ return 1;
433
+ }
434
+
435
+ static int r_adjectival(struct SN_env * z) {
436
+ int among_var;
437
+ { int ret = r_adjective(z);
438
+ if (ret == 0) return 0; /* call adjective, line 104 */
439
+ if (ret < 0) return ret;
440
+ }
441
+ { int m = z->l - z->c; (void) m; /* try, line 111 */
442
+ z->ket = z->c; /* [, line 112 */
443
+ among_var = find_among_b(z, a_2, 8); /* substring, line 112 */
444
+ if (!(among_var)) { z->c = z->l - m; goto lab0; }
445
+ z->bra = z->c; /* ], line 112 */
446
+ switch(among_var) {
447
+ case 0: { z->c = z->l - m; goto lab0; }
448
+ case 1:
449
+ { int m = z->l - z->c; (void) m; /* or, line 117 */
450
+ if (!(eq_s_b(z, 1, s_2))) goto lab2;
451
+ goto lab1;
452
+ lab2:
453
+ z->c = z->l - m;
454
+ if (!(eq_s_b(z, 1, s_3))) { z->c = z->l - m; goto lab0; }
455
+ }
456
+ lab1:
457
+ { int ret;
458
+ ret = slice_del(z); /* delete, line 117 */
459
+ if (ret < 0) return ret;
460
+ }
461
+ break;
462
+ case 2:
463
+ { int ret;
464
+ ret = slice_del(z); /* delete, line 124 */
465
+ if (ret < 0) return ret;
466
+ }
467
+ break;
468
+ }
469
+ lab0:
470
+ ;
471
+ }
472
+ return 1;
473
+ }
474
+
475
+ static int r_reflexive(struct SN_env * z) {
476
+ int among_var;
477
+ z->ket = z->c; /* [, line 131 */
478
+ among_var = find_among_b(z, a_3, 2); /* substring, line 131 */
479
+ if (!(among_var)) return 0;
480
+ z->bra = z->c; /* ], line 131 */
481
+ switch(among_var) {
482
+ case 0: return 0;
483
+ case 1:
484
+ { int ret;
485
+ ret = slice_del(z); /* delete, line 134 */
486
+ if (ret < 0) return ret;
487
+ }
488
+ break;
489
+ }
490
+ return 1;
491
+ }
492
+
493
+ static int r_verb(struct SN_env * z) {
494
+ int among_var;
495
+ z->ket = z->c; /* [, line 139 */
496
+ among_var = find_among_b(z, a_4, 46); /* substring, line 139 */
497
+ if (!(among_var)) return 0;
498
+ z->bra = z->c; /* ], line 139 */
499
+ switch(among_var) {
500
+ case 0: return 0;
501
+ case 1:
502
+ { int m = z->l - z->c; (void) m; /* or, line 145 */
503
+ if (!(eq_s_b(z, 1, s_4))) goto lab1;
504
+ goto lab0;
505
+ lab1:
506
+ z->c = z->l - m;
507
+ if (!(eq_s_b(z, 1, s_5))) return 0;
508
+ }
509
+ lab0:
510
+ { int ret;
511
+ ret = slice_del(z); /* delete, line 145 */
512
+ if (ret < 0) return ret;
513
+ }
514
+ break;
515
+ case 2:
516
+ { int ret;
517
+ ret = slice_del(z); /* delete, line 153 */
518
+ if (ret < 0) return ret;
519
+ }
520
+ break;
521
+ }
522
+ return 1;
523
+ }
524
+
525
+ static int r_noun(struct SN_env * z) {
526
+ int among_var;
527
+ z->ket = z->c; /* [, line 162 */
528
+ among_var = find_among_b(z, a_5, 36); /* substring, line 162 */
529
+ if (!(among_var)) return 0;
530
+ z->bra = z->c; /* ], line 162 */
531
+ switch(among_var) {
532
+ case 0: return 0;
533
+ case 1:
534
+ { int ret;
535
+ ret = slice_del(z); /* delete, line 169 */
536
+ if (ret < 0) return ret;
537
+ }
538
+ break;
539
+ }
540
+ return 1;
541
+ }
542
+
543
+ static int r_derivational(struct SN_env * z) {
544
+ int among_var;
545
+ z->ket = z->c; /* [, line 178 */
546
+ among_var = find_among_b(z, a_6, 2); /* substring, line 178 */
547
+ if (!(among_var)) return 0;
548
+ z->bra = z->c; /* ], line 178 */
549
+ { int ret = r_R2(z);
550
+ if (ret == 0) return 0; /* call R2, line 178 */
551
+ if (ret < 0) return ret;
552
+ }
553
+ switch(among_var) {
554
+ case 0: return 0;
555
+ case 1:
556
+ { int ret;
557
+ ret = slice_del(z); /* delete, line 181 */
558
+ if (ret < 0) return ret;
559
+ }
560
+ break;
561
+ }
562
+ return 1;
563
+ }
564
+
565
+ static int r_tidy_up(struct SN_env * z) {
566
+ int among_var;
567
+ z->ket = z->c; /* [, line 186 */
568
+ among_var = find_among_b(z, a_7, 4); /* substring, line 186 */
569
+ if (!(among_var)) return 0;
570
+ z->bra = z->c; /* ], line 186 */
571
+ switch(among_var) {
572
+ case 0: return 0;
573
+ case 1:
574
+ { int ret;
575
+ ret = slice_del(z); /* delete, line 190 */
576
+ if (ret < 0) return ret;
577
+ }
578
+ z->ket = z->c; /* [, line 191 */
579
+ if (!(eq_s_b(z, 1, s_6))) return 0;
580
+ z->bra = z->c; /* ], line 191 */
581
+ if (!(eq_s_b(z, 1, s_7))) return 0;
582
+ { int ret;
583
+ ret = slice_del(z); /* delete, line 191 */
584
+ if (ret < 0) return ret;
585
+ }
586
+ break;
587
+ case 2:
588
+ if (!(eq_s_b(z, 1, s_8))) return 0;
589
+ { int ret;
590
+ ret = slice_del(z); /* delete, line 194 */
591
+ if (ret < 0) return ret;
592
+ }
593
+ break;
594
+ case 3:
595
+ { int ret;
596
+ ret = slice_del(z); /* delete, line 196 */
597
+ if (ret < 0) return ret;
598
+ }
599
+ break;
600
+ }
601
+ return 1;
602
+ }
603
+
604
+ extern int russian_KOI8_R_stem(struct SN_env * z) {
605
+ { int c = z->c; /* do, line 203 */
606
+ { int ret = r_mark_regions(z);
607
+ if (ret == 0) goto lab0; /* call mark_regions, line 203 */
608
+ if (ret < 0) return ret;
609
+ }
610
+ lab0:
611
+ z->c = c;
612
+ }
613
+ z->lb = z->c; z->c = z->l; /* backwards, line 204 */
614
+
615
+ { int m3; /* setlimit, line 204 */
616
+ int m = z->l - z->c; (void) m;
617
+ if (z->c < z->I[0]) return 0;
618
+ z->c = z->I[0]; /* tomark, line 204 */
619
+ m3 = z->lb; z->lb = z->c;
620
+ z->c = z->l - m;
621
+ { int m = z->l - z->c; (void) m; /* do, line 205 */
622
+ { int m = z->l - z->c; (void) m; /* or, line 206 */
623
+ { int ret = r_perfective_gerund(z);
624
+ if (ret == 0) goto lab3; /* call perfective_gerund, line 206 */
625
+ if (ret < 0) return ret;
626
+ }
627
+ goto lab2;
628
+ lab3:
629
+ z->c = z->l - m;
630
+ { int m = z->l - z->c; (void) m; /* try, line 207 */
631
+ { int ret = r_reflexive(z);
632
+ if (ret == 0) { z->c = z->l - m; goto lab4; } /* call reflexive, line 207 */
633
+ if (ret < 0) return ret;
634
+ }
635
+ lab4:
636
+ ;
637
+ }
638
+ { int m = z->l - z->c; (void) m; /* or, line 208 */
639
+ { int ret = r_adjectival(z);
640
+ if (ret == 0) goto lab6; /* call adjectival, line 208 */
641
+ if (ret < 0) return ret;
642
+ }
643
+ goto lab5;
644
+ lab6:
645
+ z->c = z->l - m;
646
+ { int ret = r_verb(z);
647
+ if (ret == 0) goto lab7; /* call verb, line 208 */
648
+ if (ret < 0) return ret;
649
+ }
650
+ goto lab5;
651
+ lab7:
652
+ z->c = z->l - m;
653
+ { int ret = r_noun(z);
654
+ if (ret == 0) goto lab1; /* call noun, line 208 */
655
+ if (ret < 0) return ret;
656
+ }
657
+ }
658
+ lab5:
659
+ ;
660
+ }
661
+ lab2:
662
+ lab1:
663
+ z->c = z->l - m;
664
+ }
665
+ { int m = z->l - z->c; (void) m; /* try, line 211 */
666
+ z->ket = z->c; /* [, line 211 */
667
+ if (!(eq_s_b(z, 1, s_9))) { z->c = z->l - m; goto lab8; }
668
+ z->bra = z->c; /* ], line 211 */
669
+ { int ret;
670
+ ret = slice_del(z); /* delete, line 211 */
671
+ if (ret < 0) return ret;
672
+ }
673
+ lab8:
674
+ ;
675
+ }
676
+ { int m = z->l - z->c; (void) m; /* do, line 214 */
677
+ { int ret = r_derivational(z);
678
+ if (ret == 0) goto lab9; /* call derivational, line 214 */
679
+ if (ret < 0) return ret;
680
+ }
681
+ lab9:
682
+ z->c = z->l - m;
683
+ }
684
+ { int m = z->l - z->c; (void) m; /* do, line 215 */
685
+ { int ret = r_tidy_up(z);
686
+ if (ret == 0) goto lab10; /* call tidy_up, line 215 */
687
+ if (ret < 0) return ret;
688
+ }
689
+ lab10:
690
+ z->c = z->l - m;
691
+ }
692
+ z->lb = m3;
693
+ }
694
+ z->c = z->lb;
695
+ return 1;
696
+ }
697
+
698
+ extern struct SN_env * russian_KOI8_R_create_env(void) { return SN_create_env(0, 2, 0); }
699
+
700
+ extern void russian_KOI8_R_close_env(struct SN_env * z) { SN_close_env(z); }
701
+