2
/* This file was generated automatically by the Snowball to ANSI C compiler */
6
extern int danish_ISO_8859_1_stem(struct SN_env * z);
7
static int r_undouble(struct SN_env * z);
8
static int r_other_suffix(struct SN_env * z);
9
static int r_consonant_pair(struct SN_env * z);
10
static int r_main_suffix(struct SN_env * z);
11
static int r_mark_regions(struct SN_env * z);
13
extern struct SN_env * danish_ISO_8859_1_create_env(void);
14
extern void danish_ISO_8859_1_close_env(struct SN_env * z);
16
static symbol s_0_0[3] = { 'h', 'e', 'd' };
17
static symbol s_0_1[5] = { 'e', 't', 'h', 'e', 'd' };
18
static symbol s_0_2[4] = { 'e', 'r', 'e', 'd' };
19
static symbol s_0_3[1] = { 'e' };
20
static symbol s_0_4[5] = { 'e', 'r', 'e', 'd', 'e' };
21
static symbol s_0_5[4] = { 'e', 'n', 'd', 'e' };
22
static symbol s_0_6[6] = { 'e', 'r', 'e', 'n', 'd', 'e' };
23
static symbol s_0_7[3] = { 'e', 'n', 'e' };
24
static symbol s_0_8[4] = { 'e', 'r', 'n', 'e' };
25
static symbol s_0_9[3] = { 'e', 'r', 'e' };
26
static symbol s_0_10[2] = { 'e', 'n' };
27
static symbol s_0_11[5] = { 'h', 'e', 'd', 'e', 'n' };
28
static symbol s_0_12[4] = { 'e', 'r', 'e', 'n' };
29
static symbol s_0_13[2] = { 'e', 'r' };
30
static symbol s_0_14[5] = { 'h', 'e', 'd', 'e', 'r' };
31
static symbol s_0_15[4] = { 'e', 'r', 'e', 'r' };
32
static symbol s_0_16[1] = { 's' };
33
static symbol s_0_17[4] = { 'h', 'e', 'd', 's' };
34
static symbol s_0_18[2] = { 'e', 's' };
35
static symbol s_0_19[5] = { 'e', 'n', 'd', 'e', 's' };
36
static symbol s_0_20[7] = { 'e', 'r', 'e', 'n', 'd', 'e', 's' };
37
static symbol s_0_21[4] = { 'e', 'n', 'e', 's' };
38
static symbol s_0_22[5] = { 'e', 'r', 'n', 'e', 's' };
39
static symbol s_0_23[4] = { 'e', 'r', 'e', 's' };
40
static symbol s_0_24[3] = { 'e', 'n', 's' };
41
static symbol s_0_25[6] = { 'h', 'e', 'd', 'e', 'n', 's' };
42
static symbol s_0_26[5] = { 'e', 'r', 'e', 'n', 's' };
43
static symbol s_0_27[3] = { 'e', 'r', 's' };
44
static symbol s_0_28[3] = { 'e', 't', 's' };
45
static symbol s_0_29[5] = { 'e', 'r', 'e', 't', 's' };
46
static symbol s_0_30[2] = { 'e', 't' };
47
static symbol s_0_31[4] = { 'e', 'r', 'e', 't' };
49
static struct among a_0[32] =
51
/* 0 */ { 3, s_0_0, -1, 1, 0},
52
/* 1 */ { 5, s_0_1, 0, 1, 0},
53
/* 2 */ { 4, s_0_2, -1, 1, 0},
54
/* 3 */ { 1, s_0_3, -1, 1, 0},
55
/* 4 */ { 5, s_0_4, 3, 1, 0},
56
/* 5 */ { 4, s_0_5, 3, 1, 0},
57
/* 6 */ { 6, s_0_6, 5, 1, 0},
58
/* 7 */ { 3, s_0_7, 3, 1, 0},
59
/* 8 */ { 4, s_0_8, 3, 1, 0},
60
/* 9 */ { 3, s_0_9, 3, 1, 0},
61
/* 10 */ { 2, s_0_10, -1, 1, 0},
62
/* 11 */ { 5, s_0_11, 10, 1, 0},
63
/* 12 */ { 4, s_0_12, 10, 1, 0},
64
/* 13 */ { 2, s_0_13, -1, 1, 0},
65
/* 14 */ { 5, s_0_14, 13, 1, 0},
66
/* 15 */ { 4, s_0_15, 13, 1, 0},
67
/* 16 */ { 1, s_0_16, -1, 2, 0},
68
/* 17 */ { 4, s_0_17, 16, 1, 0},
69
/* 18 */ { 2, s_0_18, 16, 1, 0},
70
/* 19 */ { 5, s_0_19, 18, 1, 0},
71
/* 20 */ { 7, s_0_20, 19, 1, 0},
72
/* 21 */ { 4, s_0_21, 18, 1, 0},
73
/* 22 */ { 5, s_0_22, 18, 1, 0},
74
/* 23 */ { 4, s_0_23, 18, 1, 0},
75
/* 24 */ { 3, s_0_24, 16, 1, 0},
76
/* 25 */ { 6, s_0_25, 24, 1, 0},
77
/* 26 */ { 5, s_0_26, 24, 1, 0},
78
/* 27 */ { 3, s_0_27, 16, 1, 0},
79
/* 28 */ { 3, s_0_28, 16, 1, 0},
80
/* 29 */ { 5, s_0_29, 28, 1, 0},
81
/* 30 */ { 2, s_0_30, -1, 1, 0},
82
/* 31 */ { 4, s_0_31, 30, 1, 0}
85
static symbol s_1_0[2] = { 'g', 'd' };
86
static symbol s_1_1[2] = { 'd', 't' };
87
static symbol s_1_2[2] = { 'g', 't' };
88
static symbol s_1_3[2] = { 'k', 't' };
90
static struct among a_1[4] =
92
/* 0 */ { 2, s_1_0, -1, -1, 0},
93
/* 1 */ { 2, s_1_1, -1, -1, 0},
94
/* 2 */ { 2, s_1_2, -1, -1, 0},
95
/* 3 */ { 2, s_1_3, -1, -1, 0}
98
static symbol s_2_0[2] = { 'i', 'g' };
99
static symbol s_2_1[3] = { 'l', 'i', 'g' };
100
static symbol s_2_2[4] = { 'e', 'l', 'i', 'g' };
101
static symbol s_2_3[3] = { 'e', 'l', 's' };
102
static symbol s_2_4[4] = { 'l', 0xF8, 's', 't' };
104
static struct among a_2[5] =
106
/* 0 */ { 2, s_2_0, -1, 1, 0},
107
/* 1 */ { 3, s_2_1, 0, 1, 0},
108
/* 2 */ { 4, s_2_2, 1, 1, 0},
109
/* 3 */ { 3, s_2_3, -1, 1, 0},
110
/* 4 */ { 4, s_2_4, -1, 2, 0}
113
static unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
115
static unsigned char g_s_ending[] = { 239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 };
117
static symbol s_0[] = { 's', 't' };
118
static symbol s_1[] = { 'i', 'g' };
119
static symbol s_2[] = { 'l', 0xF8, 's' };
121
static int r_mark_regions(struct SN_env * z) {
123
{ int c_test = z->c; /* test, line 33 */
125
if (0 > c || c > z->l) return 0;
126
z->c = c; /* hop, line 33 */
128
z->I[1] = z->c; /* setmark x, line 33 */
131
while(1) { /* goto, line 34 */
133
if (!(in_grouping(z, g_v, 97, 248))) goto lab0;
138
if (z->c >= z->l) return 0;
139
z->c++; /* goto, line 34 */
141
while(1) { /* gopast, line 34 */
142
if (!(out_grouping(z, g_v, 97, 248))) goto lab1;
145
if (z->c >= z->l) return 0;
146
z->c++; /* gopast, line 34 */
148
z->I[0] = z->c; /* setmark p1, line 34 */
150
if (!(z->I[0] < z->I[1])) goto lab2;
156
static int r_main_suffix(struct SN_env * z) {
158
{ int m3; /* setlimit, line 41 */
159
int m = z->l - z->c; (void) m;
160
if (z->c < z->I[0]) return 0;
161
z->c = z->I[0]; /* tomark, line 41 */
162
m3 = z->lb; z->lb = z->c;
164
z->ket = z->c; /* [, line 41 */
165
among_var = find_among_b(z, a_0, 32); /* substring, line 41 */
166
if (!(among_var)) { z->lb = m3; return 0; }
167
z->bra = z->c; /* ], line 41 */
174
ret = slice_del(z); /* delete, line 48 */
175
if (ret < 0) return ret;
179
if (!(in_grouping_b(z, g_s_ending, 97, 229))) return 0;
181
ret = slice_del(z); /* delete, line 50 */
182
if (ret < 0) return ret;
189
static int r_consonant_pair(struct SN_env * z) {
190
{ int m_test = z->l - z->c; /* test, line 55 */
191
{ int m3; /* setlimit, line 56 */
192
int m = z->l - z->c; (void) m;
193
if (z->c < z->I[0]) return 0;
194
z->c = z->I[0]; /* tomark, line 56 */
195
m3 = z->lb; z->lb = z->c;
197
z->ket = z->c; /* [, line 56 */
198
if (!(find_among_b(z, a_1, 4))) { z->lb = m3; return 0; } /* substring, line 56 */
199
z->bra = z->c; /* ], line 56 */
202
z->c = z->l - m_test;
204
if (z->c <= z->lb) return 0;
205
z->c--; /* next, line 62 */
206
z->bra = z->c; /* ], line 62 */
208
ret = slice_del(z); /* delete, line 62 */
209
if (ret < 0) return ret;
214
static int r_other_suffix(struct SN_env * z) {
216
{ int m = z->l - z->c; (void) m; /* do, line 66 */
217
z->ket = z->c; /* [, line 66 */
218
if (!(eq_s_b(z, 2, s_0))) goto lab0;
219
z->bra = z->c; /* ], line 66 */
220
if (!(eq_s_b(z, 2, s_1))) goto lab0;
222
ret = slice_del(z); /* delete, line 66 */
223
if (ret < 0) return ret;
228
{ int m3; /* setlimit, line 67 */
229
int m = z->l - z->c; (void) m;
230
if (z->c < z->I[0]) return 0;
231
z->c = z->I[0]; /* tomark, line 67 */
232
m3 = z->lb; z->lb = z->c;
234
z->ket = z->c; /* [, line 67 */
235
among_var = find_among_b(z, a_2, 5); /* substring, line 67 */
236
if (!(among_var)) { z->lb = m3; return 0; }
237
z->bra = z->c; /* ], line 67 */
244
ret = slice_del(z); /* delete, line 70 */
245
if (ret < 0) return ret;
247
{ int m = z->l - z->c; (void) m; /* do, line 70 */
248
{ int ret = r_consonant_pair(z);
249
if (ret == 0) goto lab1; /* call consonant_pair, line 70 */
250
if (ret < 0) return ret;
258
ret = slice_from_s(z, 3, s_2); /* <-, line 72 */
259
if (ret < 0) return ret;
266
static int r_undouble(struct SN_env * z) {
267
{ int m3; /* setlimit, line 76 */
268
int m = z->l - z->c; (void) m;
269
if (z->c < z->I[0]) return 0;
270
z->c = z->I[0]; /* tomark, line 76 */
271
m3 = z->lb; z->lb = z->c;
273
z->ket = z->c; /* [, line 76 */
274
if (!(out_grouping_b(z, g_v, 97, 248))) { z->lb = m3; return 0; }
275
z->bra = z->c; /* ], line 76 */
276
z->S[0] = slice_to(z, z->S[0]); /* -> ch, line 76 */
277
if (z->S[0] == 0) return -1; /* -> ch, line 76 */
280
if (!(eq_v_b(z, z->S[0]))) return 0; /* name ch, line 77 */
282
ret = slice_del(z); /* delete, line 78 */
283
if (ret < 0) return ret;
288
extern int danish_ISO_8859_1_stem(struct SN_env * z) {
289
{ int c = z->c; /* do, line 84 */
290
{ int ret = r_mark_regions(z);
291
if (ret == 0) goto lab0; /* call mark_regions, line 84 */
292
if (ret < 0) return ret;
297
z->lb = z->c; z->c = z->l; /* backwards, line 85 */
299
{ int m = z->l - z->c; (void) m; /* do, line 86 */
300
{ int ret = r_main_suffix(z);
301
if (ret == 0) goto lab1; /* call main_suffix, line 86 */
302
if (ret < 0) return ret;
307
{ int m = z->l - z->c; (void) m; /* do, line 87 */
308
{ int ret = r_consonant_pair(z);
309
if (ret == 0) goto lab2; /* call consonant_pair, line 87 */
310
if (ret < 0) return ret;
315
{ int m = z->l - z->c; (void) m; /* do, line 88 */
316
{ int ret = r_other_suffix(z);
317
if (ret == 0) goto lab3; /* call other_suffix, line 88 */
318
if (ret < 0) return ret;
323
{ int m = z->l - z->c; (void) m; /* do, line 89 */
324
{ int ret = r_undouble(z);
325
if (ret == 0) goto lab4; /* call undouble, line 89 */
326
if (ret < 0) return ret;
335
extern struct SN_env * danish_ISO_8859_1_create_env(void) { return SN_create_env(1, 2, 0); }
337
extern void danish_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z); }