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