PostgreSQL Source Code  git master
stem_ISO_8859_1_danish.c File Reference
#include "header.h"
Include dependency graph for stem_ISO_8859_1_danish.c:

Go to the source code of this file.

Functions

int danish_ISO_8859_1_stem (struct SN_env *z)
 
static int r_undouble (struct SN_env *z)
 
static int r_other_suffix (struct SN_env *z)
 
static int r_consonant_pair (struct SN_env *z)
 
static int r_main_suffix (struct SN_env *z)
 
static int r_mark_regions (struct SN_env *z)
 
struct SN_envdanish_ISO_8859_1_create_env (void)
 
void danish_ISO_8859_1_close_env (struct SN_env *z)
 

Variables

static const symbol s_0_0 [3] = { 'h', 'e', 'd' }
 
static const symbol s_0_1 [5] = { 'e', 't', 'h', 'e', 'd' }
 
static const symbol s_0_2 [4] = { 'e', 'r', 'e', 'd' }
 
static const symbol s_0_3 [1] = { 'e' }
 
static const symbol s_0_4 [5] = { 'e', 'r', 'e', 'd', 'e' }
 
static const symbol s_0_5 [4] = { 'e', 'n', 'd', 'e' }
 
static const symbol s_0_6 [6] = { 'e', 'r', 'e', 'n', 'd', 'e' }
 
static const symbol s_0_7 [3] = { 'e', 'n', 'e' }
 
static const symbol s_0_8 [4] = { 'e', 'r', 'n', 'e' }
 
static const symbol s_0_9 [3] = { 'e', 'r', 'e' }
 
static const symbol s_0_10 [2] = { 'e', 'n' }
 
static const symbol s_0_11 [5] = { 'h', 'e', 'd', 'e', 'n' }
 
static const symbol s_0_12 [4] = { 'e', 'r', 'e', 'n' }
 
static const symbol s_0_13 [2] = { 'e', 'r' }
 
static const symbol s_0_14 [5] = { 'h', 'e', 'd', 'e', 'r' }
 
static const symbol s_0_15 [4] = { 'e', 'r', 'e', 'r' }
 
static const symbol s_0_16 [1] = { 's' }
 
static const symbol s_0_17 [4] = { 'h', 'e', 'd', 's' }
 
static const symbol s_0_18 [2] = { 'e', 's' }
 
static const symbol s_0_19 [5] = { 'e', 'n', 'd', 'e', 's' }
 
static const symbol s_0_20 [7] = { 'e', 'r', 'e', 'n', 'd', 'e', 's' }
 
static const symbol s_0_21 [4] = { 'e', 'n', 'e', 's' }
 
static const symbol s_0_22 [5] = { 'e', 'r', 'n', 'e', 's' }
 
static const symbol s_0_23 [4] = { 'e', 'r', 'e', 's' }
 
static const symbol s_0_24 [3] = { 'e', 'n', 's' }
 
static const symbol s_0_25 [6] = { 'h', 'e', 'd', 'e', 'n', 's' }
 
static const symbol s_0_26 [5] = { 'e', 'r', 'e', 'n', 's' }
 
static const symbol s_0_27 [3] = { 'e', 'r', 's' }
 
static const symbol s_0_28 [3] = { 'e', 't', 's' }
 
static const symbol s_0_29 [5] = { 'e', 'r', 'e', 't', 's' }
 
static const symbol s_0_30 [2] = { 'e', 't' }
 
static const symbol s_0_31 [4] = { 'e', 'r', 'e', 't' }
 
static const struct among a_0 [32]
 
static const symbol s_1_0 [2] = { 'g', 'd' }
 
static const symbol s_1_1 [2] = { 'd', 't' }
 
static const symbol s_1_2 [2] = { 'g', 't' }
 
static const symbol s_1_3 [2] = { 'k', 't' }
 
static const struct among a_1 [4]
 
static const symbol s_2_0 [2] = { 'i', 'g' }
 
static const symbol s_2_1 [3] = { 'l', 'i', 'g' }
 
