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 :
344 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 0 : int ret = out_grouping(z, g_v, 192, 220, 1);
350 0 : if (ret < 0) goto lab0;
351 0 : z->c += ret;
352 : }
353 0 : z->I[1] = z->c;
354 : {
355 0 : int ret = in_grouping(z, g_v, 192, 220, 1);
356 0 : if (ret < 0) goto lab0;
357 0 : z->c += ret;
358 : }
359 : {
360 0 : int ret = out_grouping(z, g_v, 192, 220, 1);
361 0 : if (ret < 0) goto lab0;
362 0 : z->c += ret;
363 : }
364 : {
365 0 : int ret = in_grouping(z, g_v, 192, 220, 1);
366 0 : if (ret < 0) goto lab0;
367 0 : z->c += ret;
368 : }
369 0 : z->I[0] = z->c;
370 0 : lab0:
371 0 : z->c = c1;
372 : }
373 0 : return 1;
374 : }
375 :
376 0 : static int r_R2(struct SN_env * z) {
377 0 : if (!(z->I[0] <= z->c)) return 0;
378 0 : return 1;
379 : }
380 :
381 0 : static int r_perfective_gerund(struct SN_env * z) {
382 : int among_var;
383 0 : z->ket = z->c;
384 0 : if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((25166336 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
385 0 : among_var = find_among_b(z, a_0, 9);
386 0 : if (!(among_var)) return 0;
387 0 : z->bra = z->c;
388 0 : switch (among_var) {
389 0 : case 1:
390 0 : { int m1 = z->l - z->c; (void)m1;
391 0 : if (z->c <= z->lb || z->p[z->c - 1] != 0xC1) goto lab1;
392 0 : z->c--;
393 0 : goto lab0;
394 0 : lab1:
395 0 : z->c = z->l - m1;
396 0 : if (z->c <= z->lb || z->p[z->c - 1] != 0xD1) return 0;
397 0 : z->c--;
398 : }
399 0 : lab0:
400 0 : { int ret = slice_del(z);
401 0 : if (ret < 0) return ret;
402 : }
403 0 : break;
404 0 : case 2:
405 0 : { int ret = slice_del(z);
406 0 : if (ret < 0) return ret;
407 : }
408 0 : break;
409 : }
410 0 : return 1;
411 : }
412 :
413 0 : static int r_adjective(struct SN_env * z) {
414 0 : z->ket = z->c;
415 0 : if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((2271009 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
416 0 : if (!(find_among_b(z, a_1, 26))) return 0;
417 0 : z->bra = z->c;
418 0 : { int ret = slice_del(z);
419 0 : if (ret < 0) return ret;
420 : }
421 0 : return 1;
422 : }
423 :
424 0 : static int r_adjectival(struct SN_env * z) {
425 : int among_var;
426 0 : { int ret = r_adjective(z);
427 0 : if (ret <= 0) return ret;
428 : }
429 0 : { int m1 = z->l - z->c; (void)m1;
430 0 : z->ket = z->c;
431 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; }
432 0 : among_var = find_among_b(z, a_2, 8);
433 0 : if (!(among_var)) { z->c = z->l - m1; goto lab0; }
434 0 : z->bra = z->c;
435 0 : switch (among_var) {
436 0 : case 1:
437 0 : { int m2 = z->l - z->c; (void)m2;
438 0 : if (z->c <= z->lb || z->p[z->c - 1] != 0xC1) goto lab2;
439 0 : z->c--;
440 0 : goto lab1;
441 0 : lab2:
442 0 : z->c = z->l - m2;
443 0 : if (z->c <= z->lb || z->p[z->c - 1] != 0xD1) { z->c = z->l - m1; goto lab0; }
444 0 : z->c--;
445 : }
446 0 : lab1:
447 0 : { int ret = slice_del(z);
448 0 : if (ret < 0) return ret;
449 : }
450 0 : break;
451 0 : case 2:
452 0 : { int ret = slice_del(z);
453 0 : if (ret < 0) return ret;
454 : }
455 0 : break;
456 : }
457 0 : lab0:
458 : ;
459 : }
460 0 : return 1;
461 : }
462 :
463 0 : static int r_reflexive(struct SN_env * z) {
464 0 : z->ket = z->c;
465 0 : if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 209 && z->p[z->c - 1] != 216)) return 0;
466 0 : if (!(find_among_b(z, a_3, 2))) return 0;
467 0 : z->bra = z->c;
468 0 : { int ret = slice_del(z);
469 0 : if (ret < 0) return ret;
470 : }
471 0 : return 1;
472 : }
473 :
474 0 : static int r_verb(struct SN_env * z) {
475 : int among_var;
476 0 : z->ket = z->c;
477 0 : if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((51443235 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
478 0 : among_var = find_among_b(z, a_4, 46);
479 0 : if (!(among_var)) return 0;
480 0 : z->bra = z->c;
481 0 : switch (among_var) {
482 0 : case 1:
483 0 : { int m1 = z->l - z->c; (void)m1;
484 0 : if (z->c <= z->lb || z->p[z->c - 1] != 0xC1) goto lab1;
485 0 : z->c--;
486 0 : goto lab0;
487 0 : lab1:
488 0 : z->c = z->l - m1;
489 0 : if (z->c <= z->lb || z->p[z->c - 1] != 0xD1) return 0;
490 0 : z->c--;
491 : }
492 0 : lab0:
493 0 : { int ret = slice_del(z);
494 0 : if (ret < 0) return ret;
495 : }
496 0 : break;
497 0 : case 2:
498 0 : { int ret = slice_del(z);
499 0 : if (ret < 0) return ret;
500 : }
501 0 : break;
502 : }
503 0 : return 1;
504 : }
505 :
506 0 : static int r_noun(struct SN_env * z) {
507 0 : z->ket = z->c;
508 0 : if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((60991267 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
509 0 : if (!(find_among_b(z, a_5, 36))) return 0;
510 0 : z->bra = z->c;
511 0 : { int ret = slice_del(z);
512 0 : if (ret < 0) return ret;
513 : }
514 0 : return 1;
515 : }
516 :
517 0 : static int r_derivational(struct SN_env * z) {
518 0 : z->ket = z->c;
519 0 : if (z->c - 2 <= z->lb || (z->p[z->c - 1] != 212 && z->p[z->c - 1] != 216)) return 0;
520 0 : if (!(find_among_b(z, a_6, 2))) return 0;
521 0 : z->bra = z->c;
522 0 : { int ret = r_R2(z);
523 0 : if (ret <= 0) return ret;
524 : }
525 0 : { int ret = slice_del(z);
526 0 : if (ret < 0) return ret;
527 : }
528 0 : return 1;
529 : }
530 :
531 0 : static int r_tidy_up(struct SN_env * z) {
532 : int among_var;
533 0 : z->ket = z->c;
534 0 : if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((151011360 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
535 0 : among_var = find_among_b(z, a_7, 4);
536 0 : if (!(among_var)) return 0;
537 0 : z->bra = z->c;
538 0 : switch (among_var) {
539 0 : case 1:
540 0 : { int ret = slice_del(z);
541 0 : if (ret < 0) return ret;
542 : }
543 0 : z->ket = z->c;
544 0 : if (z->c <= z->lb || z->p[z->c - 1] != 0xCE) return 0;
545 0 : z->c--;
546 0 : z->bra = z->c;
547 0 : if (z->c <= z->lb || z->p[z->c - 1] != 0xCE) return 0;
548 0 : z->c--;
549 0 : { int ret = slice_del(z);
550 0 : if (ret < 0) return ret;
551 : }
552 0 : break;
553 0 : case 2:
554 0 : if (z->c <= z->lb || z->p[z->c - 1] != 0xCE) return 0;
555 0 : z->c--;
556 0 : { int ret = slice_del(z);
557 0 : if (ret < 0) return ret;
558 : }
559 0 : break;
560 0 : case 3:
561 0 : { int ret = slice_del(z);
562 0 : if (ret < 0) return ret;
563 : }
564 0 : break;
565 : }
566 0 : return 1;
567 : }
568 :
569 0 : extern int russian_KOI8_R_stem(struct SN_env * z) {
570 0 : { int c1 = z->c;
571 0 : while(1) {
572 0 : int c2 = z->c;
573 0 : while(1) {
574 0 : int c3 = z->c;
575 0 : z->bra = z->c;
576 0 : if (z->c == z->l || z->p[z->c] != 0xA3) goto lab2;
577 0 : z->c++;
578 0 : z->ket = z->c;
579 0 : z->c = c3;
580 0 : break;
581 0 : lab2:
582 0 : z->c = c3;
583 0 : if (z->c >= z->l) goto lab1;
584 0 : z->c++;
585 : }
586 0 : { int ret = slice_from_s(z, 1, s_0);
587 0 : if (ret < 0) return ret;
588 : }
589 0 : continue;
590 0 : lab1:
591 0 : z->c = c2;
592 0 : break;
593 : }
594 0 : z->c = c1;
595 : }
596 :
597 0 : { int ret = r_mark_regions(z);
598 0 : if (ret < 0) return ret;
599 : }
600 0 : z->lb = z->c; z->c = z->l;
601 :
602 :
603 : { int mlimit4;
604 0 : if (z->c < z->I[1]) return 0;
605 0 : mlimit4 = z->lb; z->lb = z->I[1];
606 0 : { int m5 = z->l - z->c; (void)m5;
607 0 : { int m6 = z->l - z->c; (void)m6;
608 0 : { int ret = r_perfective_gerund(z);
609 0 : if (ret == 0) goto lab5;
610 0 : if (ret < 0) return ret;
611 : }
612 0 : goto lab4;
613 0 : lab5:
614 0 : z->c = z->l - m6;
615 0 : { int m7 = z->l - z->c; (void)m7;
616 0 : { int ret = r_reflexive(z);
617 0 : if (ret == 0) { z->c = z->l - m7; goto lab6; }
618 0 : if (ret < 0) return ret;
619 : }
620 0 : lab6:
621 : ;
622 : }
623 0 : { int m8 = z->l - z->c; (void)m8;
624 0 : { int ret = r_adjectival(z);
625 0 : if (ret == 0) goto lab8;
626 0 : if (ret < 0) return ret;
627 : }
628 0 : goto lab7;
629 0 : lab8:
630 0 : z->c = z->l - m8;
631 0 : { int ret = r_verb(z);
632 0 : if (ret == 0) goto lab9;
633 0 : if (ret < 0) return ret;
634 : }
635 0 : goto lab7;
636 0 : lab9:
637 0 : z->c = z->l - m8;
638 0 : { int ret = r_noun(z);
639 0 : if (ret == 0) goto lab3;
640 0 : if (ret < 0) return ret;
641 : }
642 : }
643 0 : lab7:
644 : ;
645 : }
646 0 : lab4:
647 0 : lab3:
648 0 : z->c = z->l - m5;
649 : }
650 0 : { int m9 = z->l - z->c; (void)m9;
651 0 : z->ket = z->c;
652 0 : if (z->c <= z->lb || z->p[z->c - 1] != 0xC9) { z->c = z->l - m9; goto lab10; }
653 0 : z->c--;
654 0 : z->bra = z->c;
655 0 : { int ret = slice_del(z);
656 0 : if (ret < 0) return ret;
657 : }
658 0 : lab10:
659 : ;
660 : }
661 0 : { int m10 = z->l - z->c; (void)m10;
662 0 : { int ret = r_derivational(z);
663 0 : if (ret < 0) return ret;
664 : }
665 0 : z->c = z->l - m10;
666 : }
667 0 : { int m11 = z->l - z->c; (void)m11;
668 0 : { int ret = r_tidy_up(z);
669 0 : if (ret < 0) return ret;
670 : }
671 0 : z->c = z->l - m11;
672 : }
673 0 : z->lb = mlimit4;
674 : }
675 0 : z->c = z->lb;
676 0 : return 1;
677 : }
678 :
679 0 : extern struct SN_env * russian_KOI8_R_create_env(void) { return SN_create_env(0, 2); }
680 :
681 0 : extern void russian_KOI8_R_close_env(struct SN_env * z) { SN_close_env(z, 0); }
682 :
|