YAZ 5.35.1
stem_ISO_8859_1_swedish.c
Go to the documentation of this file.
1
2/* This file was generated automatically by the Snowball to ANSI C compiler */
3
4#include "../runtime/header.h"
5
6#ifdef __cplusplus
7extern "C"
8{
9#endif
10 extern int swedish_ISO_8859_1_stem (struct SN_env *z);
11#ifdef __cplusplus
12}
13#endif
14static int r_other_suffix (struct SN_env *z);
15static int r_consonant_pair (struct SN_env *z);
16static int r_main_suffix (struct SN_env *z);
17static int r_mark_regions (struct SN_env *z);
18#ifdef __cplusplus
19extern "C"
20{
21#endif
22
23
24 extern struct SN_env *swedish_ISO_8859_1_create_env (void);
25 extern void swedish_ISO_8859_1_close_env (struct SN_env *z);
26
27
28#ifdef __cplusplus
29}
30#endif
31static const symbol s_0_0[1] = { 'a' };
32static const symbol s_0_1[4] = { 'a', 'r', 'n', 'a' };
33static const symbol s_0_2[4] = { 'e', 'r', 'n', 'a' };
34static const symbol s_0_3[7] = { 'h', 'e', 't', 'e', 'r', 'n', 'a' };
35static const symbol s_0_4[4] = { 'o', 'r', 'n', 'a' };
36static const symbol s_0_5[2] = { 'a', 'd' };
37static const symbol s_0_6[1] = { 'e' };
38static const symbol s_0_7[3] = { 'a', 'd', 'e' };
39static const symbol s_0_8[4] = { 'a', 'n', 'd', 'e' };
40static const symbol s_0_9[4] = { 'a', 'r', 'n', 'e' };
41static const symbol s_0_10[3] = { 'a', 'r', 'e' };
42static const symbol s_0_11[4] = { 'a', 's', 't', 'e' };
43static const symbol s_0_12[2] = { 'e', 'n' };
44static const symbol s_0_13[5] = { 'a', 'n', 'd', 'e', 'n' };
45static const symbol s_0_14[4] = { 'a', 'r', 'e', 'n' };
46static const symbol s_0_15[5] = { 'h', 'e', 't', 'e', 'n' };
47static const symbol s_0_16[3] = { 'e', 'r', 'n' };
48static const symbol s_0_17[2] = { 'a', 'r' };
49static const symbol s_0_18[2] = { 'e', 'r' };
50static const symbol s_0_19[5] = { 'h', 'e', 't', 'e', 'r' };
51static const symbol s_0_20[2] = { 'o', 'r' };
52static const symbol s_0_21[1] = { 's' };
53static const symbol s_0_22[2] = { 'a', 's' };
54static const symbol s_0_23[5] = { 'a', 'r', 'n', 'a', 's' };
55static const symbol s_0_24[5] = { 'e', 'r', 'n', 'a', 's' };
56static const symbol s_0_25[5] = { 'o', 'r', 'n', 'a', 's' };
57static const symbol s_0_26[2] = { 'e', 's' };
58static const symbol s_0_27[4] = { 'a', 'd', 'e', 's' };
59static const symbol s_0_28[5] = { 'a', 'n', 'd', 'e', 's' };
60static const symbol s_0_29[3] = { 'e', 'n', 's' };
61static const symbol s_0_30[5] = { 'a', 'r', 'e', 'n', 's' };
62static const symbol s_0_31[6] = { 'h', 'e', 't', 'e', 'n', 's' };
63static const symbol s_0_32[4] = { 'e', 'r', 'n', 's' };
64static const symbol s_0_33[2] = { 'a', 't' };
65static const symbol s_0_34[5] = { 'a', 'n', 'd', 'e', 't' };
66static const symbol s_0_35[3] = { 'h', 'e', 't' };
67static const symbol s_0_36[3] = { 'a', 's', 't' };
68
69static const struct among a_0[37] = {
70/* 0 */ {1, s_0_0, -1, 1, 0},
71/* 1 */ {4, s_0_1, 0, 1, 0},
72/* 2 */ {4, s_0_2, 0, 1, 0},
73/* 3 */ {7, s_0_3, 2, 1, 0},
74/* 4 */ {4, s_0_4, 0, 1, 0},
75/* 5 */ {2, s_0_5, -1, 1, 0},
76/* 6 */ {1, s_0_6, -1, 1, 0},
77/* 7 */ {3, s_0_7, 6, 1, 0},
78/* 8 */ {4, s_0_8, 6, 1, 0},
79/* 9 */ {4, s_0_9, 6, 1, 0},
80/* 10 */ {3, s_0_10, 6, 1, 0},
81/* 11 */ {4, s_0_11, 6, 1, 0},
82/* 12 */ {2, s_0_12, -1, 1, 0},
83/* 13 */ {5, s_0_13, 12, 1, 0},
84/* 14 */ {4, s_0_14, 12, 1, 0},
85/* 15 */ {5, s_0_15, 12, 1, 0},
86/* 16 */ {3, s_0_16, -1, 1, 0},
87/* 17 */ {2, s_0_17, -1, 1, 0},
88/* 18 */ {2, s_0_18, -1, 1, 0},
89/* 19 */ {5, s_0_19, 18, 1, 0},
90/* 20 */ {2, s_0_20, -1, 1, 0},
91/* 21 */ {1, s_0_21, -1, 2, 0},
92/* 22 */ {2, s_0_22, 21, 1, 0},
93/* 23 */ {5, s_0_23, 22, 1, 0},
94/* 24 */ {5, s_0_24, 22, 1, 0},
95/* 25 */ {5, s_0_25, 22, 1, 0},
96/* 26 */ {2, s_0_26, 21, 1, 0},
97/* 27 */ {4, s_0_27, 26, 1, 0},
98/* 28 */ {5, s_0_28, 26, 1, 0},
99/* 29 */ {3, s_0_29, 21, 1, 0},
100/* 30 */ {5, s_0_30, 29, 1, 0},
101/* 31 */ {6, s_0_31, 29, 1, 0},
102/* 32 */ {4, s_0_32, 21, 1, 0},
103/* 33 */ {2, s_0_33, -1, 1, 0},
104/* 34 */ {5, s_0_34, -1, 1, 0},
105/* 35 */ {3, s_0_35, -1, 1, 0},
106/* 36 */ {3, s_0_36, -1, 1, 0}
107};
108
109static const symbol s_1_0[2] = { 'd', 'd' };
110static const symbol s_1_1[2] = { 'g', 'd' };
111static const symbol s_1_2[2] = { 'n', 'n' };
112static const symbol s_1_3[2] = { 'd', 't' };
113static const symbol s_1_4[2] = { 'g', 't' };
114static const symbol s_1_5[2] = { 'k', 't' };
115static const symbol s_1_6[2] = { 't', 't' };
116
117static const struct among a_1[7] = {
118/* 0 */ {2, s_1_0, -1, -1, 0},
119/* 1 */ {2, s_1_1, -1, -1, 0},
120/* 2 */ {2, s_1_2, -1, -1, 0},
121/* 3 */ {2, s_1_3, -1, -1, 0},
122/* 4 */ {2, s_1_4, -1, -1, 0},
123/* 5 */ {2, s_1_5, -1, -1, 0},
124/* 6 */ {2, s_1_6, -1, -1, 0}
125};
126
127static const symbol s_2_0[2] = { 'i', 'g' };
128static const symbol s_2_1[3] = { 'l', 'i', 'g' };
129static const symbol s_2_2[3] = { 'e', 'l', 's' };
130static const symbol s_2_3[5] = { 'f', 'u', 'l', 'l', 't' };
131static const symbol s_2_4[4] = { 'l', 0xF6, 's', 't' };
132
133static const struct among a_2[5] = {
134/* 0 */ {2, s_2_0, -1, 1, 0},
135/* 1 */ {3, s_2_1, 0, 1, 0},
136/* 2 */ {3, s_2_2, -1, 1, 0},
137/* 3 */ {5, s_2_3, -1, 3, 0},
138/* 4 */ {4, s_2_4, -1, 2, 0}
139};
140
141static const unsigned char g_v[] =
142 { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32 };
143
144static const unsigned char g_s_ending[] = { 119, 127, 149 };
145
146static const symbol s_0[] = { 'l', 0xF6, 's' };
147static const symbol s_1[] = { 'f', 'u', 'l', 'l' };
148
149static int
151{
152 z->I[0] = z->l;
153 {
154 int c_test = z->c; /* test, line 29 */
155 {
156 int ret = z->c + 3;
157 if (0 > ret || ret > z->l)
158 return 0;
159 z->c = ret; /* hop, line 29 */
160 }
161 z->I[1] = z->c; /* setmark x, line 29 */
162 z->c = c_test;
163 }
164 if (out_grouping (z, g_v, 97, 246, 1) < 0)
165 return 0; /* goto *//* grouping v, line 30 */
166 { /* gopast *//* non v, line 30 */
167 int ret = in_grouping (z, g_v, 97, 246, 1);
168 if (ret < 0)
169 return 0;
170 z->c += ret;
171 }
172 z->I[0] = z->c; /* setmark p1, line 30 */
173 /* try, line 31 */
174 if (!(z->I[0] < z->I[1]))
175 goto lab0;
176 z->I[0] = z->I[1];
177lab0:
178 return 1;
179}
180
181static int
183{
184 int among_var;
185 {
186 int mlimit; /* setlimit, line 37 */
187 int m1 = z->l - z->c;
188 (void) m1;
189 if (z->c < z->I[0])
190 return 0;
191 z->c = z->I[0]; /* tomark, line 37 */
192 mlimit = z->lb;
193 z->lb = z->c;
194 z->c = z->l - m1;
195 z->ket = z->c; /* [, line 37 */
196 if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3
197 || !((1851442 >> (z->p[z->c - 1] & 0x1f)) & 1))
198 {
199 z->lb = mlimit;
200 return 0;
201 }
202 among_var = find_among_b (z, a_0, 37); /* substring, line 37 */
203 if (!(among_var))
204 {
205 z->lb = mlimit;
206 return 0;
207 }
208 z->bra = z->c; /* ], line 37 */
209 z->lb = mlimit;
210 }
211 switch (among_var)
212 {
213 case 0:
214 return 0;
215 case 1:
216 {
217 int ret = slice_del (z); /* delete, line 44 */
218 if (ret < 0)
219 return ret;
220 }
221 break;
222 case 2:
223 if (in_grouping_b (z, g_s_ending, 98, 121, 0))
224 return 0;
225 {
226 int ret = slice_del (z); /* delete, line 46 */
227 if (ret < 0)
228 return ret;
229 }
230 break;
231 }
232 return 1;
233}
234
235static int
237{
238 {
239 int mlimit; /* setlimit, line 50 */
240 int m1 = z->l - z->c;
241 (void) m1;
242 if (z->c < z->I[0])
243 return 0;
244 z->c = z->I[0]; /* tomark, line 50 */
245 mlimit = z->lb;
246 z->lb = z->c;
247 z->c = z->l - m1;
248 {
249 int m2 = z->l - z->c;
250 (void) m2; /* and, line 52 */
251 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3
252 || !((1064976 >> (z->p[z->c - 1] & 0x1f)) & 1))
253 {
254 z->lb = mlimit;
255 return 0;
256 }
257 if (!(find_among_b (z, a_1, 7)))
258 {
259 z->lb = mlimit;
260 return 0;
261 } /* among, line 51 */
262 z->c = z->l - m2;
263 z->ket = z->c; /* [, line 52 */
264 if (z->c <= z->lb)
265 {
266 z->lb = mlimit;
267 return 0;
268 }
269 z->c--; /* next, line 52 */
270 z->bra = z->c; /* ], line 52 */
271 {
272 int ret = slice_del (z); /* delete, line 52 */
273 if (ret < 0)
274 return ret;
275 }
276 }
277 z->lb = mlimit;
278 }
279 return 1;
280}
281
282static int
284{
285 int among_var;
286 {
287 int mlimit; /* setlimit, line 55 */
288 int m1 = z->l - z->c;
289 (void) m1;
290 if (z->c < z->I[0])
291 return 0;
292 z->c = z->I[0]; /* tomark, line 55 */
293 mlimit = z->lb;
294 z->lb = z->c;
295 z->c = z->l - m1;
296 z->ket = z->c; /* [, line 56 */
297 if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3
298 || !((1572992 >> (z->p[z->c - 1] & 0x1f)) & 1))
299 {
300 z->lb = mlimit;
301 return 0;
302 }
303 among_var = find_among_b (z, a_2, 5); /* substring, line 56 */
304 if (!(among_var))
305 {
306 z->lb = mlimit;
307 return 0;
308 }
309 z->bra = z->c; /* ], line 56 */
310 switch (among_var)
311 {
312 case 0:
313 {
314 z->lb = mlimit;
315 return 0;
316 }
317 case 1:
318 {
319 int ret = slice_del (z); /* delete, line 57 */
320 if (ret < 0)
321 return ret;
322 }
323 break;
324 case 2:
325 {
326 int ret = slice_from_s (z, 3, s_0); /* <-, line 58 */
327 if (ret < 0)
328 return ret;
329 }
330 break;
331 case 3:
332 {
333 int ret = slice_from_s (z, 4, s_1); /* <-, line 59 */
334 if (ret < 0)
335 return ret;
336 }
337 break;
338 }
339 z->lb = mlimit;
340 }
341 return 1;
342}
343
344extern int
346{
347 {
348 int c1 = z->c; /* do, line 66 */
349 {
350 int ret = r_mark_regions (z);
351 if (ret == 0)
352 goto lab0; /* call mark_regions, line 66 */
353 if (ret < 0)
354 return ret;
355 }
356 lab0:
357 z->c = c1;
358 }
359 z->lb = z->c;
360 z->c = z->l; /* backwards, line 67 */
361
362 {
363 int m2 = z->l - z->c;
364 (void) m2; /* do, line 68 */
365 {
366 int ret = r_main_suffix (z);
367 if (ret == 0)
368 goto lab1; /* call main_suffix, line 68 */
369 if (ret < 0)
370 return ret;
371 }
372 lab1:
373 z->c = z->l - m2;
374 }
375 {
376 int m3 = z->l - z->c;
377 (void) m3; /* do, line 69 */
378 {
379 int ret = r_consonant_pair (z);
380 if (ret == 0)
381 goto lab2; /* call consonant_pair, line 69 */
382 if (ret < 0)
383 return ret;
384 }
385 lab2:
386 z->c = z->l - m3;
387 }
388 {
389 int m4 = z->l - z->c;
390 (void) m4; /* do, line 70 */
391 {
392 int ret = r_other_suffix (z);
393 if (ret == 0)
394 goto lab3; /* call other_suffix, line 70 */
395 if (ret < 0)
396 return ret;
397 }
398 lab3:
399 z->c = z->l - m4;
400 }
401 z->c = z->lb;
402 return 1;
403}
404
405extern struct SN_env *
407{
408 return SN_create_env (0, 2, 0);
409}
410
411extern void
413{
414 SN_close_env (z, 0);
415}
struct SN_env * SN_create_env(int S_size, int I_size, int B_size)
Definition api.c:6
void SN_close_env(struct SN_env *z, int S_size)
Definition api.c:50
unsigned char symbol
Definition api.h:2
int find_among_b(struct SN_env *z, const struct among *v, int v_size)
Definition utilities.c:400
int slice_del(struct SN_env *z)
Definition utilities.c:573
int in_grouping(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition utilities.c:206
int out_grouping(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition utilities.c:244
int slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition utilities.c:559
int in_grouping_b(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition utilities.c:225
static const symbol s_0_27[4]
static const struct among a_2[5]
static const symbol s_0_2[4]
static const symbol s_1_5[2]
static const symbol s_0_5[2]
static const symbol s_1_6[2]
static const symbol s_0_33[2]
static const symbol s_1_2[2]
static const symbol s_0_10[3]
static int r_other_suffix(struct SN_env *z)
static const symbol s_0_0[1]
static int r_consonant_pair(struct SN_env *z)
static const struct among a_1[7]
static const symbol s_0_35[3]
static const symbol s_0_21[1]
static const symbol s_2_0[2]
static int r_main_suffix(struct SN_env *z)
int swedish_ISO_8859_1_stem(struct SN_env *z)
static const symbol s_1_3[2]
static const symbol s_2_1[3]
static const symbol s_1_0[2]
static const symbol s_0_6[1]
static const symbol s_0_25[5]
static const symbol s_0_15[5]
static const symbol s_0_17[2]
static const struct among a_0[37]
static const symbol s_2_4[4]
static const symbol s_0_23[5]
static const symbol s_0_34[5]
static const symbol s_0_30[5]
static const symbol s_1_1[2]
static const symbol s_0_16[3]
static const symbol s_0_19[5]
static const symbol s_0_18[2]
static const symbol s_0_26[2]
static const symbol s_0_24[5]
static const symbol s_2_3[5]
static const symbol s_0_9[4]
static const symbol s_0_20[2]
static const symbol s_0_4[4]
void swedish_ISO_8859_1_close_env(struct SN_env *z)
struct SN_env * swedish_ISO_8859_1_create_env(void)
static const symbol s_0_11[4]
static const symbol s_0_14[4]
static const symbol s_1[]
static const symbol s_1_4[2]
static const symbol s_2_2[3]
static int r_mark_regions(struct SN_env *z)
static const symbol s_0_8[4]
static const symbol s_0_28[5]
static const symbol s_0_31[6]
static const symbol s_0_12[2]
static const symbol s_0_13[5]
static const symbol s_0_7[3]
static const symbol s_0_36[3]
static const symbol s_0_22[2]
static const unsigned char g_v[]
static const unsigned char g_s_ending[]
static const symbol s_0_29[3]
static const symbol s_0_32[4]
static const symbol s_0_1[4]
static const symbol s_0[]
static const symbol s_0_3[7]
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