static const symbol s_2_2 [4] = { 'e', 'l', 'i', 'g' }
 
static const symbol s_2_3 [3] = { 'e', 'l', 's' }
 
static const symbol s_2_4 [4] = { 'l', 0xF8, 's', 't' }
 
static const struct among a_2 [5]
 
static const unsigned char g_c [] = { 119, 223, 119, 1 }
 
static const unsigned char g_v [] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 }
 
static const unsigned char g_s_ending [] = { 239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 }
 
static const symbol s_0 [] = { 's', 't' }
 
static const symbol s_1 [] = { 'i', 'g' }
 
static const symbol s_2 [] = { 'l', 0xF8, 's' }
 

Function Documentation

◆ danish_ISO_8859_1_close_env()

void danish_ISO_8859_1_close_env ( struct SN_env z)

Definition at line 313 of file stem_ISO_8859_1_danish.c.

313 { SN_close_env(z, 1); }
void SN_close_env(struct SN_env *z, int S_size)
Definition: api.c:34

References SN_close_env().

◆ danish_ISO_8859_1_create_env()

struct SN_env * danish_ISO_8859_1_create_env ( void  )

Definition at line 311 of file stem_ISO_8859_1_danish.c.

311 { return SN_create_env(1, 2); }
struct SN_env * SN_create_env(int S_size, int I_size)
Definition: api.c:3

References SN_create_env().

◆ danish_ISO_8859_1_stem()

int danish_ISO_8859_1_stem ( struct SN_env z)

Definition at line 274 of file stem_ISO_8859_1_danish.c.

274  {
275  { int c1 = z->c;
276  { int ret = r_mark_regions(z);
277  if (ret < 0) return ret;
278  }
279  z->c = c1;
280  }
281  z->lb = z->c; z->c = z->l;
282 
283  { int m2 = z->l - z->c; (void)m2;
284  { int ret = r_main_suffix(z);
285  if (ret < 0) return ret;
286  }
287  z->c = z->l - m2;
288  }
289  { int m3 = z->l - z->c; (void)m3;
290  { int ret = r_consonant_pair(z);
291  if (ret < 0) return ret;
292  }
293  z->c = z->l - m3;
294  }
295  { int m4 = z->l - z->c; (void)m4;
296  { int ret = r_other_suffix(z);
297  if (ret < 0) return ret;
298  }
299  z->c = z->l - m4;
300  }
301  { int m5 = z->l - z->c; (void)m5;
302  { int ret = r_undouble(z);
303  if (ret < 0) return ret;
304  }
305  z->c = z->l - m5;
306  }
307  z->c = z->lb;
308  return 1;
309 }
static int r_other_suffix(struct SN_env *z)
static int r_consonant_pair(struct SN_env *z)
static int r_main_suffix(struct SN_env *z)
static int r_undouble(struct SN_env *z)
static int r_mark_regions(struct SN_env *z)
int lb
Definition: api.h:16
int c
Definition: api.h:16
int l
Definition: api.h:16

References SN_env::c, SN_env::l, SN_env::lb, r_consonant_pair(), r_main_suffix(), r_mark_regions(), r_other_suffix(), and r_undouble().

◆ r_consonant_pair()

static int r_consonant_pair ( struct SN_env z)
static

Definition at line 187 of file stem_ISO_8859_1_danish.c.

187  {
188  { int m_test1 = z->l - z->c;
189 
190  { int mlimit2;
191  if (z->c < z->I[1]) return 0;
192  mlimit2 = z->lb; z->lb = z->I[1];
193  z->ket = z->c;
194  if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 100 && z->p[z->c - 1] != 116)) { z->lb = mlimit2; return 0; }
195  if (!(find_among_b(z, a_1, 4))) { z->lb = mlimit2; return 0; }
196  z->bra = z->c;
197  z->lb = mlimit2;
198  }
199  z->c = z->l - m_test1;
200  }
201  if (z->c <= z->lb) return 0;
202  z->c--;
203  z->bra = z->c;
204  { int ret = slice_del(z);
205  if (ret < 0) return ret;
206  }
207  return 1;
208 }
static const struct among a_1[4]
symbol * p
Definition: api.h:15
int * I
Definition: api.h:18
int ket
Definition: api.h:16
int bra
Definition: api.h:16
int find_among_b(struct SN_env *z, const struct among *v, int v_size)
Definition: utilities.c:298
int slice_del(struct SN_env *z)
Definition: utilities.c:431

