PostgreSQL Source Code git master
stem_UTF_8_polish.c
Go to the documentation of this file.
1/* Generated from polish.sbl by Snowball 3.0.0 - https://snowballstem.org/ */
2
3#include "stem_UTF_8_polish.h"
4
5#include <stddef.h>
6
7#include "snowball_runtime.h"
8
9struct SN_local {
10 struct SN_env z;
11 int i_p1;
12};
13
14typedef struct SN_local SN_local;
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19extern int polish_UTF_8_stem(struct SN_env * z);
20#ifdef __cplusplus
21}
22#endif
23
24static int r_R1(struct SN_env * z);
25static int r_normalize_consonant(struct SN_env * z);
26static int r_remove_endings(struct SN_env * z);
27static int r_mark_regions(struct SN_env * z);
28
29static const symbol s_0[] = { 's' };
30static const symbol s_1[] = { 's' };
31static const symbol s_2[] = { 0xC5, 0x82 };
32static const symbol s_3[] = { 's' };
33static const symbol s_4[] = { 'c' };
34static const symbol s_5[] = { 'n' };
35static const symbol s_6[] = { 's' };
36static const symbol s_7[] = { 'z' };
37
38static const symbol s_0_0[7] = { 'b', 'y', 0xC5, 0x9B, 'c', 'i', 'e' };
39static const symbol s_0_1[3] = { 'b', 'y', 'm' };
40static const symbol s_0_2[2] = { 'b', 'y' };
41static const symbol s_0_3[6] = { 'b', 'y', 0xC5, 0x9B, 'm', 'y' };
42static const symbol s_0_4[4] = { 'b', 'y', 0xC5, 0x9B };
43static const struct among a_0[5] = {
44{ 7, s_0_0, 0, 1, 0},
45{ 3, s_0_1, 0, 1, 0},
46{ 2, s_0_2, 0, 1, 0},
47{ 6, s_0_3, 0, 1, 0},
48{ 4, s_0_4, 0, 1, 0}
49};
50
51static const symbol s_1_0[3] = { 0xC4, 0x85, 'c' };
52static const symbol s_1_1[5] = { 'a', 'j', 0xC4, 0x85, 'c' };
53static const symbol s_1_2[5] = { 's', 'z', 0xC4, 0x85, 'c' };
54static const symbol s_1_3[2] = { 's', 'z' };
55static const symbol s_1_4[5] = { 'i', 'e', 'j', 's', 'z' };
56static const struct among a_1[5] = {
57{ 3, s_1_0, 0, 1, 0},
58{ 5, s_1_1, -1, 1, 0},
59{ 5, s_1_2, -2, 2, 0},
60{ 2, s_1_3, 0, 1, 0},
61{ 5, s_1_4, -1, 1, 0}
62};
63
64static const symbol s_2_0[1] = { 'a' };
65static const symbol s_2_1[4] = { 0xC4, 0x85, 'c', 'a' };
66static const symbol s_2_2[6] = { 'a', 'j', 0xC4, 0x85, 'c', 'a' };
67static const symbol s_2_3[6] = { 's', 'z', 0xC4, 0x85, 'c', 'a' };
68static const symbol s_2_4[2] = { 'i', 'a' };
69static const symbol s_2_5[3] = { 's', 'z', 'a' };
70static const symbol s_2_6[6] = { 'i', 'e', 'j', 's', 'z', 'a' };
71static const symbol s_2_7[4] = { 'a', 0xC5, 0x82, 'a' };
72static const symbol s_2_8[5] = { 'i', 'a', 0xC5, 0x82, 'a' };
73static const symbol s_2_9[4] = { 'i', 0xC5, 0x82, 'a' };
74static const symbol s_2_10[3] = { 0xC4, 0x85, 'c' };
75static const symbol s_2_11[5] = { 'a', 'j', 0xC4, 0x85, 'c' };
76static const symbol s_2_12[1] = { 'e' };
77static const symbol s_2_13[4] = { 0xC4, 0x85, 'c', 'e' };
78static const symbol s_2_14[6] = { 'a', 'j', 0xC4, 0x85, 'c', 'e' };
79static const symbol s_2_15[6] = { 's', 'z', 0xC4, 0x85, 'c', 'e' };
80static const symbol s_2_16[2] = { 'i', 'e' };
81static const symbol s_2_17[3] = { 'c', 'i', 'e' };
82static const symbol s_2_18[4] = { 'a', 'c', 'i', 'e' };
83static const symbol s_2_19[4] = { 'e', 'c', 'i', 'e' };
84static const symbol s_2_20[4] = { 'i', 'c', 'i', 'e' };
85static const symbol s_2_21[5] = { 'a', 'j', 'c', 'i', 'e' };
86static const symbol s_2_22[7] = { 'l', 'i', 0xC5, 0x9B, 'c', 'i', 'e' };
87static const symbol s_2_23[8] = { 'a', 'l', 'i', 0xC5, 0x9B, 'c', 'i', 'e' };
88static const symbol s_2_24[9] = { 'i', 'e', 'l', 'i', 0xC5, 0x9B, 'c', 'i', 'e' };
89static const symbol s_2_25[8] = { 'i', 'l', 'i', 0xC5, 0x9B, 'c', 'i', 'e' };
90static const symbol s_2_26[8] = { 0xC5, 0x82, 'y', 0xC5, 0x9B, 'c', 'i', 'e' };
91static const symbol s_2_27[9] = { 'a', 0xC5, 0x82, 'y', 0xC5, 0x9B, 'c', 'i', 'e' };
92static const symbol s_2_28[10] = { 'i', 'a', 0xC5, 0x82, 'y', 0xC5, 0x9B, 'c', 'i', 'e' };
93static const symbol s_2_29[9] = { 'i', 0xC5, 0x82, 'y', 0xC5, 0x9B, 'c', 'i', 'e' };
94static const symbol s_2_30[3] = { 's', 'z', 'e' };
95static const symbol s_2_31[6] = { 'i', 'e', 'j', 's', 'z', 'e' };
96static const symbol s_2_32[3] = { 'a', 'c', 'h' };
97static const symbol s_2_33[4] = { 'i', 'a', 'c', 'h' };
98static const symbol s_2_34[3] = { 'i', 'c', 'h' };
99static const symbol s_2_35[3] = { 'y', 'c', 'h' };
100static const symbol s_2_36[1] = { 'i' };
101static const symbol s_2_37[3] = { 'a', 'l', 'i' };
102static const symbol s_2_38[4] = { 'i', 'e', 'l', 'i' };
103static const symbol s_2_39[3] = { 'i', 'l', 'i' };
104static const symbol s_2_40[3] = { 'a', 'm', 'i' };
105static const symbol s_2_41[4] = { 'i', 'a', 'm', 'i' };
106static const symbol s_2_42[3] = { 'i', 'm', 'i' };
107static const symbol s_2_43[3] = { 'y', 'm', 'i' };
108static const symbol s_2_44[3] = { 'o', 'w', 'i' };
109static const symbol s_2_45[4] = { 'i', 'o', 'w', 'i' };
110static const symbol s_2_46[2] = { 'a', 'j' };
111static const symbol s_2_47[2] = { 'e', 'j' };
112static const symbol s_2_48[3] = { 'i', 'e', 'j' };
113static const symbol s_2_49[2] = { 'a', 'm' };
114static const symbol s_2_50[5] = { 'a', 0xC5, 0x82, 'a', 'm' };
115static const symbol s_2_51[6] = { 'i', 'a', 0xC5, 0x82, 'a', 'm' };
116static const symbol s_2_52[5] = { 'i', 0xC5, 0x82, 'a', 'm' };
117static const symbol s_2_53[2] = { 'e', 'm' };
118static const symbol s_2_54[3] = { 'i', 'e', 'm' };
119static const symbol s_2_55[5] = { 'a', 0xC5, 0x82, 'e', 'm' };
120static const symbol s_2_56[6] = { 'i', 'a', 0xC5, 0x82, 'e', 'm' };
121static const symbol s_2_57[5] = { 'i', 0xC5, 0x82, 'e', 'm' };
122static const symbol s_2_58[2] = { 'i', 'm' };
123static const symbol s_2_59[2] = { 'o', 'm' };
124static const symbol s_2_60[3] = { 'i', 'o', 'm' };
125static const symbol s_2_61[2] = { 'y', 'm' };
126static const symbol s_2_62[1] = { 'o' };
127static const symbol s_2_63[3] = { 'e', 'g', 'o' };
128static const symbol s_2_64[4] = { 'i', 'e', 'g', 'o' };
129static const symbol s_2_65[4] = { 'a', 0xC5, 0x82, 'o' };
130static const symbol s_2_66[5] = { 'i', 'a', 0xC5, 0x82, 'o' };
131static const symbol s_2_67[4] = { 'i', 0xC5, 0x82, 'o' };
132static const symbol s_2_68[1] = { 'u' };
133static const symbol s_2_69[2] = { 'i', 'u' };
134static const symbol s_2_70[3] = { 'e', 'm', 'u' };
135static const symbol s_2_71[4] = { 'i', 'e', 'm', 'u' };
136static const symbol s_2_72[3] = { 0xC3, 0xB3, 'w' };
137static const symbol s_2_73[1] = { 'y' };
138static const symbol s_2_74[3] = { 'a', 'm', 'y' };
139static const symbol s_2_75[3] = { 'e', 'm', 'y' };
140static const symbol s_2_76[3] = { 'i', 'm', 'y' };
141static const symbol s_2_77[6] = { 'l', 'i', 0xC5, 0x9B, 'm', 'y' };
142static const symbol s_2_78[7] = { 'a', 'l', 'i', 0xC5, 0x9B, 'm', 'y' };
143static const symbol s_2_79[8] = { 'i', 'e', 'l', 'i', 0xC5, 0x9B, 'm', 'y' };
144static const symbol s_2_80[7] = { 'i', 'l', 'i', 0xC5, 0x9B, 'm', 'y' };
145static const symbol s_2_81[7] = { 0xC5, 0x82, 'y', 0xC5, 0x9B, 'm', 'y' };
146static const symbol s_2_82[8] = { 'a', 0xC5, 0x82, 'y', 0xC5, 0x9B, 'm', 'y' };
147static const symbol s_2_83[9] = { 'i', 'a', 0xC5, 0x82, 'y', 0xC5, 0x9B, 'm', 'y' };
148static const symbol s_2_84[8] = { 'i', 0xC5, 0x82, 'y', 0xC5, 0x9B, 'm', 'y' };
149static const symbol s_2_85[4] = { 'a', 0xC5, 0x82, 'y' };
150static const symbol s_2_86[5] = { 'i', 'a', 0xC5, 0x82, 'y' };
151static const symbol s_2_87[4] = { 'i', 0xC5, 0x82, 'y' };
152static const symbol s_2_88[3] = { 'a', 's', 'z' };
153static const symbol s_2_89[3] = { 'e', 's', 'z' };
154static const symbol s_2_90[3] = { 'i', 's', 'z' };
155static const symbol s_2_91[3] = { 'a', 0xC5, 0x82 };
156static const symbol s_2_92[4] = { 'i', 'a', 0xC5, 0x82 };
157static const symbol s_2_93[3] = { 'i', 0xC5, 0x82 };
158static const symbol s_2_94[2] = { 0xC4, 0x85 };
159static const symbol s_2_95[5] = { 0xC4, 0x85, 'c', 0xC4, 0x85 };
160static const symbol s_2_96[7] = { 'a', 'j', 0xC4, 0x85, 'c', 0xC4, 0x85 };
161static const symbol s_2_97[7] = { 's', 'z', 0xC4, 0x85, 'c', 0xC4, 0x85 };
162static const symbol s_2_98[3] = { 'i', 0xC4, 0x85 };
163static const symbol s_2_99[4] = { 'a', 'j', 0xC4, 0x85 };
164static const symbol s_2_100[4] = { 's', 'z', 0xC4, 0x85 };
165static const symbol s_2_101[7] = { 'i', 'e', 'j', 's', 'z', 0xC4, 0x85 };
166static const symbol s_2_102[3] = { 'a', 0xC4, 0x87 };
167static const symbol s_2_103[4] = { 'i', 'e', 0xC4, 0x87 };
168static const symbol s_2_104[3] = { 'i', 0xC4, 0x87 };
169static const symbol s_2_105[4] = { 0xC4, 0x85, 0xC4, 0x87 };
170static const symbol s_2_106[5] = { 'a', 0xC5, 0x9B, 0xC4, 0x87 };
171static const symbol s_2_107[5] = { 'e', 0xC5, 0x9B, 0xC4, 0x87 };
172static const symbol s_2_108[2] = { 0xC4, 0x99 };
173static const symbol s_2_109[4] = { 's', 'z', 0xC4, 0x99 };
174static const symbol s_2_110[5] = { 0xC5, 0x82, 'a', 0xC5, 0x9B };
175static const symbol s_2_111[6] = { 'a', 0xC5, 0x82, 'a', 0xC5, 0x9B };
176static const symbol s_2_112[7] = { 'i', 'a', 0xC5, 0x82, 'a', 0xC5, 0x9B };
177static const symbol s_2_113[6] = { 'i', 0xC5, 0x82, 'a', 0xC5, 0x9B };
178static const symbol s_2_114[5] = { 0xC5, 0x82, 'e', 0xC5, 0x9B };
179static const symbol s_2_115[6] = { 'a', 0xC5, 0x82, 'e', 0xC5, 0x9B };
180static const symbol s_2_116[7] = { 'i', 'a', 0xC5, 0x82, 'e', 0xC5, 0x9B };
181static const symbol s_2_117[6] = { 'i', 0xC5, 0x82, 'e', 0xC5, 0x9B };
182static const struct among a_2[118] = {
183{ 1, s_2_0, 0, 1, 1},
184{ 4, s_2_1, -1, 1, 0},
185{ 6, s_2_2, -1, 1, 0},
186{ 6, s_2_3, -2, 2, 0},
187{ 2, s_2_4, -4, 1, 1},
188{ 3, s_2_5, -5, 1, 0},
189{ 6, s_2_6, -1, 1, 0},
190{ 4, s_2_7, -7, 1, 0},
191{ 5, s_2_8, -1, 1, 0},
192{ 4, s_2_9, -9, 1, 0},
193{ 3, s_2_10, 0, 1, 0},
194{ 5, s_2_11, -1, 1, 0},
195{ 1, s_2_12, 0, 1, 1},
196{ 4, s_2_13, -1, 1, 0},
197{ 6, s_2_14, -1, 1, 0},
198{ 6, s_2_15, -2, 2, 0},
199{ 2, s_2_16, -4, 1, 1},
200{ 3, s_2_17, -1, 1, 0},
201{ 4, s_2_18, -1, 1, 0},
202{ 4, s_2_19, -2, 1, 0},
203{ 4, s_2_20, -3, 1, 0},
204{ 5, s_2_21, -4, 1, 0},
205{ 7, s_2_22, -5, 4, 0},
206{ 8, s_2_23, -1, 1, 0},
207{ 9, s_2_24, -2, 1, 0},
208{ 8, s_2_25, -3, 1, 0},
209{ 8, s_2_26, -9, 4, 0},
210{ 9, s_2_27, -1, 1, 0},
211{ 10, s_2_28, -1, 1, 0},
212{ 9, s_2_29, -3, 1, 0},
213{ 3, s_2_30, -18, 1, 0},
214{ 6, s_2_31, -1, 1, 0},
215{ 3, s_2_32, 0, 1, 1},
216{ 4, s_2_33, -1, 1, 1},
217{ 3, s_2_34, 0, 5, 0},
218{ 3, s_2_35, 0, 5, 0},
219{ 1, s_2_36, 0, 1, 1},
220{ 3, s_2_37, -1, 1, 0},
221{ 4, s_2_38, -2, 1, 0},
222{ 3, s_2_39, -3, 1, 0},
223{ 3, s_2_40, -4, 1, 1},
224{ 4, s_2_41, -1, 1, 1},
225{ 3, s_2_42, -6, 5, 0},
226{ 3, s_2_43, -7, 5, 0},
227{ 3, s_2_44, -8, 1, 1},
228{ 4, s_2_45, -1, 1, 1},
229{ 2, s_2_46, 0, 1, 0},
230{ 2, s_2_47, 0, 5, 0},
231{ 3, s_2_48, -1, 5, 0},
232{ 2, s_2_49, 0, 1, 0},
233{ 5, s_2_50, -1, 1, 0},
234{ 6, s_2_51, -1, 1, 0},
235{ 5, s_2_52, -3, 1, 0},
236{ 2, s_2_53, 0, 1, 1},
237{ 3, s_2_54, -1, 1, 1},
238{ 5, s_2_55, -2, 1, 0},
239{ 6, s_2_56, -1, 1, 0},
240{ 5, s_2_57, -4, 1, 0},
241{ 2, s_2_58, 0, 5, 0},
242{ 2, s_2_59, 0, 1, 1},
243{ 3, s_2_60, -1, 1, 1},
244{ 2, s_2_61, 0, 5, 0},
245{ 1, s_2_62, 0, 1, 1},
246{ 3, s_2_63, -1, 5, 0},
247{ 4, s_2_64, -1, 5, 0},
248{ 4, s_2_65, -3, 1, 0},
249{ 5, s_2_66, -1, 1, 0},
250{ 4, s_2_67, -5, 1, 0},
251{ 1, s_2_68, 0, 1, 1},
252{ 2, s_2_69, -1, 1, 1},
253{ 3, s_2_70, -2, 5, 0},
254{ 4, s_2_71, -1, 5, 0},
255{ 3, s_2_72, 0, 1, 1},
256{ 1, s_2_73, 0, 5, 0},
257{ 3, s_2_74, -1, 1, 0},
258{ 3, s_2_75, -2, 1, 0},
259{ 3, s_2_76, -3, 1, 0},
260{ 6, s_2_77, -4, 4, 0},
261{ 7, s_2_78, -1, 1, 0},
262{ 8, s_2_79, -2, 1, 0},
263{ 7, s_2_80, -3, 1, 0},
264{ 7, s_2_81, -8, 4, 0},
265{ 8, s_2_82, -1, 1, 0},
266{ 9, s_2_83, -1, 1, 0},
267{ 8, s_2_84, -3, 1, 0},
268{ 4, s_2_85, -12, 1, 0},
269{ 5, s_2_86, -1, 1, 0},
270{ 4, s_2_87, -14, 1, 0},
271{ 3, s_2_88, 0, 1, 0},
272{ 3, s_2_89, 0, 1, 0},
273{ 3, s_2_90, 0, 1, 0},
274{ 3, s_2_91, 0, 1, 0},
275{ 4, s_2_92, -1, 1, 0},
276{ 3, s_2_93, 0, 1, 0},
277{ 2, s_2_94, 0, 1, 1},
278{ 5, s_2_95, -1, 1, 0},
279{ 7, s_2_96, -1, 1, 0},
280{ 7, s_2_97, -2, 2, 0},
281{ 3, s_2_98, -4, 1, 1},
282{ 4, s_2_99, -5, 1, 0},
283{ 4, s_2_100, -6, 3, 0},
284{ 7, s_2_101, -1, 1, 0},
285{ 3, s_2_102, 0, 1, 0},
286{ 4, s_2_103, 0, 1, 0},
287{ 3, s_2_104, 0, 1, 0},
288{ 4, s_2_105, 0, 1, 0},
289{ 5, s_2_106, 0, 1, 0},
290{ 5, s_2_107, 0, 1, 0},
291{ 2, s_2_108, 0, 1, 0},
292{ 4, s_2_109, -1, 2, 0},
293{ 5, s_2_110, 0, 4, 0},
294{ 6, s_2_111, -1, 1, 0},
295{ 7, s_2_112, -1, 1, 0},
296{ 6, s_2_113, -3, 1, 0},
297{ 5, s_2_114, 0, 4, 0},
298{ 6, s_2_115, -1, 1, 0},
299{ 7, s_2_116, -1, 1, 0},
300{ 6, s_2_117, -3, 1, 0}
301};
302
303static const symbol s_3_0[2] = { 0xC5, 0x84 };
304static const symbol s_3_1[2] = { 0xC4, 0x87 };
305static const symbol s_3_2[2] = { 0xC5, 0x9B };
306static const symbol s_3_3[2] = { 0xC5, 0xBA };
307static const struct among a_3[4] = {
308{ 2, s_3_0, 0, 2, 0},
309{ 2, s_3_1, 0, 1, 0},
310{ 2, s_3_2, 0, 3, 0},
311{ 2, s_3_3, 0, 4, 0}
312};
313
314static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 16, 0, 0, 1 };
315
316static int r_mark_regions(struct SN_env * z) {
317 ((SN_local *)z)->i_p1 = z->l;
318 {
319 int ret = out_grouping_U(z, g_v, 97, 281, 1);
320 if (ret < 0) return 0;
321 z->c += ret;
322 }
323 {
324 int ret = in_grouping_U(z, g_v, 97, 281, 1);
325 if (ret < 0) return 0;
326 z->c += ret;
327 }
328 ((SN_local *)z)->i_p1 = z->c;
329 return 1;
330}
331
332static int r_R1(struct SN_env * z) {
333 return ((SN_local *)z)->i_p1 <= z->c;
334}
335
336static int r_remove_endings(struct SN_env * z) {
337 int among_var;
338 {
339 int v_1 = z->l - z->c;
340 {
341 int v_2;
342 if (z->c < ((SN_local *)z)->i_p1) goto lab0;
343 v_2 = z->lb; z->lb = ((SN_local *)z)->i_p1;
344 z->ket = z->c;
345 if (!find_among_b(z, a_0, 5, 0)) { z->lb = v_2; goto lab0; }
346 z->bra = z->c;
347 z->lb = v_2;
348 }
349 {
350 int ret = slice_del(z);
351 if (ret < 0) return ret;
352 }
353 lab0:
354 z->c = z->l - v_1;
355 }
356 z->ket = z->c;
357 among_var = find_among_b(z, a_2, 118, r_R1);
358 if (!among_var) return 0;
359 z->bra = z->c;
360 switch (among_var) {
361 case 1:
362 {
363 int ret = slice_del(z);
364 if (ret < 0) return ret;
365 }
366 break;
367 case 2:
368 {
369 int ret = slice_from_s(z, 1, s_0);
370 if (ret < 0) return ret;
371 }
372 break;
373 case 3:
374 do {
375 int v_3 = z->l - z->c;
376 {
377 int v_4 = z->l - z->c;
378 {
379 int ret = r_R1(z);
380 if (ret == 0) goto lab1;
381 if (ret < 0) return ret;
382 }
383 z->c = z->l - v_4;
384 {
385 int ret = slice_del(z);
386 if (ret < 0) return ret;
387 }
388 }
389 break;
390 lab1:
391 z->c = z->l - v_3;
392 {
393 int ret = slice_from_s(z, 1, s_1);
394 if (ret < 0) return ret;
395 }
396 } while (0);
397 break;
398 case 4:
399 {
400 int ret = slice_from_s(z, 2, s_2);
401 if (ret < 0) return ret;
402 }
403 break;
404 case 5:
405 {
406 int ret = slice_del(z);
407 if (ret < 0) return ret;
408 }
409 {
410 int v_5 = z->l - z->c;
411 z->ket = z->c;
412 if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 99 && z->p[z->c - 1] != 122)) { z->c = z->l - v_5; goto lab2; }
413 among_var = find_among_b(z, a_1, 5, 0);
414 if (!among_var) { z->c = z->l - v_5; goto lab2; }
415 z->bra = z->c;
416 switch (among_var) {
417 case 1:
418 {
419 int ret = slice_del(z);
420 if (ret < 0) return ret;
421 }
422 break;
423 case 2:
424 {
425 int ret = slice_from_s(z, 1, s_3);
426 if (ret < 0) return ret;
427 }
428 break;
429 }
430 lab2:
431 ;
432 }
433 break;
434 }
435 return 1;
436}
437
438static int r_normalize_consonant(struct SN_env * z) {
439 int among_var;
440 z->ket = z->c;
441 among_var = find_among_b(z, a_3, 4, 0);
442 if (!among_var) return 0;
443 z->bra = z->c;
444 if (z->c > z->lb) goto lab0;
445 return 0;
446lab0:
447 switch (among_var) {
448 case 1:
449 {
450 int ret = slice_from_s(z, 1, s_4);
451 if (ret < 0) return ret;
452 }
453 break;
454 case 2:
455 {
456 int ret = slice_from_s(z, 1, s_5);
457 if (ret < 0) return ret;
458 }
459 break;
460 case 3:
461 {
462 int ret = slice_from_s(z, 1, s_6);
463 if (ret < 0) return ret;
464 }
465 break;
466 case 4:
467 {
468 int ret = slice_from_s(z, 1, s_7);
469 if (ret < 0) return ret;
470 }
471 break;
472 }
473 return 1;
474}
475
476extern int polish_UTF_8_stem(struct SN_env * z) {
477 {
478 int v_1 = z->c;
479 {
480 int ret = r_mark_regions(z);
481 if (ret < 0) return ret;
482 }
483 z->c = v_1;
484 }
485 do {
486 int v_2 = z->c;
487 {
488 int ret = skip_utf8(z->p, z->c, z->l, 2);
489 if (ret < 0) goto lab0;
490 z->c = ret;
491 }
492 z->lb = z->c; z->c = z->l;
493 {
494 int ret = r_remove_endings(z);
495 if (ret == 0) goto lab0;
496 if (ret < 0) return ret;
497 }
498 z->c = z->lb;
499 break;
500 lab0:
501 z->c = v_2;
502 z->lb = z->c; z->c = z->l;
503 {
504 int ret = r_normalize_consonant(z);
505 if (ret <= 0) return ret;
506 }
507 z->c = z->lb;
508 } while (0);
509 return 1;
510}
511
512extern struct SN_env * polish_UTF_8_create_env(void) {
513 struct SN_env * z = SN_new_env(sizeof(SN_local));
514 if (z) {
515 ((SN_local *)z)->i_p1 = 0;
516 }
517 return z;
518}
519
520extern void polish_UTF_8_close_env(struct SN_env * z) {
521 SN_delete_env(z);
522}
523
void SN_delete_env(struct SN_env *z)
Definition: api.c:18
struct SN_env * SN_new_env(int alloc_size)
Definition: api.c:5
unsigned char symbol
Definition: api.h:4
static const symbol s_2[]
static const symbol s_2_96[7]
static const symbol s_2_74[3]
static const symbol s_2_68[1]
int polish_UTF_8_stem(struct SN_env *z)
static const symbol s_2_85[4]
static const symbol s_2_115[6]
static const symbol s_2_113[6]
static const symbol s_2_87[4]
static const symbol s_1_2[5]
static const symbol s_4[]
static const symbol s_2_84[8]
static const symbol s_2_12[1]
static const symbol s_2_107[5]
static const symbol s_2_39[3]
static const symbol s_2_29[9]
static const symbol s_2_93[3]
struct SN_env * polish_UTF_8_create_env(void)
static const symbol s_2_33[4]
static const symbol s_2_32[3]
static const symbol s_2_112[7]
static const symbol s_2_79[8]
static const symbol s_2_59[2]
static const symbol s_3_1[2]
static const symbol s_2_64[4]
static const symbol s_2_44[3]
static int r_normalize_consonant(struct SN_env *z)
static const symbol s_2_99[4]
static const symbol s_2_73[1]
static const symbol s_2_80[7]
static const symbol s_2_24[9]
static const symbol s_2_0[1]
static const symbol s_2_35[3]
static const symbol s_1_3[2]
static const symbol s_2_37[3]
static const symbol s_2_108[2]
static const symbol s_2_67[4]
void polish_UTF_8_close_env(struct SN_env *z)
static const struct among a_3[4]
static const symbol s_6[]
static const symbol s_2_95[5]
static const struct among a_2[118]
static const symbol s_3[]
static const symbol s_3_0[2]
static const symbol s_2_28[10]
static const symbol s_2_14[6]
static const symbol s_2_61[2]
static const symbol s_2_63[3]
static const symbol s_2_94[2]
static const symbol s_0_0[7]
static const symbol s_2_65[4]
static const symbol s_2_41[4]
static const symbol s_2_10[3]
static const symbol s_2_7[4]
static const symbol s_2_81[7]
static const symbol s_2_34[3]
static const symbol s_7[]
static const symbol s_2_8[5]
static const struct among a_0[5]
static const symbol s_2_38[4]
static const symbol s_2_45[4]
static const symbol s_2_100[4]
static const symbol s_2_47[2]
static const symbol s_2_97[7]
static const symbol s_2_86[5]
static const symbol s_2_76[3]
static const symbol s_2_49[2]
static const symbol s_2_13[4]
static const symbol s_2_3[6]
static const symbol s_2_78[7]
static const symbol s_2_30[3]
static const symbol s_2_25[8]
static const symbol s_2_54[3]
static const symbol s_2_1[4]
static const symbol s_2_53[2]
static const struct among a_1[5]
static const symbol s_0_1[3]
static const symbol s_2_60[3]
static const symbol s_2_82[8]
static const symbol s_2_89[3]
static const symbol s_2_90[3]
static const symbol s_0_4[4]
static const symbol s_3_3[2]
static const symbol s_2_18[4]
static const symbol s_2_98[3]
static const symbol s_2_40[3]
static const symbol s_2_6[6]
static int r_R1(struct SN_env *z)
static const symbol s_2_50[5]
static const symbol s_2_88[3]
static const symbol s_2_62[1]
static const symbol s_2_102[3]
static const symbol s_2_91[3]
static const symbol s_2_66[5]
static const symbol s_2_51[6]
static const symbol s_2_52[5]
static const symbol s_0_3[6]
static const symbol s_2_31[6]
static const symbol s_2_4[2]
static const symbol s_2_17[3]
static const symbol s_2_111[6]
static const symbol s_1[]
static const symbol s_2_9[4]
static const symbol s_2_101[7]
static const symbol s_2_104[3]
static const symbol s_2_117[6]
static const symbol s_2_114[5]
static const symbol s_2_69[2]
static const symbol s_2_58[2]
static const symbol s_2_71[4]
static int r_mark_regions(struct SN_env *z)
static const symbol s_2_110[5]
static const symbol s_2_22[7]
static const symbol s_2_72[3]
static const symbol s_1_0[3]
static const symbol s_2_70[3]
static const symbol s_2_16[2]
static const symbol s_2_57[5]
static const symbol s_2_21[5]
static const symbol s_2_20[4]
static const symbol s_0_2[2]
static const symbol s_1_1[5]
static const symbol s_2_5[3]
static const symbol s_2_42[3]
static const symbol s_2_11[5]
static const symbol s_2_116[7]
static const symbol s_2_26[8]
static const symbol s_1_4[5]
static const symbol s_2_46[2]
static const symbol s_2_2[6]
static const symbol s_2_105[4]
static const symbol s_2_75[3]
static const symbol s_2_109[4]
static const symbol s_2_23[8]
static const symbol s_2_92[4]
static const symbol s_2_83[9]
static const symbol s_2_103[4]
static const unsigned char g_v[]
static const symbol s_2_56[6]
static const symbol s_3_2[2]
static const symbol s_5[]
static const symbol s_2_36[1]
static const symbol s_2_55[5]
static const symbol s_2_15[6]
static int r_remove_endings(struct SN_env *z)
static const symbol s_2_43[3]
static const symbol s_2_106[5]
static const symbol s_2_19[4]
static const symbol s_2_48[3]
static const symbol s_2_77[6]
static const symbol s_0[]
static const symbol s_2_27[9]
Definition: api.h:15
int lb
Definition: api.h:17
symbol * p
Definition: api.h:16
int ket
Definition: api.h:17
int c
Definition: api.h:17
int bra
Definition: api.h:17
int l
Definition: api.h:17
struct SN_env z
int out_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:157
int in_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:133
SNOWBALL_ERR slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:432
int find_among_b(struct SN_env *z, const struct among *v, int v_size, int(*call_among_func)(struct SN_env *))
Definition: utilities.c:315
SNOWBALL_ERR slice_del(struct SN_env *z)
Definition: utilities.c:443
int skip_utf8(const symbol *p, int c, int limit, int n)
Definition: utilities.c:43