PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
stem_KOI8_R_russian.c
Go to the documentation of this file.
1/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
2
3#include "header.h"
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8extern int russian_KOI8_R_stem(struct SN_env * z);
9#ifdef __cplusplus
10}
11#endif
12static int r_tidy_up(struct SN_env * z);
13static int r_derivational(struct SN_env * z);
14static int r_noun(struct SN_env * z);
15static int r_verb(struct SN_env * z);
16static int r_reflexive(struct SN_env * z);
17static int r_adjectival(struct SN_env * z);
18static int r_adjective(struct SN_env * z);
19static int r_perfective_gerund(struct SN_env * z);
20static int r_R2(struct SN_env * z);
21static int r_mark_regions(struct SN_env * z);
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26
27extern struct SN_env * russian_KOI8_R_create_env(void);
28extern void russian_KOI8_R_close_env(struct SN_env * z);
29
30
31#ifdef __cplusplus
32}
33#endif
34static const symbol s_0_0[3] = { 0xD7, 0xDB, 0xC9 };
35static const symbol s_0_1[4] = { 0xC9, 0xD7, 0xDB, 0xC9 };
36static const symbol s_0_2[4] = { 0xD9, 0xD7, 0xDB, 0xC9 };
37static const symbol s_0_3[1] = { 0xD7 };
38static const symbol s_0_4[2] = { 0xC9, 0xD7 };
39static const symbol s_0_5[2] = { 0xD9, 0xD7 };
40static const symbol s_0_6[5] = { 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
41static const symbol s_0_7[6] = { 0xC9, 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
42static const symbol s_0_8[6] = { 0xD9, 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
43
44static 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
57static const symbol s_1_0[2] = { 0xC0, 0xC0 };
58static const symbol s_1_1[2] = { 0xC5, 0xC0 };
59static const symbol s_1_2[2] = { 0xCF, 0xC0 };
60static const symbol s_1_3[2] = { 0xD5, 0xC0 };
61static const symbol s_1_4[2] = { 0xC5, 0xC5 };
62static const symbol s_1_5[2] = { 0xC9, 0xC5 };
63static const symbol s_1_6[2] = { 0xCF, 0xC5 };
64static const symbol s_1_7[2] = { 0xD9, 0xC5 };
65static const symbol s_1_8[2] = { 0xC9, 0xC8 };
66static const symbol s_1_9[2] = { 0xD9, 0xC8 };
67static const symbol s_1_10[3] = { 0xC9, 0xCD, 0xC9 };
68static const symbol s_1_11[3] = { 0xD9, 0xCD, 0xC9 };
69static const symbol s_1_12[2] = { 0xC5, 0xCA };
70static const symbol s_1_13[2] = { 0xC9, 0xCA };
71static const symbol s_1_14[2] = { 0xCF, 0xCA };
72static const symbol s_1_15[2] = { 0xD9, 0xCA };
73static const symbol s_1_16[2] = { 0xC5, 0xCD };
74static const symbol s_1_17[2] = { 0xC9, 0xCD };
75static const symbol s_1_18[2] = { 0xCF, 0xCD };
76static const symbol s_1_19[2] = { 0xD9, 0xCD };
77static const symbol s_1_20[3] = { 0xC5, 0xC7, 0xCF };
78static const symbol s_1_21[3] = { 0xCF, 0xC7, 0xCF };
79static const symbol s_1_22[2] = { 0xC1, 0xD1 };
80static const symbol s_1_23[2] = { 0xD1, 0xD1 };
81static const symbol s_1_24[3] = { 0xC5, 0xCD, 0xD5 };
82static const symbol s_1_25[3] = { 0xCF, 0xCD, 0xD5 };
83
84static 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
114static const symbol s_2_0[2] = { 0xC5, 0xCD };
115static const symbol s_2_1[2] = { 0xCE, 0xCE };
116static const symbol s_2_2[2] = { 0xD7, 0xDB };
117static const symbol s_2_3[3] = { 0xC9, 0xD7, 0xDB };
118static const symbol s_2_4[3] = { 0xD9, 0xD7, 0xDB };
119static const symbol s_2_5[1] = { 0xDD };
120static const symbol s_2_6[2] = { 0xC0, 0xDD };
121static const symbol s_2_7[3] = { 0xD5, 0xC0, 0xDD };
122
123static 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
135static const symbol s_3_0[2] = { 0xD3, 0xD1 };
136static const symbol s_3_1[2] = { 0xD3, 0xD8 };
137
138static 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
144static const symbol s_4_0[1] = { 0xC0 };
145static const symbol s_4_1[2] = { 0xD5, 0xC0 };
146static const symbol s_4_2[2] = { 0xCC, 0xC1 };
147static const symbol s_4_3[3] = { 0xC9, 0xCC, 0xC1 };
148static const symbol s_4_4[3] = { 0xD9, 0xCC, 0xC1 };
149static const symbol s_4_5[2] = { 0xCE, 0xC1 };
150static const symbol s_4_6[3] = { 0xC5, 0xCE, 0xC1 };
151static const symbol s_4_7[3] = { 0xC5, 0xD4, 0xC5 };
152static const symbol s_4_8[3] = { 0xC9, 0xD4, 0xC5 };
153static const symbol s_4_9[3] = { 0xCA, 0xD4, 0xC5 };
154static const symbol s_4_10[4] = { 0xC5, 0xCA, 0xD4, 0xC5 };
155static const symbol s_4_11[4] = { 0xD5, 0xCA, 0xD4, 0xC5 };
156static const symbol s_4_12[2] = { 0xCC, 0xC9 };
157static const symbol s_4_13[3] = { 0xC9, 0xCC, 0xC9 };
158static const symbol s_4_14[3] = { 0xD9, 0xCC, 0xC9 };
159static const symbol s_4_15[1] = { 0xCA };
160static const symbol s_4_16[2] = { 0xC5, 0xCA };
161static const symbol s_4_17[2] = { 0xD5, 0xCA };
162static const symbol s_4_18[1] = { 0xCC };
163static const symbol s_4_19[2] = { 0xC9, 0xCC };
164static const symbol s_4_20[2] = { 0xD9, 0xCC };
165static const symbol s_4_21[2] = { 0xC5, 0xCD };
166static const symbol s_4_22[2] = { 0xC9, 0xCD };
167static const symbol s_4_23[2] = { 0xD9, 0xCD };
168static const symbol s_4_24[1] = { 0xCE };
169static const symbol s_4_25[2] = { 0xC5, 0xCE };
170static const symbol s_4_26[2] = { 0xCC, 0xCF };
171static const symbol s_4_27[3] = { 0xC9, 0xCC, 0xCF };
172static const symbol s_4_28[3] = { 0xD9, 0xCC, 0xCF };
173static const symbol s_4_29[2] = { 0xCE, 0xCF };
174static const symbol s_4_30[3] = { 0xC5, 0xCE, 0xCF };
175static const symbol s_4_31[3] = { 0xCE, 0xCE, 0xCF };
176static const symbol s_4_32[2] = { 0xC0, 0xD4 };
177static const symbol s_4_33[3] = { 0xD5, 0xC0, 0xD4 };
178static const symbol s_4_34[2] = { 0xC5, 0xD4 };
179static const symbol s_4_35[3] = { 0xD5, 0xC5, 0xD4 };
180static const symbol s_4_36[2] = { 0xC9, 0xD4 };
181static const symbol s_4_37[2] = { 0xD1, 0xD4 };
182static const symbol s_4_38[2] = { 0xD9, 0xD4 };
183static const symbol s_4_39[2] = { 0xD4, 0xD8 };
184static const symbol s_4_40[3] = { 0xC9, 0xD4, 0xD8 };
185static const symbol s_4_41[3] = { 0xD9, 0xD4, 0xD8 };
186static const symbol s_4_42[3] = { 0xC5, 0xDB, 0xD8 };
187static const symbol s_4_43[3] = { 0xC9, 0xDB, 0xD8 };
188static const symbol s_4_44[2] = { 0xCE, 0xD9 };
189static const symbol s_4_45[3] = { 0xC5, 0xCE, 0xD9 };
190
191static 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
241static const symbol s_5_0[1] = { 0xC0 };
242static const symbol s_5_1[2] = { 0xC9, 0xC0 };
243static const symbol s_5_2[2] = { 0xD8, 0xC0 };
244static const symbol s_5_3[1] = { 0xC1 };
245static const symbol s_5_4[1] = { 0xC5 };
246static const symbol s_5_5[2] = { 0xC9, 0xC5 };
247static const symbol s_5_6[2] = { 0xD8, 0xC5 };
248static const symbol s_5_7[2] = { 0xC1, 0xC8 };
249static const symbol s_5_8[2] = { 0xD1, 0xC8 };
250static const symbol s_5_9[3] = { 0xC9, 0xD1, 0xC8 };
251static const symbol s_5_10[1] = { 0xC9 };
252static const symbol s_5_11[2] = { 0xC5, 0xC9 };
253static const symbol s_5_12[2] = { 0xC9, 0xC9 };
254static const symbol s_5_13[3] = { 0xC1, 0xCD, 0xC9 };
255static const symbol s_5_14[3] = { 0xD1, 0xCD, 0xC9 };
256static const symbol s_5_15[4] = { 0xC9, 0xD1, 0xCD, 0xC9 };
257static const symbol s_5_16[1] = { 0xCA };
258static const symbol s_5_17[2] = { 0xC5, 0xCA };
259static const symbol s_5_18[3] = { 0xC9, 0xC5, 0xCA };
260static const symbol s_5_19[2] = { 0xC9, 0xCA };
261static const symbol s_5_20[2] = { 0xCF, 0xCA };
262static const symbol s_5_21[2] = { 0xC1, 0xCD };
263static const symbol s_5_22[2] = { 0xC5, 0xCD };
264static const symbol s_5_23[3] = { 0xC9, 0xC5, 0xCD };
265static const symbol s_5_24[2] = { 0xCF, 0xCD };
266static const symbol s_5_25[2] = { 0xD1, 0xCD };
267static const symbol s_5_26[3] = { 0xC9, 0xD1, 0xCD };
268static const symbol s_5_27[1] = { 0xCF };
269static const symbol s_5_28[1] = { 0xD1 };
270static const symbol s_5_29[2] = { 0xC9, 0xD1 };
271static const symbol s_5_30[2] = { 0xD8, 0xD1 };
272static const symbol s_5_31[1] = { 0xD5 };
273static const symbol s_5_32[2] = { 0xC5, 0xD7 };
274static const symbol s_5_33[2] = { 0xCF, 0xD7 };
275static const symbol s_5_34[1] = { 0xD8 };
276static const symbol s_5_35[1] = { 0xD9 };
277
278static 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
318static const symbol s_6_0[3] = { 0xCF, 0xD3, 0xD4 };
319static const symbol s_6_1[4] = { 0xCF, 0xD3, 0xD4, 0xD8 };
320
321static 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
327static const symbol s_7_0[4] = { 0xC5, 0xCA, 0xDB, 0xC5 };
328static const symbol s_7_1[1] = { 0xCE };
329static const symbol s_7_2[1] = { 0xD8 };
330static const symbol s_7_3[3] = { 0xC5, 0xCA, 0xDB };
331
332static 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
340static const unsigned char g_v[] = { 35, 130, 34, 18 };
341
342static const symbol s_0[] = { 0xC5 };
343
344static int r_mark_regions(struct SN_env * z) {
345 z->I[1] = z->l;
346 z->I[0] = z->l;
347 { int c1 = z->c;
348 {
349 int ret = out_grouping(z, g_v, 192, 220, 1);
350 if (ret < 0) goto lab0;
351 z->c += ret;
352 }
353 z->I[1] = z->c;
354 {
355 int ret = in_grouping(z, g_v, 192, 220, 1);
356 if (ret < 0) goto lab0;
357 z->c += ret;
358 }
359 {
360 int ret = out_grouping(z, g_v, 192, 220, 1);
361 if (ret < 0) goto lab0;
362 z->c += ret;
363 }
364 {
365 int ret = in_grouping(z, g_v, 192, 220, 1);
366 if (ret < 0) goto lab0;
367 z->c += ret;
368 }
369 z->I[0] = z->c;
370 lab0:
371 z->c = c1;
372 }
373 return 1;
374}
375
376static int r_R2(struct SN_env * z) {
377 if (!(z->I[0] <= z->c)) return 0;
378 return 1;
379}
380
381static int r_perfective_gerund(struct SN_env * z) {
382 int among_var;
383 z->ket = z->c;
384 if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((25166336 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
385 among_var = find_among_b(z, a_0, 9);
386 if (!(among_var)) return 0;
387 z->bra = z->c;
388 switch (among_var) {
389 case 1:
390 { int m1 = z->l - z->c; (void)m1;
391 if (z->c <= z->lb || z->p[z->c - 1] != 0xC1) goto lab1;
392 z->c--;
393 goto lab0;
394 lab1:
395 z->c = z->l - m1;
396 if (z->c <= z->lb || z->p[z->c - 1] != 0xD1) return 0;
397 z->c--;
398 }
399 lab0:
400 { int ret = slice_del(z);
401 if (ret < 0) return ret;
402 }
403 break;
404 case 2:
405 { int ret = slice_del(z);
406 if (ret < 0) return ret;
407 }
408 break;
409 }
410 return 1;
411}
412
413static int r_adjective(struct SN_env * z) {
414 z->ket = z->c;
415 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((2271009 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
416 if (!(find_among_b(z, a_1, 26))) return 0;
417 z->bra = z->c;
418 { int ret = slice_del(z);
419 if (ret < 0) return ret;
420 }
421 return 1;
422}
423
424static int r_adjectival(struct SN_env * z) {
425 int among_var;
426 { int ret = r_adjective(z);
427 if (ret <= 0) return ret;
428 }
429 { int m1 = z->l - z->c; (void)m1;
430 z->ket = z->c;
431 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 among_var = find_among_b(z, a_2, 8);
433 if (!(among_var)) { z->c = z->l - m1; goto lab0; }
434 z->bra = z->c;
435 switch (among_var) {
436 case 1:
437 { int m2 = z->l - z->c; (void)m2;
438 if (z->c <= z->lb || z->p[z->c - 1] != 0xC1) goto lab2;
439 z->c--;
440 goto lab1;
441 lab2:
442 z->c = z->l - m2;
443 if (z->c <= z->lb || z->p[z->c - 1] != 0xD1) { z->c = z->l - m1; goto lab0; }
444 z->c--;
445 }
446 lab1:
447 { int ret = slice_del(z);
448 if (ret < 0) return ret;
449 }
450 break;
451 case 2:
452 { int ret = slice_del(z);
453 if (ret < 0) return ret;
454 }
455 break;
456 }
457 lab0:
458 ;
459 }
460 return 1;
461}
462
463static int r_reflexive(struct SN_env * z) {
464 z->ket = z->c;
465 if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 209 && z->p[z->c - 1] != 216)) return 0;
466 if (!(find_among_b(z, a_3, 2))) return 0;
467 z->bra = z->c;
468 { int ret = slice_del(z);
469 if (ret < 0) return ret;
470 }
471 return 1;
472}
473
474static int r_verb(struct SN_env * z) {
475 int among_var;
476 z->ket = z->c;
477 if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((51443235 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
478 among_var = find_among_b(z, a_4, 46);
479 if (!(among_var)) return 0;
480 z->bra = z->c;
481 switch (among_var) {
482 case 1:
483 { int m1 = z->l - z->c; (void)m1;
484 if (z->c <= z->lb || z->p[z->c - 1] != 0xC1) goto lab1;
485 z->c--;
486 goto lab0;
487 lab1:
488 z->c = z->l - m1;
489 if (z->c <= z->lb || z->p[z->c - 1] != 0xD1) return 0;
490 z->c--;
491 }
492 lab0:
493 { int ret = slice_del(z);
494 if (ret < 0) return ret;
495 }
496 break;
497 case 2:
498 { int ret = slice_del(z);
499 if (ret < 0) return ret;
500 }
501 break;
502 }
503 return 1;
504}
505
506static int r_noun(struct SN_env * z) {
507 z->ket = z->c;
508 if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((60991267 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
509 if (!(find_among_b(z, a_5, 36))) return 0;
510 z->bra = z->c;
511 { int ret = slice_del(z);
512 if (ret < 0) return ret;
513 }
514 return 1;
515}
516
517static int r_derivational(struct SN_env * z) {
518 z->ket = z->c;
519 if (z->c - 2 <= z->lb || (z->p[z->c - 1] != 212 && z->p[z->c - 1] != 216)) return 0;
520 if (!(find_among_b(z, a_6, 2))) return 0;
521 z->bra = z->c;
522 { int ret = r_R2(z);
523 if (ret <= 0) return ret;
524 }
525 { int ret = slice_del(z);
526 if (ret < 0) return ret;
527 }
528 return 1;
529}
530
531static int r_tidy_up(struct SN_env * z) {
532 int among_var;
533 z->ket = z->c;
534 if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 6 || !((151011360 >> (z->p[z->c - 1] & 0x1f)) & 1)) return 0;
535 among_var = find_among_b(z, a_7, 4);
536 if (!(among_var)) return 0;
537 z->bra = z->c;
538 switch (among_var) {
539 case 1:
540 { int ret = slice_del(z);
541 if (ret < 0) return ret;
542 }
543 z->ket = z->c;
544 if (z->c <= z->lb || z->p[z->c - 1] != 0xCE) return 0;
545 z->c--;
546 z->bra = z->c;
547 if (z->c <= z->lb || z->p[z->c - 1] != 0xCE) return 0;
548 z->c--;
549 { int ret = slice_del(z);
550 if (ret < 0) return ret;
551 }
552 break;
553 case 2:
554 if (z->c <= z->lb || z->p[z->c - 1] != 0xCE) return 0;
555 z->c--;
556 { int ret = slice_del(z);
557 if (ret < 0) return ret;
558 }
559 break;
560 case 3:
561 { int ret = slice_del(z);
562 if (ret < 0) return ret;
563 }
564 break;
565 }
566 return 1;
567}
568
569extern int russian_KOI8_R_stem(struct SN_env * z) {
570 { int c1 = z->c;
571 while(1) {
572 int c2 = z->c;
573 while(1) {
574 int c3 = z->c;
575 z->bra = z->c;
576 if (z->c == z->l || z->p[z->c] != 0xA3) goto lab2;
577 z->c++;
578 z->ket = z->c;
579 z->c = c3;
580 break;
581 lab2:
582 z->c = c3;
583 if (z->c >= z->l) goto lab1;
584 z->c++;
585 }
586 { int ret = slice_from_s(z, 1, s_0);
587 if (ret < 0) return ret;
588 }
589 continue;
590 lab1:
591 z->c = c2;
592 break;
593 }
594 z->c = c1;
595 }
596
597 { int ret = r_mark_regions(z);
598 if (ret < 0) return ret;
599 }
600 z->lb = z->c; z->c = z->l;
601
602
603 { int mlimit4;
604 if (z->c < z->I[1]) return 0;
605 mlimit4 = z->lb; z->lb = z->I[1];
606 { int m5 = z->l - z->c; (void)m5;
607 { int m6 = z->l - z->c; (void)m6;
608 { int ret = r_perfective_gerund(z);
609 if (ret == 0) goto lab5;
610 if (ret < 0) return ret;
611 }
612 goto lab4;
613 lab5:
614 z->c = z->l - m6;
615 { int m7 = z->l - z->c; (void)m7;
616 { int ret = r_reflexive(z);
617 if (ret == 0) { z->c = z->l - m7; goto lab6; }
618 if (ret < 0) return ret;
619 }
620 lab6:
621 ;
622 }
623 { int m8 = z->l - z->c; (void)m8;
624 { int ret = r_adjectival(z);
625 if (ret == 0) goto lab8;
626 if (ret < 0) return ret;
627 }
628 goto lab7;
629 lab8:
630 z->c = z->l - m8;
631 { int ret = r_verb(z);
632 if (ret == 0) goto lab9;
633 if (ret < 0) return ret;
634 }
635 goto lab7;
636 lab9:
637 z->c = z->l - m8;
638 { int ret = r_noun(z);
639 if (ret == 0) goto lab3;
640 if (ret < 0) return ret;
641 }
642 }
643 lab7:
644 ;
645 }
646 lab4:
647 lab3:
648 z->c = z->l - m5;
649 }
650 { int m9 = z->l - z->c; (void)m9;
651 z->ket = z->c;
652 if (z->c <= z->lb || z->p[z->c - 1] != 0xC9) { z->c = z->l - m9; goto lab10; }
653 z->c--;
654 z->bra = z->c;
655 { int ret = slice_del(z);
656 if (ret < 0) return ret;
657 }
658 lab10:
659 ;
660 }
661 { int m10 = z->l - z->c; (void)m10;
662 { int ret = r_derivational(z);
663 if (ret < 0) return ret;
664 }
665 z->c = z->l - m10;
666 }
667 { int m11 = z->l - z->c; (void)m11;
668 { int ret = r_tidy_up(z);
669 if (ret < 0) return ret;
670 }
671 z->c = z->l - m11;
672 }
673 z->lb = mlimit4;
674 }
675 z->c = z->lb;
676 return 1;
677}
678
679extern struct SN_env * russian_KOI8_R_create_env(void) { return SN_create_env(0, 2); }
680
681extern void russian_KOI8_R_close_env(struct SN_env * z) { SN_close_env(z, 0); }
682
void SN_close_env(struct SN_env *z, int S_size)
Definition: api.c:34
struct SN_env * SN_create_env(int S_size, int I_size)
Definition: api.c:3
unsigned char symbol
Definition: api.h:2
static const symbol s_4_3[3]
static const symbol s_0_2[4]
static const symbol s_1_5[2]
static const symbol s_1_19[2]
static const symbol s_4_37[2]
static const symbol s_4_22[2]
static const symbol s_1_13[2]
static const struct among a_7[4]
static const symbol s_5_30[2]
static const symbol s_0_4[2]
static int r_adjective(struct SN_env *z)
static const struct among a_3[2]
static const symbol s_2_2[2]
static const symbol s_4_18[1]
static const symbol s_1_24[3]
static const symbol s_4_32[2]
static const symbol s_0_5[2]
static const symbol s_1_11[3]
static const symbol s_1_10[3]
static const symbol s_1_9[2]
static const symbol s_5_35[1]
static const symbol s_5_28[1]
static int r_tidy_up(struct SN_env *z)
static const symbol s_1_6[2]
static const symbol s_1_23[2]
static const symbol s_4_29[2]
static const symbol s_4_15[1]
static const symbol s_5_12[2]
static const symbol s_0_8[6]
static const symbol s_5_18[3]
static const symbol s_1_2[2]
static const symbol s_0_6[5]
static const symbol s_3_1[2]
static const symbol s_7_2[1]
static const symbol s_5_27[1]
static const symbol s_1_18[2]
static const symbol s_5_11[2]
static const symbol s_2_3[3]
static const symbol s_5_9[3]
static const symbol s_4_1[2]
static const symbol s_2_0[2]
static const symbol s_4_9[3]
static const symbol s_5_6[2]
static const symbol s_5_16[1]
static const symbol s_1_3[2]
static int r_adjectival(struct SN_env *z)
static const symbol s_1_0[2]
static const symbol s_7_1[1]
static const symbol s_5_17[2]
static int r_verb(struct SN_env *z)
void russian_KOI8_R_close_env(struct SN_env *z)
static const symbol s_3_0[2]
static const symbol s_2_5[1]
static const symbol s_5_4[1]
static const symbol s_1_15[2]
static const symbol s_4_35[3]
static int r_R2(struct SN_env *z)
static const symbol s_5_24[2]
static const struct among a_5[36]
static const symbol s_5_31[1]
static const symbol s_5_8[2]
static const symbol s_1_7[2]
static const struct among a_6[2]
static const symbol s_4_36[2]
static const symbol s_4_30[3]
static const struct among a_2[8]
static const symbol s_5_33[2]
static const symbol s_1_1[2]
static const symbol s_0_0[3]
static const symbol s_4_21[2]
static const symbol s_5_21[2]
static const symbol s_5_22[2]
static const symbol s_4_4[3]
static const symbol s_5_3[1]
static const symbol s_4_6[3]
static int r_derivational(struct SN_env *z)
static const symbol s_1_21[3]
static const symbol s_2_7[3]
static const symbol s_5_7[2]
int russian_KOI8_R_stem(struct SN_env *z)
static const symbol s_4_24[1]
static const symbol s_4_16[2]
static const symbol s_5_14[3]
static const symbol s_4_17[2]
static const struct among a_1[26]
static const symbol s_4_42[3]
static const symbol s_5_23[3]
static int r_perfective_gerund(struct SN_env *z)
static const symbol s_4_43[3]
static const symbol s_4_40[3]
static const symbol s_1_17[2]
static const symbol s_2_4[3]
static const symbol s_4_12[2]
static const struct among a_0[9]
static const symbol s_4_33[3]
static const symbol s_5_25[2]
static const symbol s_4_26[2]
static const symbol s_4_8[3]
static const symbol s_5_20[2]
static const symbol s_4_2[2]
static const symbol s_4_45[3]
static const symbol s_1_14[2]
static const symbol s_4_0[1]
static const symbol s_4_39[2]
static const symbol s_4_19[2]
static const symbol s_4_23[2]
static const symbol s_0_7[6]
static const symbol s_1_8[2]
static const symbol s_5_2[2]
static const symbol s_5_0[1]
static const symbol s_7_0[4]
static const symbol s_1_4[2]
static const symbol s_4_11[4]
static const symbol s_4_25[2]
static const struct among a_4[46]
static const symbol s_4_44[2]
static const symbol s_4_14[3]
static int r_mark_regions(struct SN_env *z)
static const symbol s_7_3[3]
static const symbol s_0_3[1]
static const symbol s_6_0[3]
static const symbol s_5_29[2]
static const symbol s_5_32[2]
static const symbol s_4_13[3]
static const symbol s_5_1[2]
static const symbol s_4_34[2]
static const symbol s_6_1[4]
static const symbol s_1_16[2]
static const symbol s_5_34[1]
static const symbol s_1_25[3]
static const symbol s_4_41[3]
static const symbol s_5_5[2]
static const symbol s_5_13[3]
static const symbol s_4_27[3]
static const symbol s_2_6[2]
static const symbol s_2_1[2]
static const symbol s_5_26[3]
static const unsigned char g_v[]
static const symbol s_1_22[2]
static const symbol s_1_20[3]
static const symbol s_4_7[3]
static int r_reflexive(struct SN_env *z)
static const symbol s_4_31[3]
static const symbol s_5_19[2]
static int r_noun(struct SN_env *z)
struct SN_env * russian_KOI8_R_create_env(void)
static const symbol s_1_12[2]
static const symbol s_5_10[1]
static const symbol s_4_10[4]
static const symbol s_4_28[3]
static const symbol s_0_1[4]
static const symbol s_4_5[2]
static const symbol s_0[]
static const symbol s_4_20[2]
static const symbol s_5_15[4]
static const symbol s_4_38[2]
Definition: api.h:14
int lb
Definition: api.h:16
symbol * p
Definition: api.h:15
int * I
Definition: api.h:18
int ket
Definition: api.h:16
int c
Definition: api.h:16
int bra
Definition: api.h:16
int l
Definition: api.h:16
Definition: header.h:16
int find_among_b(struct SN_env *z, const struct among *v, int v_size)
Definition: utilities.c:298
int slice_del(struct SN_env *z)
Definition: utilities.c:431
int in_grouping(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:167
int out_grouping(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:191
int slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:422