References a_1, SN_env::bra, SN_env::c, find_among_b(), SN_env::I, SN_env::ket, SN_env::l, SN_env::lb, SN_env::p, and slice_del().

Referenced by danish_ISO_8859_1_stem(), and r_other_suffix().

◆ r_main_suffix()

static int r_main_suffix ( struct SN_env z)
static

Definition at line 158 of file stem_ISO_8859_1_danish.c.

158  {
159  int among_var;
160 
161  { int mlimit1;
162  if (z->c < z->I[1]) return 0;
163  mlimit1 = z->lb; z->lb = z->I[1];
164  z->ket = z->c;
165  if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1851440 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit1; return 0; }
166  among_var = find_among_b(z, a_0, 32);
167  if (!(among_var)) { z->lb = mlimit1; return 0; }
168  z->bra = z->c;
169  z->lb = mlimit1;
170  }
171  switch (among_var) {
172  case 1:
173  { int ret = slice_del(z);
174  if (ret < 0) return ret;
175  }
176  break;
177  case 2:
178  if (in_grouping_b(z, g_s_ending, 97, 229, 0)) return 0;
179  { int ret = slice_del(z);
180  if (ret < 0) return ret;
181  }
182  break;
183  }
184  return 1;
185 }
static const struct among a_0[32]
static const unsigned char g_s_ending[]
int in_grouping_b(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:179

References a_0, SN_env::bra, SN_env::c, find_among_b(), g_s_ending, SN_env::I, in_grouping_b(), SN_env::ket, SN_env::lb, SN_env::p, and slice_del().

Referenced by danish_ISO_8859_1_stem().

◆ r_mark_regions()

static int r_mark_regions ( struct SN_env z)
static

Definition at line 136 of file stem_ISO_8859_1_danish.c.

136  {
137  z->I[1] = z->l;
138  { int c_test1 = z->c;
139 z->c = z->c + 3;
140  if (z->c > z->l) return 0;
141  z->I[0] = z->c;
142  z->c = c_test1;
143  }
144  if (out_grouping(z, g_v, 97, 248, 1) < 0) return 0;
145  {
146  int ret = in_grouping(z, g_v, 97, 248, 1);
147  if (ret < 0) return 0;
148  z->c += ret;
149  }
150  z->I[1] = z->c;
151 
152  if (!(z->I[1] < z->I[0])) goto lab0;
153  z->I[1] = z->I[0];
154 lab0:
155  return 1;
156 }
static const unsigned char g_v[]
int in_grouping(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:167
int out_grouping(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition: utilities.c:191

References SN_env::c, g_v, SN_env::I, in_grouping(), SN_env::l, and out_grouping().

Referenced by danish_ISO_8859_1_stem().

◆ r_other_suffix()

static int r_other_suffix ( struct SN_env z)
static

Definition at line 210 of file stem_ISO_8859_1_danish.c.

210  {
211  int among_var;
212  { int m1 = z->l - z->c; (void)m1;
213  z->ket = z->c;
214  if (!(eq_s_b(z, 2, s_0))) goto lab0;
215  z->bra = z->c;
216  if (!(eq_s_b(z, 2, s_1))) goto lab0;
217  { int ret = slice_del(z);
218  if (ret < 0) return ret;
219  }
220  lab0:
221  z->c = z->l - m1;
222  }
223 
224  { int mlimit2;
225  if (z->c < z->I[1]) return 0;
226  mlimit2 = z->lb; z->lb = z->I[1];
227  z->ket = z->c;
228  if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1572992 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit2; return 0; }
229  among_var = find_among_b(z, a_2, 5);
230  if (!(among_var)) { z->lb = mlimit2; return 0; }
231  z->bra = z->c;
232  z->lb = mlimit2;
233  }
234  switch (among_var) {
235  case 1:
236  { int ret = slice_del(z);
237  if (ret < 0) return ret;
238  }
239  { int m3 = z->l - z->c; (void)m3;
240  { int ret = r_consonant_pair(z);
241  if (ret < 0) return ret;
242  }
243  z->c = z->l - m3;
244  }
245  break;
246  case 2:
247  { int ret = slice_from_s(z, 3, s_2);
248  if (ret < 0) return ret;
249  }
250  break;
251  }
252  return 1;
253 }
static const struct among a_2[5]
static const symbol s_2[]
static const symbol s_1[]
static const symbol s_0[]
int eq_s_b(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:220
int slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition: utilities.c:422

References a_2, SN_env::bra, SN_env::c, eq_s_b(), find_among_b(), SN_env::I, SN_env::ket, SN_env::l, SN_env::lb, SN_env::p, r_consonant_pair(), s_0, s_1, s_2, slice_del(), and slice_from_s().

Referenced by danish_ISO_8859_1_stem().

◆ r_undouble()

static int r_undouble ( struct SN_env z)
static

Definition at line 255 of file stem_ISO_8859_1_danish.c.

255  {
256 
257  { int mlimit1;
258  if (z->c < z->I[1]) return 0;
259  mlimit1 = z->lb; z->lb = z->I[1];
260  z->ket = z->c;
261  if (in_grouping_b(z, g_c, 98, 122, 0)) { z->lb = mlimit1; return 0; }
262  z->bra = z->c;
263  z->S[0] = slice_to(z, z->S[0]);
264  if (z->S[0] == 0) return -1;
265  z->lb = mlimit1;
266  }
267  if (!(eq_v_b(z, z->S[0]))) return 0;
268  { int ret = slice_del(z);
269  if (ret < 0) return ret;
270  }
271  return 1;
272 }
static const unsigned char g_c[]
symbol ** S
Definition: api.h:17
int eq_v_b(struct SN_env *z, const symbol *p)
Definition: utilities.c:229
symbol * slice_to(struct SN_env *z, symbol *p)
Definition: utilities.c:448

References SN_env::bra, SN_env::c, eq_v_b(), g_c, SN_env::I, in_grouping_b(), SN_env::ket, SN_env::lb, SN_env::S, slice_del(), and slice_to().

Referenced by danish_ISO_8859_1_stem().

Variable Documentation

◆ a_0

const struct among a_0[32]
static

Definition at line 60 of file stem_ISO_8859_1_danish.c.

Referenced by r_main_suffix().

◆ a_1

const struct among a_1[4]
static
Initial value:
=
{
{ 2, s_1_0, -1, -1, 0},
{ 2, s_1_1, -1, -1, 0},
{ 2, s_1_2, -1, -1, 0},
{ 2, s_1_3, -1, -1, 0}
}
static const symbol s_1_2[2]
static const symbol s_1_3[2]
static const symbol s_1_0[2]
static const symbol s_1_1[2]

Definition at line 101 of file stem_ISO_8859_1_danish.c.

Referenced by r_consonant_pair().

◆ a_2

const struct among a_2[5]
static
Initial value:
=
{
{ 2, s_2_0, -1, 1, 0},
{ 3, s_2_1, 0, 1, 0},
{ 4, s_2_2, 1, 1, 0},
{ 3, s_2_3, -1, 1, 0},
{ 4, s_2_4, -1, 2, 0}
}
static const symbol s_2_3[3]
static const symbol s_2_0[2]
static const symbol s_2_1[3]
static const symbol s_2_2[4]
static const symbol s_2_4[4]

Definition at line 115 of file stem_ISO_8859_1_danish.c.

Referenced by r_other_suffix().

◆ g_c

const unsigned char g_c[] = { 119, 223, 119, 1 }
static

Definition at line 126 of file stem_ISO_8859_1_danish.c.

Referenced by r_undouble().

◆ g_s_ending

const unsigned char g_s_ending[] = { 239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 }
static

Definition at line 130 of file stem_ISO_8859_1_danish.c.

Referenced by r_main_suffix().

◆ g_v

const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 }
static

Definition at line 128 of file stem_ISO_8859_1_danish.c.

Referenced by r_mark_regions().

◆ s_0

const symbol s_0[] = { 's', 't' }
static

Definition at line 132 of file stem_ISO_8859_1_danish.c.

Referenced by r_other_suffix().

◆ s_0_0

const symbol s_0_0[3] = { 'h', 'e', 'd' }
static

Definition at line 29 of file stem_ISO_8859_1_danish.c.

◆ s_0_1

const symbol s_0_1[5] = { 'e', 't', 'h', 'e', 'd' }
static

Definition at line 30 of file stem_ISO_8859_1_danish.c.

◆ s_0_10

const symbol s_0_10[2] = { 'e', 'n' }
static

Definition at line 39 of file stem_ISO_8859_1_danish.c.

◆ s_0_11

const symbol s_0_11[5] = { 'h', 'e', 'd', 'e', 'n' }
static

Definition at line 40 of file stem_ISO_8859_1_danish.c.

◆ s_0_12

const symbol s_0_12[4] = { 'e', 'r', 'e', 'n' }
static

Definition at line 41 of file stem_ISO_8859_1_danish.c.

◆ s_0_13

const symbol s_0_13[2] = { 'e', 'r' }
static

Definition at line 42 of file stem_ISO_8859_1_danish.c.

◆ s_0_14

const symbol s_0_14[5] = { 'h', 'e', 'd', 'e', 'r' }
static

Definition at line 43 of file stem_ISO_8859_1_danish.c.

◆ s_0_15

const symbol s_0_15[4] = { 'e', 'r', 'e', 'r' }
static

Definition at line 44 of file stem_ISO_8859_1_danish.c.

◆ s_0_16

const symbol s_0_16[1] = { 's' }
static

Definition at line 45 of file stem_ISO_8859_1_danish.c.

◆ s_0_17

const symbol s_0_17[4] = { 'h', 'e', 'd', 's' }
static

Definition at line 46 of file stem_ISO_8859_1_danish.c.

◆ s_0_18

const symbol s_0_18[2] = { 'e', 's' }
static

Definition at line 47 of file stem_ISO_8859_1_danish.c.

◆ s_0_19

const symbol s_0_19[5] = { 'e', 'n', 'd', 'e', 's' }
static

Definition at line 48 of file stem_ISO_8859_1_danish.c.

◆ s_0_2

const symbol s_0_2[4] = { 'e', 'r', 'e', 'd' }
static

Definition at line 31 of file stem_ISO_8859_1_danish.c.

◆ s_0_20

const symbol s_0_20[7] = { 'e', 'r', 'e', 'n', 'd', 'e', 's' }
static

Definition at line 49 of file stem_ISO_8859_1_danish.c.

◆ s_0_21

const symbol s_0_21[4] = { 'e', 'n', 'e', 's' }
static

Definition at line 50 of file stem_ISO_8859_1_danish.c.

◆ s_0_22

const symbol s_0_22[5] = { 'e', 'r', 'n', 'e', 's' }
static

Definition at line 51 of file stem_ISO_8859_1_danish.c.

◆ s_0_23

const symbol s_0_23[4] = { 'e', 'r', 'e', 's' }
static

Definition at line 52 of file stem_ISO_8859_1_danish.c.

◆ s_0_24

const symbol s_0_24[3] = { 'e', 'n', 's' }
static

Definition at line 53 of file stem_ISO_8859_1_danish.c.

◆ s_0_25

const symbol s_0_25[6] = { 'h', 'e', 'd', 'e', 'n', 's' }
static

Definition at line 54 of file stem_ISO_8859_1_danish.c.

◆ s_0_26

const symbol s_0_26[5] = { 'e', 'r', 'e', 'n', 's' }
static

Definition at line 55 of file stem_ISO_8859_1_danish.c.

◆ s_0_27

const symbol s_0_27[3] = { 'e', 'r', 's' }
static

Definition at line 56 of file stem_ISO_8859_1_danish.c.

◆ s_0_28

const symbol s_0_28[3] = { 'e', 't', 's' }
static

Definition at line 57 of file stem_ISO_8859_1_danish.c.

◆ s_0_29

const symbol s_0_29[5] = { 'e', 'r', 'e', 't', 's' }
static

Definition at line 58 of file stem_ISO_8859_1_danish.c.

◆ s_0_3

const symbol s_0_3[1] = { 'e' }
static

Definition at line 32 of file stem_ISO_8859_1_danish.c.

◆ s_0_30

const symbol s_0_30[2] = { 'e', 't' }
static

Definition at line 59 of file stem_ISO_8859_1_danish.c.

◆ s_0_31

const symbol s_0_31[4] = { 'e', 'r', 'e', 't' }
static

Definition at line 60 of file stem_ISO_8859_1_danish.c.

◆ s_0_4

const symbol s_0_4[5] = { 'e', 'r', 'e', 'd', 'e' }
static

Definition at line 33 of file stem_ISO_8859_1_danish.c.

◆ s_0_5

const symbol s_0_5[4] = { 'e', 'n', 'd', 'e' }
static

Definition at line 34 of file stem_ISO_8859_1_danish.c.

◆ s_0_6

const symbol s_0_6[6] = { 'e', 'r', 'e', 'n', 'd', 'e' }
static

Definition at line 35 of file stem_ISO_8859_1_danish.c.

◆ s_0_7

const symbol s_0_7[3] = { 'e', 'n', 'e' }
static

Definition at line 36 of file stem_ISO_8859_1_danish.c.

◆ s_0_8

const symbol s_0_8[4] = { 'e', 'r', 'n', 'e' }
static

Definition at line 37 of file stem_ISO_8859_1_danish.c.

◆ s_0_9

const symbol s_0_9[3] = { 'e', 'r', 'e' }
static

Definition at line 38 of file stem_ISO_8859_1_danish.c.

◆ s_1

const symbol s_1[] = { 'i', 'g' }
static

Definition at line 133 of file stem_ISO_8859_1_danish.c.

Referenced by r_other_suffix().

◆ s_1_0

const symbol s_1_0[2] = { 'g', 'd' }
static

Definition at line 98 of file stem_ISO_8859_1_danish.c.

◆ s_1_1

const symbol s_1_1[2] = { 'd', 't' }
static

Definition at line 99 of file stem_ISO_8859_1_danish.c.

◆ s_1_2

const symbol s_1_2[2] = { 'g', 't' }
static

Definition at line 100 of file stem_ISO_8859_1_danish.c.

◆ s_1_3

const symbol s_1_3[2] = { 'k', 't' }
static

Definition at line 101 of file stem_ISO_8859_1_danish.c.

◆ s_2

const symbol s_2[] = { 'l', 0xF8, 's' }
static

Definition at line 134 of file stem_ISO_8859_1_danish.c.

Referenced by r_other_suffix().

◆ s_2_0

const symbol s_2_0[2] = { 'i', 'g' }
static

Definition at line 111 of file stem_ISO_8859_1_danish.c.

◆ s_2_1

const symbol s_2_1[3] = { 'l', 'i', 'g' }
static

Definition at line 112 of file stem_ISO_8859_1_danish.c.

◆ s_2_2

const symbol s_2_2[4] = { 'e', 'l', 'i', 'g' }
static

Definition at line 113 of file stem_ISO_8859_1_danish.c.

◆ s_2_3

const symbol s_2_3[3] = { 'e', 'l', 's' }
static

Definition at line 114 of file stem_ISO_8859_1_danish.c.

◆ s_2_4

const symbol s_2_4[4] = { 'l', 0xF8, 's', 't' }
static

Definition at line 115 of file stem_ISO_8859_1_danish.c.