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