xapian-core  2.1.0
sesotho.cc
Go to the documentation of this file.
1 /* Generated from sesotho.sbl by Snowball 3.1.1 - https://snowballstem.org/ */
2 
3 #include <config.h>
4 
5 #define SNOWBALL_RUNTIME_THROW_EXCEPTIONS
6 #include "sesotho.h"
7 
8 #include <stddef.h>
9 
11 
12 
13 static const symbol s_0_0[2] = { 'b', 'a' };
14 static const symbol s_0_1[3] = { 'b', 'o', 'i' };
15 static const symbol s_0_2[2] = { 'l', 'e' };
16 static const symbol s_0_3[2] = { 'l', 'i' };
17 static const symbol s_0_4[2] = { 'm', 'a' };
18 static const symbol s_0_5[2] = { 'm', 'e' };
19 static const symbol s_0_6[2] = { 'm', 'o' };
20 static const symbol s_0_7[2] = { 's', 'e' };
21 static const struct among a_0[8] = {
22 { 2, s_0_0, 0, -1, 0},
23 { 3, s_0_1, 0, -1, 0},
24 { 2, s_0_2, 0, -1, 0},
25 { 2, s_0_3, 0, -1, 0},
26 { 2, s_0_4, 0, -1, 0},
27 { 2, s_0_5, 0, -1, 0},
28 { 2, s_0_6, 0, -1, 0},
29 { 2, s_0_7, 0, -1, 0}
30 };
31 
32 static const symbol s_1_0[1] = { 'a' };
33 static const symbol s_1_1[3] = { 'e', 'l', 'a' };
34 static const symbol s_1_2[3] = { 'i', 's', 'a' };
35 static const symbol s_1_3[2] = { 'w', 'a' };
36 static const symbol s_1_4[3] = { 'i', 'l', 'e' };
37 static const symbol s_1_5[4] = { 'e', 't', 's', 'e' };
38 static const symbol s_1_6[3] = { 'a', 'n', 'g' };
39 static const symbol s_1_7[3] = { 'e', 'n', 'g' };
40 static const symbol s_1_8[3] = { 'o', 'n', 'g' };
41 static const struct among a_1[9] = {
42 { 1, s_1_0, 0, 1, 0},
43 { 3, s_1_1, -1, 1, 0},
44 { 3, s_1_2, -2, 1, 0},
45 { 2, s_1_3, -3, 1, 0},
46 { 3, s_1_4, 0, 1, 0},
47 { 4, s_1_5, 0, 1, 0},
48 { 3, s_1_6, 0, 1, 0},
49 { 3, s_1_7, 0, 1, 0},
50 { 3, s_1_8, 0, 1, 0}
51 };
52 
53 static const symbol s_2_0[3] = { 'a', 'n', 'a' };
54 static const symbol s_2_1[5] = { 'n', 'y', 'a', 'n', 'a' };
55 static const symbol s_2_2[2] = { 'o', 'a' };
56 static const symbol s_2_3[1] = { 'i' };
57 static const symbol s_2_4[3] = { 'a', 'n', 'o' };
58 static const struct among a_2[5] = {
59 { 3, s_2_0, 0, 1, 0},
60 { 5, s_2_1, -1, 1, 0},
61 { 2, s_2_2, 0, 1, 0},
62 { 1, s_2_3, 0, 1, 0},
63 { 3, s_2_4, 0, 1, 0}
64 };
65 
66 static const unsigned char g_v[] = { 17, 65, 16 };
67 
69  int i_pV;
70  {
71  int v_1 = z->c;
72  {
73  int ret = out_grouping_U(z, g_v, 97, 117, 1);
74  if (ret < 0) return 0;
75  z->c += ret;
76  }
77  i_pV = z->c;
78  z->c = v_1;
79  }
80  {
81  int v_2 = z->c;
82  {
83  int ret = skip_utf8(z->p, z->c, z->l, 2);
84  if (ret < 0) return 0;
85  z->c = ret;
86  }
87  if (z->c <= i_pV) goto lab0;
88  i_pV = z->c;
89  lab0:
90  z->c = v_2;
91  }
92  z->lb = z->c; z->c = z->l;
93  {
94  int v_3 = z->l - z->c;
95  {
96  int v_4;
97  if (z->c < i_pV) goto lab1;
98  v_4 = z->lb; z->lb = i_pV;
99  z->ket = z->c;
100  if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((33282 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = v_4; goto lab1; }
101  if (!find_among_b(z, a_2, 5, 0)) { z->lb = v_4; goto lab1; }
102  z->bra = z->c;
103  slice_del(z);
104  z->lb = v_4;
105  }
106  lab1:
107  z->c = z->l - v_3;
108  }
109  {
110  int v_5 = z->l - z->c;
111  {
112  int v_6;
113  if (z->c < i_pV) goto lab2;
114  v_6 = z->lb; z->lb = i_pV;
115  z->ket = z->c;
116  if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((162 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = v_6; goto lab2; }
117  if (!find_among_b(z, a_1, 9, 0)) { z->lb = v_6; goto lab2; }
118  z->bra = z->c;
119  slice_del(z);
120  z->lb = v_6;
121  }
122  lab2:
123  z->c = z->l - v_5;
124  }
125  z->c = z->lb;
126  {
127  int v_7 = z->c;
128  z->bra = z->c;
129  if (z->c + 1 >= z->l || z->p[z->c + 1] >> 5 != 3 || !((33314 >> (z->p[z->c + 1] & 0x1f)) & 1)) goto lab3;
130  if (!find_among(z, a_0, 8, 0)) goto lab3;
131  z->ket = z->c;
132  {
133  int v_8 = z->c;
134  {
135  int ret = skip_utf8(z->p, z->c, z->l, 1);
136  if (ret < 0) goto lab3;
137  z->c = ret;
138  }
139  if (z->c >= z->l) goto lab3;
140  z->c = v_8;
141  }
142  {
143  int ret = out_grouping_U(z, g_v, 97, 117, 1);
144  if (ret < 0) goto lab3;
145  z->c += ret;
146  }
147  slice_del(z);
148  lab3:
149  z->c = v_7;
150  }
151  return 1;
152 }
unsigned char symbol
Definition: api.h:4
static int stem(struct SN_env *z)
Definition: sesotho.cc:68
static const struct among a_2[5]
Definition: sesotho.cc:58
static const symbol s_1_7[3]
Definition: sesotho.cc:39
static const symbol s_2_1[5]
Definition: sesotho.cc:54
static const symbol s_0_4[2]
Definition: sesotho.cc:17
static const symbol s_2_2[2]
Definition: sesotho.cc:55
static const symbol s_1_8[3]
Definition: sesotho.cc:40
static const symbol s_0_5[2]
Definition: sesotho.cc:18
static const symbol s_1_6[3]
Definition: sesotho.cc:38
static const symbol s_1_5[4]
Definition: sesotho.cc:37
static const symbol s_2_3[1]
Definition: sesotho.cc:56
static const symbol s_1_3[2]
Definition: sesotho.cc:35
static const symbol s_0_0[2]
Definition: sesotho.cc:13
static const symbol s_0_7[2]
Definition: sesotho.cc:20
static const struct among a_1[9]
Definition: sesotho.cc:41
Xapian::Internal::Snowball::Sesotho::SN_local SN_local
Definition: sesotho.cc:10
static const symbol s_0_1[3]
Definition: sesotho.cc:14
static const symbol s_2_0[3]
Definition: sesotho.cc:53
static const symbol s_2_4[3]
Definition: sesotho.cc:57
static const symbol s_1_2[3]
Definition: sesotho.cc:34
static const symbol s_1_0[1]
Definition: sesotho.cc:32
static const symbol s_0_6[2]
Definition: sesotho.cc:19
static const struct among a_0[8]
Definition: sesotho.cc:21
static const symbol s_1_1[3]
Definition: sesotho.cc:33
static const symbol s_1_4[3]
Definition: sesotho.cc:36
static const symbol s_0_2[2]
Definition: sesotho.cc:15
static const symbol s_0_3[2]
Definition: sesotho.cc:16
static const unsigned char g_v[]
Definition: sesotho.cc:66
int out_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
int find_among_b(struct SN_env *z, const struct among *v, int v_size, int(*call_among_func)(struct SN_env *))
SNOWBALL_ERR slice_del(struct SN_env *z)
int skip_utf8(const symbol *p, int c, int limit, int n)
int find_among(struct SN_env *z, const struct among *v, int v_size, int(*call_among_func)(struct SN_env *))
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