isomorfeus-ferret 0.12.4 → 0.12.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +612 -612
- data/README.md +80 -48
- data/ext/isomorfeus_ferret_ext/bm_hash.c +9 -6
- data/ext/isomorfeus_ferret_ext/bm_micro_string.c +4 -2
- data/ext/isomorfeus_ferret_ext/frb_store.c +34 -5
- data/ext/isomorfeus_ferret_ext/frt_posh.h +11 -19
- data/ext/isomorfeus_ferret_ext/frt_q_parser.c +1844 -1911
- data/ext/isomorfeus_ferret_ext/frt_q_phrase.c +7 -7
- data/ext/isomorfeus_ferret_ext/frt_scanner.c +1 -0
- data/ext/isomorfeus_ferret_ext/frt_scanner_mb.c +1 -0
- data/ext/isomorfeus_ferret_ext/frt_scanner_utf8.c +1 -0
- data/ext/isomorfeus_ferret_ext/frt_search.h +1 -1
- data/ext/isomorfeus_ferret_ext/libstemmer.c +14 -11
- data/ext/isomorfeus_ferret_ext/libstemmer.h +4 -9
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_basque.c +1167 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_basque.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_catalan.c +1433 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_catalan.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_danish.c +120 -143
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_danish.h +1 -2
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_dutch.c +217 -237
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_dutch.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_english.c +377 -432
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_english.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_finnish.c +298 -342
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_finnish.h +1 -2
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_french.c +530 -524
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_french.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_german.c +201 -214
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_german.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_hungarian.c +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_indonesian.c +394 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_indonesian.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_irish.c +457 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_irish.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_italian.c +396 -439
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_italian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_norwegian.c +104 -128
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_norwegian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_porter.c +242 -273
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_porter.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_portuguese.c +406 -461
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_portuguese.h +1 -2
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_spanish.c +405 -456
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_spanish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_swedish.c +108 -126
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_swedish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_hungarian.c +849 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_hungarian.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_romanian.c +373 -405
- data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_romanian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_KOI8_R_russian.c +288 -305
- data/ext/isomorfeus_ferret_ext/stem_KOI8_R_russian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_arabic.c +1651 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_arabic.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_armenian.c +546 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_armenian.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_basque.c +1171 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_basque.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_catalan.c +1436 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_catalan.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_danish.c +121 -141
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_danish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_dutch.c +221 -241
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_dutch.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_english.c +381 -431
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_english.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_finnish.c +300 -345
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_finnish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_french.c +518 -511
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_french.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_german.c +201 -209
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_german.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_greek.c +3660 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_greek.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_hindi.c +309 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_hindi.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_hungarian.c +306 -671
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_hungarian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_indonesian.c +394 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_indonesian.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_irish.c +457 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_irish.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_italian.c +400 -442
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_italian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_lithuanian.c +824 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_lithuanian.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_nepali.c +408 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_nepali.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_norwegian.c +105 -127
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_norwegian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_porter.c +245 -276
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_porter.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_portuguese.c +409 -464
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_portuguese.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_romanian.c +376 -408
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_romanian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_russian.c +272 -287
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_russian.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_serbian.c +6530 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_serbian.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_spanish.c +407 -458
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_spanish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_swedish.c +110 -125
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_swedish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_tamil.c +1865 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_tamil.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_turkish.c +698 -806
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_turkish.h +1 -1
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_yiddish.c +1220 -0
- data/ext/isomorfeus_ferret_ext/stem_UTF_8_yiddish.h +6 -0
- data/ext/isomorfeus_ferret_ext/stem_api.c +1 -9
- data/ext/isomorfeus_ferret_ext/stem_api.h +1 -3
- data/ext/isomorfeus_ferret_ext/stem_header.h +30 -26
- data/ext/isomorfeus_ferret_ext/stem_modules.h +113 -26
- data/ext/isomorfeus_ferret_ext/stem_modules.txt +18 -5
- data/ext/isomorfeus_ferret_ext/stem_utilities.c +167 -132
- data/ext/isomorfeus_ferret_ext/test.c +7 -1
- data/ext/isomorfeus_ferret_ext/test_search.c +0 -1
- data/lib/isomorfeus/ferret/version.rb +1 -1
- metadata +39 -4
- data/ext/isomorfeus_ferret_ext/q_parser.y +0 -1366
@@ -1211,7 +1211,7 @@ extern int hungarian_ISO_8859_1_stem(struct SN_env * z) {
|
|
1211
1211
|
return 1;
|
1212
1212
|
}
|
1213
1213
|
|
1214
|
-
extern struct SN_env * hungarian_ISO_8859_1_create_env(void) { return SN_create_env(0, 1
|
1214
|
+
extern struct SN_env * hungarian_ISO_8859_1_create_env(void) { return SN_create_env(0, 1); }
|
1215
1215
|
|
1216
1216
|
extern void hungarian_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 0); }
|
1217
1217
|
|
@@ -0,0 +1,394 @@
|
|
1
|
+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
|
2
|
+
|
3
|
+
#include "stem_header.h"
|
4
|
+
|
5
|
+
extern int indonesian_ISO_8859_1_stem(struct SN_env * z);
|
6
|
+
|
7
|
+
static int r_VOWEL(struct SN_env * z);
|
8
|
+
static int r_SUFFIX_I_OK(struct SN_env * z);
|
9
|
+
static int r_SUFFIX_AN_OK(struct SN_env * z);
|
10
|
+
static int r_SUFFIX_KAN_OK(struct SN_env * z);
|
11
|
+
static int r_KER(struct SN_env * z);
|
12
|
+
static int r_remove_suffix(struct SN_env * z);
|
13
|
+
static int r_remove_second_order_prefix(struct SN_env * z);
|
14
|
+
static int r_remove_first_order_prefix(struct SN_env * z);
|
15
|
+
static int r_remove_possessive_pronoun(struct SN_env * z);
|
16
|
+
static int r_remove_particle(struct SN_env * z);
|
17
|
+
|
18
|
+
extern struct SN_env * indonesian_ISO_8859_1_create_env(void);
|
19
|
+
extern void indonesian_ISO_8859_1_close_env(struct SN_env * z);
|
20
|
+
|
21
|
+
static const symbol s_0_0[3] = { 'k', 'a', 'h' };
|
22
|
+
static const symbol s_0_1[3] = { 'l', 'a', 'h' };
|
23
|
+
static const symbol s_0_2[3] = { 'p', 'u', 'n' };
|
24
|
+
|
25
|
+
static const struct among a_0[3] =
|
26
|
+
{
|
27
|
+
{ 3, s_0_0, -1, 1, 0},
|
28
|
+
{ 3, s_0_1, -1, 1, 0},
|
29
|
+
{ 3, s_0_2, -1, 1, 0}
|
30
|
+
};
|
31
|
+
|
32
|
+
static const symbol s_1_0[3] = { 'n', 'y', 'a' };
|
33
|
+
static const symbol s_1_1[2] = { 'k', 'u' };
|
34
|
+
static const symbol s_1_2[2] = { 'm', 'u' };
|
35
|
+
|
36
|
+
static const struct among a_1[3] =
|
37
|
+
{
|
38
|
+
{ 3, s_1_0, -1, 1, 0},
|
39
|
+
{ 2, s_1_1, -1, 1, 0},
|
40
|
+
{ 2, s_1_2, -1, 1, 0}
|
41
|
+
};
|
42
|
+
|
43
|
+
static const symbol s_2_0[1] = { 'i' };
|
44
|
+
static const symbol s_2_1[2] = { 'a', 'n' };
|
45
|
+
static const symbol s_2_2[3] = { 'k', 'a', 'n' };
|
46
|
+
|
47
|
+
static const struct among a_2[3] =
|
48
|
+
{
|
49
|
+
{ 1, s_2_0, -1, 1, r_SUFFIX_I_OK},
|
50
|
+
{ 2, s_2_1, -1, 1, r_SUFFIX_AN_OK},
|
51
|
+
{ 3, s_2_2, 1, 1, r_SUFFIX_KAN_OK}
|
52
|
+
};
|
53
|
+
|
54
|
+
static const symbol s_3_0[2] = { 'd', 'i' };
|
55
|
+
static const symbol s_3_1[2] = { 'k', 'e' };
|
56
|
+
static const symbol s_3_2[2] = { 'm', 'e' };
|
57
|
+
static const symbol s_3_3[3] = { 'm', 'e', 'm' };
|
58
|
+
static const symbol s_3_4[3] = { 'm', 'e', 'n' };
|
59
|
+
static const symbol s_3_5[4] = { 'm', 'e', 'n', 'g' };
|
60
|
+
static const symbol s_3_6[4] = { 'm', 'e', 'n', 'y' };
|
61
|
+
static const symbol s_3_7[3] = { 'p', 'e', 'm' };
|
62
|
+
static const symbol s_3_8[3] = { 'p', 'e', 'n' };
|
63
|
+
static const symbol s_3_9[4] = { 'p', 'e', 'n', 'g' };
|
64
|
+
static const symbol s_3_10[4] = { 'p', 'e', 'n', 'y' };
|
65
|
+
static const symbol s_3_11[3] = { 't', 'e', 'r' };
|
66
|
+
|
67
|
+
static const struct among a_3[12] =
|
68
|
+
{
|
69
|
+
{ 2, s_3_0, -1, 1, 0},
|
70
|
+
{ 2, s_3_1, -1, 2, 0},
|
71
|
+
{ 2, s_3_2, -1, 1, 0},
|
72
|
+
{ 3, s_3_3, 2, 5, 0},
|
73
|
+
{ 3, s_3_4, 2, 1, 0},
|
74
|
+
{ 4, s_3_5, 4, 1, 0},
|
75
|
+
{ 4, s_3_6, 4, 3, r_VOWEL},
|
76
|
+
{ 3, s_3_7, -1, 6, 0},
|
77
|
+
{ 3, s_3_8, -1, 2, 0},
|
78
|
+
{ 4, s_3_9, 8, 2, 0},
|
79
|
+
{ 4, s_3_10, 8, 4, r_VOWEL},
|
80
|
+
{ 3, s_3_11, -1, 1, 0}
|
81
|
+
};
|
82
|
+
|
83
|
+
static const symbol s_4_0[2] = { 'b', 'e' };
|
84
|
+
static const symbol s_4_1[7] = { 'b', 'e', 'l', 'a', 'j', 'a', 'r' };
|
85
|
+
static const symbol s_4_2[3] = { 'b', 'e', 'r' };
|
86
|
+
static const symbol s_4_3[2] = { 'p', 'e' };
|
87
|
+
static const symbol s_4_4[7] = { 'p', 'e', 'l', 'a', 'j', 'a', 'r' };
|
88
|
+
static const symbol s_4_5[3] = { 'p', 'e', 'r' };
|
89
|
+
|
90
|
+
static const struct among a_4[6] =
|
91
|
+
{
|
92
|
+
{ 2, s_4_0, -1, 3, r_KER},
|
93
|
+
{ 7, s_4_1, 0, 4, 0},
|
94
|
+
{ 3, s_4_2, 0, 3, 0},
|
95
|
+
{ 2, s_4_3, -1, 1, 0},
|
96
|
+
{ 7, s_4_4, 3, 2, 0},
|
97
|
+
{ 3, s_4_5, 3, 1, 0}
|
98
|
+
};
|
99
|
+
|
100
|
+
static const unsigned char g_vowel[] = { 17, 65, 16 };
|
101
|
+
|
102
|
+
static const symbol s_0[] = { 'e', 'r' };
|
103
|
+
static const symbol s_1[] = { 's' };
|
104
|
+
static const symbol s_2[] = { 's' };
|
105
|
+
static const symbol s_3[] = { 'p' };
|
106
|
+
static const symbol s_4[] = { 'p' };
|
107
|
+
static const symbol s_5[] = { 'a', 'j', 'a', 'r' };
|
108
|
+
static const symbol s_6[] = { 'a', 'j', 'a', 'r' };
|
109
|
+
|
110
|
+
static int r_remove_particle(struct SN_env * z) {
|
111
|
+
z->ket = z->c;
|
112
|
+
if (z->c - 2 <= z->lb || (z->p[z->c - 1] != 104 && z->p[z->c - 1] != 110)) return 0;
|
113
|
+
if (!(find_among_b(z, a_0, 3))) return 0;
|
114
|
+
z->bra = z->c;
|
115
|
+
{ int ret = slice_del(z);
|
116
|
+
if (ret < 0) return ret;
|
117
|
+
}
|
118
|
+
z->I[1] -= 1;
|
119
|
+
return 1;
|
120
|
+
}
|
121
|
+
|
122
|
+
static int r_remove_possessive_pronoun(struct SN_env * z) {
|
123
|
+
z->ket = z->c;
|
124
|
+
if (z->c - 1 <= z->lb || (z->p[z->c - 1] != 97 && z->p[z->c - 1] != 117)) return 0;
|
125
|
+
if (!(find_among_b(z, a_1, 3))) return 0;
|
126
|
+
z->bra = z->c;
|
127
|
+
{ int ret = slice_del(z);
|
128
|
+
if (ret < 0) return ret;
|
129
|
+
}
|
130
|
+
z->I[1] -= 1;
|
131
|
+
return 1;
|
132
|
+
}
|
133
|
+
|
134
|
+
static int r_SUFFIX_KAN_OK(struct SN_env * z) {
|
135
|
+
|
136
|
+
if (!(z->I[0] != 3)) return 0;
|
137
|
+
if (!(z->I[0] != 2)) return 0;
|
138
|
+
return 1;
|
139
|
+
}
|
140
|
+
|
141
|
+
static int r_SUFFIX_AN_OK(struct SN_env * z) {
|
142
|
+
if (!(z->I[0] != 1)) return 0;
|
143
|
+
return 1;
|
144
|
+
}
|
145
|
+
|
146
|
+
static int r_SUFFIX_I_OK(struct SN_env * z) {
|
147
|
+
if (!(z->I[0] <= 2)) return 0;
|
148
|
+
{ int m1 = z->l - z->c; (void)m1;
|
149
|
+
if (z->c <= z->lb || z->p[z->c - 1] != 's') goto lab0;
|
150
|
+
z->c--;
|
151
|
+
return 0;
|
152
|
+
lab0:
|
153
|
+
z->c = z->l - m1;
|
154
|
+
}
|
155
|
+
return 1;
|
156
|
+
}
|
157
|
+
|
158
|
+
static int r_remove_suffix(struct SN_env * z) {
|
159
|
+
z->ket = z->c;
|
160
|
+
if (z->c <= z->lb || (z->p[z->c - 1] != 105 && z->p[z->c - 1] != 110)) return 0;
|
161
|
+
if (!(find_among_b(z, a_2, 3))) return 0;
|
162
|
+
z->bra = z->c;
|
163
|
+
{ int ret = slice_del(z);
|
164
|
+
if (ret < 0) return ret;
|
165
|
+
}
|
166
|
+
z->I[1] -= 1;
|
167
|
+
return 1;
|
168
|
+
}
|
169
|
+
|
170
|
+
static int r_VOWEL(struct SN_env * z) {
|
171
|
+
if (in_grouping(z, g_vowel, 97, 117, 0)) return 0;
|
172
|
+
return 1;
|
173
|
+
}
|
174
|
+
|
175
|
+
static int r_KER(struct SN_env * z) {
|
176
|
+
if (out_grouping(z, g_vowel, 97, 117, 0)) return 0;
|
177
|
+
if (!(eq_s(z, 2, s_0))) return 0;
|
178
|
+
return 1;
|
179
|
+
}
|
180
|
+
|
181
|
+
static int r_remove_first_order_prefix(struct SN_env * z) {
|
182
|
+
int among_var;
|
183
|
+
z->bra = z->c;
|
184
|
+
if (z->c + 1 >= z->l || (z->p[z->c + 1] != 105 && z->p[z->c + 1] != 101)) return 0;
|
185
|
+
among_var = find_among(z, a_3, 12);
|
186
|
+
if (!(among_var)) return 0;
|
187
|
+
z->ket = z->c;
|
188
|
+
switch (among_var) {
|
189
|
+
case 1:
|
190
|
+
{ int ret = slice_del(z);
|
191
|
+
if (ret < 0) return ret;
|
192
|
+
}
|
193
|
+
z->I[0] = 1;
|
194
|
+
z->I[1] -= 1;
|
195
|
+
break;
|
196
|
+
case 2:
|
197
|
+
{ int ret = slice_del(z);
|
198
|
+
if (ret < 0) return ret;
|
199
|
+
}
|
200
|
+
z->I[0] = 3;
|
201
|
+
z->I[1] -= 1;
|
202
|
+
break;
|
203
|
+
case 3:
|
204
|
+
z->I[0] = 1;
|
205
|
+
{ int ret = slice_from_s(z, 1, s_1);
|
206
|
+
if (ret < 0) return ret;
|
207
|
+
}
|
208
|
+
z->I[1] -= 1;
|
209
|
+
break;
|
210
|
+
case 4:
|
211
|
+
z->I[0] = 3;
|
212
|
+
{ int ret = slice_from_s(z, 1, s_2);
|
213
|
+
if (ret < 0) return ret;
|
214
|
+
}
|
215
|
+
z->I[1] -= 1;
|
216
|
+
break;
|
217
|
+
case 5:
|
218
|
+
z->I[0] = 1;
|
219
|
+
z->I[1] -= 1;
|
220
|
+
{ int c1 = z->c;
|
221
|
+
{ int c2 = z->c;
|
222
|
+
if (in_grouping(z, g_vowel, 97, 117, 0)) goto lab1;
|
223
|
+
z->c = c2;
|
224
|
+
{ int ret = slice_from_s(z, 1, s_3);
|
225
|
+
if (ret < 0) return ret;
|
226
|
+
}
|
227
|
+
}
|
228
|
+
goto lab0;
|
229
|
+
lab1:
|
230
|
+
z->c = c1;
|
231
|
+
{ int ret = slice_del(z);
|
232
|
+
if (ret < 0) return ret;
|
233
|
+
}
|
234
|
+
}
|
235
|
+
lab0:
|
236
|
+
break;
|
237
|
+
case 6:
|
238
|
+
z->I[0] = 3;
|
239
|
+
z->I[1] -= 1;
|
240
|
+
{ int c3 = z->c;
|
241
|
+
{ int c4 = z->c;
|
242
|
+
if (in_grouping(z, g_vowel, 97, 117, 0)) goto lab3;
|
243
|
+
z->c = c4;
|
244
|
+
{ int ret = slice_from_s(z, 1, s_4);
|
245
|
+
if (ret < 0) return ret;
|
246
|
+
}
|
247
|
+
}
|
248
|
+
goto lab2;
|
249
|
+
lab3:
|
250
|
+
z->c = c3;
|
251
|
+
{ int ret = slice_del(z);
|
252
|
+
if (ret < 0) return ret;
|
253
|
+
}
|
254
|
+
}
|
255
|
+
lab2:
|
256
|
+
break;
|
257
|
+
}
|
258
|
+
return 1;
|
259
|
+
}
|
260
|
+
|
261
|
+
static int r_remove_second_order_prefix(struct SN_env * z) {
|
262
|
+
int among_var;
|
263
|
+
z->bra = z->c;
|
264
|
+
if (z->c + 1 >= z->l || z->p[z->c + 1] != 101) return 0;
|
265
|
+
among_var = find_among(z, a_4, 6);
|
266
|
+
if (!(among_var)) return 0;
|
267
|
+
z->ket = z->c;
|
268
|
+
switch (among_var) {
|
269
|
+
case 1:
|
270
|
+
{ int ret = slice_del(z);
|
271
|
+
if (ret < 0) return ret;
|
272
|
+
}
|
273
|
+
z->I[0] = 2;
|
274
|
+
z->I[1] -= 1;
|
275
|
+
break;
|
276
|
+
case 2:
|
277
|
+
{ int ret = slice_from_s(z, 4, s_5);
|
278
|
+
if (ret < 0) return ret;
|
279
|
+
}
|
280
|
+
z->I[1] -= 1;
|
281
|
+
break;
|
282
|
+
case 3:
|
283
|
+
{ int ret = slice_del(z);
|
284
|
+
if (ret < 0) return ret;
|
285
|
+
}
|
286
|
+
z->I[0] = 4;
|
287
|
+
z->I[1] -= 1;
|
288
|
+
break;
|
289
|
+
case 4:
|
290
|
+
{ int ret = slice_from_s(z, 4, s_6);
|
291
|
+
if (ret < 0) return ret;
|
292
|
+
}
|
293
|
+
z->I[0] = 4;
|
294
|
+
z->I[1] -= 1;
|
295
|
+
break;
|
296
|
+
}
|
297
|
+
return 1;
|
298
|
+
}
|
299
|
+
|
300
|
+
extern int indonesian_ISO_8859_1_stem(struct SN_env * z) {
|
301
|
+
z->I[1] = 0;
|
302
|
+
{ int c1 = z->c;
|
303
|
+
while(1) {
|
304
|
+
int c2 = z->c;
|
305
|
+
{
|
306
|
+
int ret = out_grouping(z, g_vowel, 97, 117, 1);
|
307
|
+
if (ret < 0) goto lab1;
|
308
|
+
z->c += ret;
|
309
|
+
}
|
310
|
+
z->I[1] += 1;
|
311
|
+
continue;
|
312
|
+
lab1:
|
313
|
+
z->c = c2;
|
314
|
+
break;
|
315
|
+
}
|
316
|
+
z->c = c1;
|
317
|
+
}
|
318
|
+
if (!(z->I[1] > 2)) return 0;
|
319
|
+
z->I[0] = 0;
|
320
|
+
z->lb = z->c; z->c = z->l;
|
321
|
+
|
322
|
+
{ int m3 = z->l - z->c; (void)m3;
|
323
|
+
{ int ret = r_remove_particle(z);
|
324
|
+
if (ret < 0) return ret;
|
325
|
+
}
|
326
|
+
z->c = z->l - m3;
|
327
|
+
}
|
328
|
+
if (!(z->I[1] > 2)) return 0;
|
329
|
+
{ int m4 = z->l - z->c; (void)m4;
|
330
|
+
{ int ret = r_remove_possessive_pronoun(z);
|
331
|
+
if (ret < 0) return ret;
|
332
|
+
}
|
333
|
+
z->c = z->l - m4;
|
334
|
+
}
|
335
|
+
z->c = z->lb;
|
336
|
+
if (!(z->I[1] > 2)) return 0;
|
337
|
+
{ int c5 = z->c;
|
338
|
+
{ int c_test6 = z->c;
|
339
|
+
{ int ret = r_remove_first_order_prefix(z);
|
340
|
+
if (ret == 0) goto lab3;
|
341
|
+
if (ret < 0) return ret;
|
342
|
+
}
|
343
|
+
{ int c7 = z->c;
|
344
|
+
{ int c_test8 = z->c;
|
345
|
+
if (!(z->I[1] > 2)) goto lab4;
|
346
|
+
z->lb = z->c; z->c = z->l;
|
347
|
+
|
348
|
+
{ int ret = r_remove_suffix(z);
|
349
|
+
if (ret == 0) goto lab4;
|
350
|
+
if (ret < 0) return ret;
|
351
|
+
}
|
352
|
+
z->c = z->lb;
|
353
|
+
z->c = c_test8;
|
354
|
+
}
|
355
|
+
if (!(z->I[1] > 2)) goto lab4;
|
356
|
+
{ int ret = r_remove_second_order_prefix(z);
|
357
|
+
if (ret == 0) goto lab4;
|
358
|
+
if (ret < 0) return ret;
|
359
|
+
}
|
360
|
+
lab4:
|
361
|
+
z->c = c7;
|
362
|
+
}
|
363
|
+
z->c = c_test6;
|
364
|
+
}
|
365
|
+
goto lab2;
|
366
|
+
lab3:
|
367
|
+
z->c = c5;
|
368
|
+
{ int c9 = z->c;
|
369
|
+
{ int ret = r_remove_second_order_prefix(z);
|
370
|
+
if (ret < 0) return ret;
|
371
|
+
}
|
372
|
+
z->c = c9;
|
373
|
+
}
|
374
|
+
{ int c10 = z->c;
|
375
|
+
if (!(z->I[1] > 2)) goto lab5;
|
376
|
+
z->lb = z->c; z->c = z->l;
|
377
|
+
|
378
|
+
{ int ret = r_remove_suffix(z);
|
379
|
+
if (ret == 0) goto lab5;
|
380
|
+
if (ret < 0) return ret;
|
381
|
+
}
|
382
|
+
z->c = z->lb;
|
383
|
+
lab5:
|
384
|
+
z->c = c10;
|
385
|
+
}
|
386
|
+
}
|
387
|
+
lab2:
|
388
|
+
return 1;
|
389
|
+
}
|
390
|
+
|
391
|
+
extern struct SN_env * indonesian_ISO_8859_1_create_env(void) { return SN_create_env(0, 2); }
|
392
|
+
|
393
|
+
extern void indonesian_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 0); }
|
394
|
+
|