xapian-core  2.1.0
swedish.cc
Go to the documentation of this file.
1 /* Generated from swedish.sbl by Snowball 3.1.1 - https://snowballstem.org/ */
2 
3 #include <config.h>
4 
5 #define SNOWBALL_RUNTIME_THROW_EXCEPTIONS
6 #include "swedish.h"
7 
8 #include <stddef.h>
9 
11 
12 static int r_et_condition(struct SN_env * z);
13 
14 static const symbol s_0[] = { 'e', 't' };
15 static const symbol s_1[] = { 0xC3, 0xB6, 's' };
16 static const symbol s_2[] = { 'f', 'u', 'l', 'l' };
17 
18 static const symbol s_0_0[3] = { 'f', 'a', 'b' };
19 static const symbol s_0_1[1] = { 'h' };
20 static const symbol s_0_2[3] = { 'p', 'a', 'k' };
21 static const symbol s_0_3[3] = { 'r', 'a', 'k' };
22 static const symbol s_0_4[4] = { 's', 't', 'a', 'k' };
23 static const symbol s_0_5[3] = { 'k', 'o', 'm' };
24 static const symbol s_0_6[3] = { 'i', 'e', 't' };
25 static const symbol s_0_7[3] = { 'c', 'i', 't' };
26 static const symbol s_0_8[3] = { 'd', 'i', 't' };
27 static const symbol s_0_9[4] = { 'a', 'l', 'i', 't' };
28 static const symbol s_0_10[4] = { 'i', 'l', 'i', 't' };
29 static const symbol s_0_11[3] = { 'm', 'i', 't' };
30 static const symbol s_0_12[3] = { 'n', 'i', 't' };
31 static const symbol s_0_13[3] = { 'p', 'i', 't' };
32 static const symbol s_0_14[3] = { 'r', 'i', 't' };
33 static const symbol s_0_15[3] = { 's', 'i', 't' };
34 static const symbol s_0_16[3] = { 't', 'i', 't' };
35 static const symbol s_0_17[3] = { 'u', 'i', 't' };
36 static const symbol s_0_18[4] = { 'i', 'v', 'i', 't' };
37 static const symbol s_0_19[4] = { 'k', 'v', 'i', 't' };
38 static const symbol s_0_20[3] = { 'x', 'i', 't' };
39 static const struct among a_0[21] = {
40 { 3, s_0_0, 0, -1, 0},
41 { 1, s_0_1, 0, -1, 0},
42 { 3, s_0_2, 0, -1, 0},
43 { 3, s_0_3, 0, -1, 0},
44 { 4, s_0_4, 0, -1, 0},
45 { 3, s_0_5, 0, -1, 0},
46 { 3, s_0_6, 0, -1, 0},
47 { 3, s_0_7, 0, -1, 0},
48 { 3, s_0_8, 0, -1, 0},
49 { 4, s_0_9, 0, -1, 0},
50 { 4, s_0_10, 0, -1, 0},
51 { 3, s_0_11, 0, -1, 0},
52 { 3, s_0_12, 0, -1, 0},
53 { 3, s_0_13, 0, -1, 0},
54 { 3, s_0_14, 0, -1, 0},
55 { 3, s_0_15, 0, -1, 0},
56 { 3, s_0_16, 0, -1, 0},
57 { 3, s_0_17, 0, -1, 0},
58 { 4, s_0_18, 0, -1, 0},
59 { 4, s_0_19, 0, -1, 0},
60 { 3, s_0_20, 0, -1, 0}
61 };
62 
63 static const symbol s_1_0[1] = { 'a' };
64 static const symbol s_1_1[4] = { 'a', 'r', 'n', 'a' };
65 static const symbol s_1_2[4] = { 'e', 'r', 'n', 'a' };
66 static const symbol s_1_3[7] = { 'h', 'e', 't', 'e', 'r', 'n', 'a' };
67 static const symbol s_1_4[4] = { 'o', 'r', 'n', 'a' };
68 static const symbol s_1_5[2] = { 'a', 'd' };
69 static const symbol s_1_6[1] = { 'e' };
70 static const symbol s_1_7[3] = { 'a', 'd', 'e' };
71 static const symbol s_1_8[4] = { 'a', 'n', 'd', 'e' };
72 static const symbol s_1_9[4] = { 'a', 'r', 'n', 'e' };
73 static const symbol s_1_10[3] = { 'a', 'r', 'e' };
74 static const symbol s_1_11[4] = { 'a', 's', 't', 'e' };
75 static const symbol s_1_12[2] = { 'e', 'n' };
76 static const symbol s_1_13[5] = { 'a', 'n', 'd', 'e', 'n' };
77 static const symbol s_1_14[4] = { 'a', 'r', 'e', 'n' };
78 static const symbol s_1_15[5] = { 'h', 'e', 't', 'e', 'n' };
79 static const symbol s_1_16[3] = { 'e', 'r', 'n' };
80 static const symbol s_1_17[2] = { 'a', 'r' };
81 static const symbol s_1_18[2] = { 'e', 'r' };
82 static const symbol s_1_19[5] = { 'h', 'e', 't', 'e', 'r' };
83 static const symbol s_1_20[2] = { 'o', 'r' };
84 static const symbol s_1_21[1] = { 's' };
85 static const symbol s_1_22[2] = { 'a', 's' };
86 static const symbol s_1_23[5] = { 'a', 'r', 'n', 'a', 's' };
87 static const symbol s_1_24[5] = { 'e', 'r', 'n', 'a', 's' };
88 static const symbol s_1_25[5] = { 'o', 'r', 'n', 'a', 's' };
89 static const symbol s_1_26[2] = { 'e', 's' };
90 static const symbol s_1_27[4] = { 'a', 'd', 'e', 's' };
91 static const symbol s_1_28[5] = { 'a', 'n', 'd', 'e', 's' };
92 static const symbol s_1_29[3] = { 'e', 'n', 's' };
93 static const symbol s_1_30[5] = { 'a', 'r', 'e', 'n', 's' };
94 static const symbol s_1_31[6] = { 'h', 'e', 't', 'e', 'n', 's' };
95 static const symbol s_1_32[4] = { 'e', 'r', 'n', 's' };
96 static const symbol s_1_33[2] = { 'a', 't' };
97 static const symbol s_1_34[2] = { 'e', 't' };
98 static const symbol s_1_35[5] = { 'a', 'n', 'd', 'e', 't' };
99 static const symbol s_1_36[3] = { 'h', 'e', 't' };
100 static const symbol s_1_37[3] = { 'a', 's', 't' };
101 static const struct among a_1[38] = {
102 { 1, s_1_0, 0, 1, 0},
103 { 4, s_1_1, -1, 1, 0},
104 { 4, s_1_2, -2, 1, 0},
105 { 7, s_1_3, -1, 1, 0},
106 { 4, s_1_4, -4, 1, 0},
107 { 2, s_1_5, 0, 1, 0},
108 { 1, s_1_6, 0, 1, 0},
109 { 3, s_1_7, -1, 1, 0},
110 { 4, s_1_8, -2, 1, 0},
111 { 4, s_1_9, -3, 1, 0},
112 { 3, s_1_10, -4, 1, 0},
113 { 4, s_1_11, -5, 1, 0},
114 { 2, s_1_12, 0, 1, 0},
115 { 5, s_1_13, -1, 1, 0},
116 { 4, s_1_14, -2, 1, 0},
117 { 5, s_1_15, -3, 1, 0},
118 { 3, s_1_16, 0, 1, 0},
119 { 2, s_1_17, 0, 1, 0},
120 { 2, s_1_18, 0, 1, 0},
121 { 5, s_1_19, -1, 1, 0},
122 { 2, s_1_20, 0, 1, 0},
123 { 1, s_1_21, 0, 2, 0},
124 { 2, s_1_22, -1, 1, 0},
125 { 5, s_1_23, -1, 1, 0},
126 { 5, s_1_24, -2, 1, 0},
127 { 5, s_1_25, -3, 1, 0},
128 { 2, s_1_26, -5, 1, 0},
129 { 4, s_1_27, -1, 1, 0},
130 { 5, s_1_28, -2, 1, 0},
131 { 3, s_1_29, -8, 1, 0},
132 { 5, s_1_30, -1, 1, 0},
133 { 6, s_1_31, -2, 1, 0},
134 { 4, s_1_32, -11, 1, 0},
135 { 2, s_1_33, 0, 1, 0},
136 { 2, s_1_34, 0, 3, 0},
137 { 5, s_1_35, -1, 1, 0},
138 { 3, s_1_36, -2, 1, 0},
139 { 3, s_1_37, 0, 1, 0}
140 };
141 
142 static const symbol s_2_0[2] = { 'd', 'd' };
143 static const symbol s_2_1[2] = { 'g', 'd' };
144 static const symbol s_2_2[2] = { 'n', 'n' };
145 static const symbol s_2_3[2] = { 'd', 't' };
146 static const symbol s_2_4[2] = { 'g', 't' };
147 static const symbol s_2_5[2] = { 'k', 't' };
148 static const symbol s_2_6[2] = { 't', 't' };
149 static const struct among a_2[7] = {
150 { 2, s_2_0, 0, -1, 0},
151 { 2, s_2_1, 0, -1, 0},
152 { 2, s_2_2, 0, -1, 0},
153 { 2, s_2_3, 0, -1, 0},
154 { 2, s_2_4, 0, -1, 0},
155 { 2, s_2_5, 0, -1, 0},
156 { 2, s_2_6, 0, -1, 0}
157 };
158 
159 static const symbol s_3_0[2] = { 'i', 'g' };
160 static const symbol s_3_1[3] = { 'l', 'i', 'g' };
161 static const symbol s_3_2[3] = { 'e', 'l', 's' };
162 static const symbol s_3_3[5] = { 'f', 'u', 'l', 'l', 't' };
163 static const symbol s_3_4[4] = { 0xC3, 0xB6, 's', 't' };
164 static const struct among a_3[5] = {
165 { 2, s_3_0, 0, 1, 0},
166 { 3, s_3_1, -1, 1, 0},
167 { 3, s_3_2, 0, 1, 0},
168 { 5, s_3_3, 0, 3, 0},
169 { 4, s_3_4, 0, 2, 0}
170 };
171 
172 static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32 };
173 
174 static const unsigned char g_s_ending[] = { 119, 127, 149 };
175 
176 static const unsigned char g_ost_ending[] = { 173, 58 };
177 
178 static int r_et_condition(struct SN_env * z) {
179  {
180  int v_1 = z->l - z->c;
181  if (out_grouping_b_U(z, g_v, 97, 246, 0)) return 0;
182  if (in_grouping_b_U(z, g_v, 97, 246, 0)) return 0;
183  if (z->c <= z->lb) return 0;
184  z->c = z->l - v_1;
185  {
186  int v_2 = z->l - z->c;
187  if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1059076 >> (z->p[z->c - 1] & 0x1f)) & 1)) goto lab0;
188  if (!find_among_b(z, a_0, 21, 0)) goto lab0;
189  return 0;
190  lab0:
191  z->c = z->l - v_2;
192  }
193  }
194  return 1;
195 }
196 
198  int among_var;
199  int i_x;
200  int i_p1;
201  {
202  int v_1 = z->c;
203  i_p1 = z->l;
204  {
205  int v_2 = z->c;
206  {
207  int ret = skip_utf8(z->p, z->c, z->l, 3);
208  if (ret < 0) goto lab0;
209  z->c = ret;
210  }
211  i_x = z->c;
212  z->c = v_2;
213  }
214  {
215  int ret = out_grouping_U(z, g_v, 97, 246, 1);
216  if (ret < 0) goto lab0;
217  z->c += ret;
218  }
219  {
220  int ret = in_grouping_U(z, g_v, 97, 246, 1);
221  if (ret < 0) goto lab0;
222  z->c += ret;
223  }
224  i_p1 = z->c;
225  if (i_p1 >= i_x) goto lab1;
226  i_p1 = i_x;
227  lab1:
228  lab0:
229  z->c = v_1;
230  }
231  z->lb = z->c; z->c = z->l;
232  {
233  int v_3 = z->l - z->c;
234  {
235  int v_4;
236  if (z->c < i_p1) goto lab2;
237  v_4 = z->lb; z->lb = i_p1;
238  z->ket = z->c;
239  if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1851442 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = v_4; goto lab2; }
240  among_var = find_among_b(z, a_1, 38, 0);
241  if (!among_var) { z->lb = v_4; goto lab2; }
242  z->bra = z->c;
243  z->lb = v_4;
244  }
245  switch (among_var) {
246  case 1:
247  slice_del(z);
248  break;
249  case 2:
250  do {
251  int v_5 = z->l - z->c;
252  if (!(eq_s_b(z, 2, s_0))) goto lab3;
253  if (!r_et_condition(z)) goto lab3;
254  z->bra = z->c;
255  break;
256  lab3:
257  z->c = z->l - v_5;
258  if (in_grouping_b_U(z, g_s_ending, 98, 121, 0)) goto lab2;
259  } while (0);
260  slice_del(z);
261  break;
262  case 3:
263  if (!r_et_condition(z)) goto lab2;
264  slice_del(z);
265  break;
266  }
267  lab2:
268  z->c = z->l - v_3;
269  }
270  {
271  int v_6 = z->l - z->c;
272  {
273  int v_7;
274  if (z->c < i_p1) goto lab4;
275  v_7 = z->lb; z->lb = i_p1;
276  {
277  int v_8 = z->l - z->c;
278  if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1064976 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = v_7; goto lab4; }
279  if (!find_among_b(z, a_2, 7, 0)) { z->lb = v_7; goto lab4; }
280  z->c = z->l - v_8;
281  z->ket = z->c;
282  {
283  int ret = skip_b_utf8(z->p, z->c, z->lb, 1);
284  if (ret < 0) { z->lb = v_7; goto lab4; }
285  z->c = ret;
286  }
287  z->bra = z->c;
288  slice_del(z);
289  }
290  z->lb = v_7;
291  }
292  lab4:
293  z->c = z->l - v_6;
294  }
295  {
296  int v_9 = z->l - z->c;
297  {
298  int v_10;
299  if (z->c < i_p1) goto lab5;
300  v_10 = z->lb; z->lb = i_p1;
301  z->ket = z->c;
302  if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1572992 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = v_10; goto lab5; }
303  among_var = find_among_b(z, a_3, 5, 0);
304  if (!among_var) { z->lb = v_10; goto lab5; }
305  z->bra = z->c;
306  z->lb = v_10;
307  }
308  switch (among_var) {
309  case 1:
310  slice_del(z);
311  break;
312  case 2:
313  if (in_grouping_b_U(z, g_ost_ending, 105, 118, 0)) goto lab5;
314  slice_from_s(z, 3, s_1);
315  break;
316  case 3:
317  slice_from_s(z, 4, s_2);
318  break;
319  }
320  lab5:
321  z->c = z->l - v_9;
322  }
323  z->c = z->lb;
324  return 1;
325 }
unsigned char symbol
Definition: api.h:4
static int stem(struct SN_env *z)
Definition: swedish.cc:197
int out_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
int in_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
SNOWBALL_ERR slice_from_s(struct SN_env *z, int s_size, const symbol *s)
int find_among_b(struct SN_env *z, const struct among *v, int v_size, int(*call_among_func)(struct SN_env *))
int in_grouping_b_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
int skip_b_utf8(const symbol *p, int c, int limit, int n)
int eq_s_b(struct SN_env *z, int s_size, const symbol *s)
SNOWBALL_ERR slice_del(struct SN_env *z)
int out_grouping_b_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
int skip_utf8(const symbol *p, int c, int limit, int n)
Definition: api.h:12
int lb
Definition: api.h:14
symbol * p
Definition: api.h:13
int ket
Definition: api.h:14
int c
Definition: api.h:14
int bra
Definition: api.h:14
int l
Definition: api.h:14
Definition: header.h:295
static const symbol s_1_5[2]
Definition: swedish.cc:68
static const symbol s_2[]
Definition: swedish.cc:16
static const symbol s_1_7[3]
Definition: swedish.cc:70
static const symbol s_0_2[3]
Definition: swedish.cc:20
static const symbol s_0_11[3]
Definition: swedish.cc:29
static int r_et_condition(struct SN_env *z)
Definition: swedish.cc:178
static const symbol s_1_3[7]
Definition: swedish.cc:66
static const symbol s_2_2[2]
Definition: swedish.cc:144
static const symbol s_2_5[2]
Definition: swedish.cc:147
static const symbol s_1_35[5]
Definition: swedish.cc:98
static const symbol s_3_2[3]
Definition: swedish.cc:161
static const symbol s_1_10[3]
Definition: swedish.cc:73
static const symbol s_1_34[2]
Definition: swedish.cc:97
static const symbol s_0_5[3]
Definition: swedish.cc:23
static const symbol s_0_3[3]
Definition: swedish.cc:21
static const symbol s_0_17[3]
Definition: swedish.cc:35
static const symbol s_1_31[6]
Definition: swedish.cc:94
static const symbol s_1_18[2]
Definition: swedish.cc:81
static const struct among a_2[7]
Definition: swedish.cc:149
static const symbol s_1_14[4]
Definition: swedish.cc:77
static const symbol s_1_21[1]
Definition: swedish.cc:84
static const symbol s_2_0[2]
Definition: swedish.cc:142
static const symbol s_1_16[3]
Definition: swedish.cc:79
static const symbol s_0_12[3]
Definition: swedish.cc:30
static const struct among a_1[38]
Definition: swedish.cc:101
static const symbol s_1_36[3]
Definition: swedish.cc:99
static const symbol s_1_4[4]
Definition: swedish.cc:67
static const symbol s_1_23[5]
Definition: swedish.cc:86
static const symbol s_3_0[2]
Definition: swedish.cc:159
static const symbol s_0_13[3]
Definition: swedish.cc:31
static const symbol s_3_4[4]
Definition: swedish.cc:163
static const symbol s_0_10[4]
Definition: swedish.cc:28
static const symbol s_0_8[3]
Definition: swedish.cc:26
static const symbol s_1_20[2]
Definition: swedish.cc:83
static const symbol s_3_1[3]
Definition: swedish.cc:160
static const unsigned char g_ost_ending[]
Definition: swedish.cc:176
static const symbol s_0_0[3]
Definition: swedish.cc:18
static const symbol s_0_16[3]
Definition: swedish.cc:34
static const symbol s_1_6[1]
Definition: swedish.cc:69
static const symbol s_1_37[3]
Definition: swedish.cc:100
static const struct among a_0[21]
Definition: swedish.cc:39
static const symbol s_0_9[4]
Definition: swedish.cc:27
static const symbol s_0_18[4]
Definition: swedish.cc:36
static const symbol s_1_26[2]
Definition: swedish.cc:89
static const symbol s_0_20[3]
Definition: swedish.cc:38
static const symbol s_0_4[4]
Definition: swedish.cc:22
static const symbol s_1_17[2]
Definition: swedish.cc:80
static const symbol s_1_11[4]
Definition: swedish.cc:74
static const symbol s_2_3[2]
Definition: swedish.cc:145
static const symbol s_1_13[5]
Definition: swedish.cc:76
Xapian::Internal::Snowball::Swedish::SN_local SN_local
Definition: swedish.cc:10
static const symbol s_1_27[4]
Definition: swedish.cc:90
static const symbol s_0_14[3]
Definition: swedish.cc:32
static const symbol s_2_4[2]
Definition: swedish.cc:146
static const symbol s_1_1[4]
Definition: swedish.cc:64
static const symbol s_1[]
Definition: swedish.cc:15
static const symbol s_1_0[1]
Definition: swedish.cc:63
static const symbol s_1_30[5]
Definition: swedish.cc:93
static const symbol s_0_15[3]
Definition: swedish.cc:33
static const symbol s_3_3[5]
Definition: swedish.cc:162
static const symbol s_1_9[4]
Definition: swedish.cc:72
static const symbol s_1_24[5]
Definition: swedish.cc:87
static const symbol s_1_29[3]
Definition: swedish.cc:92
static const symbol s_0_1[1]
Definition: swedish.cc:19
static const symbol s_1_25[5]
Definition: swedish.cc:88
static const struct among a_3[5]
Definition: swedish.cc:164
static const symbol s_1_2[4]
Definition: swedish.cc:65
static const symbol s_0_6[3]
Definition: swedish.cc:24
static const symbol s_1_33[2]
Definition: swedish.cc:96
static const symbol s_0_7[3]
Definition: swedish.cc:25
static const symbol s_1_15[5]
Definition: swedish.cc:78
static const symbol s_2_6[2]
Definition: swedish.cc:148
static const symbol s_2_1[2]
Definition: swedish.cc:143
static const unsigned char g_v[]
Definition: swedish.cc:172
static const symbol s_1_22[2]
Definition: swedish.cc:85
static const unsigned char g_s_ending[]
Definition: swedish.cc:174
static const symbol s_1_8[4]
Definition: swedish.cc:71
static const symbol s_1_19[5]
Definition: swedish.cc:82
static const symbol s_1_12[2]
Definition: swedish.cc:75
static const symbol s_0[]
Definition: swedish.cc:14
static const symbol s_1_28[5]
Definition: swedish.cc:91
static const symbol s_0_19[4]
Definition: swedish.cc:37
static const symbol s_1_32[4]
Definition: swedish.cc:95