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