Skip to content

Commit bba962f

Browse files
committed
Update snowball
Update to snowball tag v2.2.0. Minor changes only.
1 parent 65aaed2 commit bba962f

File tree

97 files changed

+2961
-3181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2961
-3181
lines changed

src/backend/snowball/README

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ We choose to include the derived files in the PostgreSQL distribution
2929
because most installations will not have the Snowball compiler available.
3030

3131
We are currently synced with the Snowball git commit
32-
4764395431c8f2a0b4fe18b816ab1fc966a45837 (tag v2.1.0)
33-
of 2021-01-21.
32+
48a67a2831005f49c48ec29a5837640e23e54e6b (tag v2.2.0)
33+
of 2021-11-10.
3434

3535
To update the PostgreSQL sources from a new Snowball version:
3636

src/backend/snowball/libstemmer/stem_ISO_8859_1_basque.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_catalan.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_danish.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_dutch.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_english.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_finnish.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_french.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_german.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_indonesian.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_irish.c

+6-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

@@ -231,34 +231,25 @@ static int r_mark_regions(struct SN_env * z) {
231231
z->c += ret;
232232
}
233233
z->I[2] = z->c;
234-
lab0:
235-
z->c = c1;
236-
}
237-
{ int c2 = z->c;
238-
{
239-
int ret = out_grouping(z, g_v, 97, 250, 1);
240-
if (ret < 0) goto lab1;
241-
z->c += ret;
242-
}
243234
{
244235
int ret = in_grouping(z, g_v, 97, 250, 1);
245-
if (ret < 0) goto lab1;
236+
if (ret < 0) goto lab0;
246237
z->c += ret;
247238
}
248239
z->I[1] = z->c;
249240
{
250241
int ret = out_grouping(z, g_v, 97, 250, 1);
251-
if (ret < 0) goto lab1;
242+
if (ret < 0) goto lab0;
252243
z->c += ret;
253244
}
254245
{
255246
int ret = in_grouping(z, g_v, 97, 250, 1);
256-
if (ret < 0) goto lab1;
247+
if (ret < 0) goto lab0;
257248
z->c += ret;
258249
}
259250
z->I[0] = z->c;
260-
lab1:
261-
z->c = c2;
251+
lab0:
252+
z->c = c1;
262253
}
263254
return 1;
264255
}

src/backend/snowball/libstemmer/stem_ISO_8859_1_italian.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_norwegian.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_porter.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_portuguese.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_spanish.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_1_swedish.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_2_hungarian.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_ISO_8859_2_romanian.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_KOI8_R_russian.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_UTF_8_arabic.c

+32-44
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

@@ -416,14 +416,16 @@ static const struct among a_6[4] =
416416
};
417417

418418
static const symbol s_7_0[2] = { 0xD8, 0xA8 };
419-
static const symbol s_7_1[4] = { 0xD8, 0xA8, 0xD8, 0xA8 };
420-
static const symbol s_7_2[4] = { 0xD9, 0x83, 0xD9, 0x83 };
419+
static const symbol s_7_1[4] = { 0xD8, 0xA8, 0xD8, 0xA7 };
420+
static const symbol s_7_2[4] = { 0xD8, 0xA8, 0xD8, 0xA8 };
421+
static const symbol s_7_3[4] = { 0xD9, 0x83, 0xD9, 0x83 };
421422

422-
static const struct among a_7[3] =
423+
static const struct among a_7[4] =
423424
{
424425
{ 2, s_7_0, -1, 1, 0},
425-
{ 4, s_7_1, 0, 2, 0},
426-
{ 4, s_7_2, -1, 3, 0}
426+
{ 4, s_7_1, 0, -1, 0},
427+
{ 4, s_7_2, 0, 2, 0},
428+
{ 4, s_7_3, -1, 3, 0}
427429
};
428430

429431
static const symbol s_8_0[4] = { 0xD8, 0xB3, 0xD8, 0xA3 };
@@ -660,17 +662,15 @@ static const symbol s_54[] = { 0xD8, 0xA3 };
660662
static const symbol s_55[] = { 0xD8, 0xA2 };
661663
static const symbol s_56[] = { 0xD8, 0xA7 };
662664
static const symbol s_57[] = { 0xD8, 0xA5 };
663-
static const symbol s_58[] = { 0xD9, 0x81, 0xD8, 0xA7 };
664-
static const symbol s_59[] = { 0xD9, 0x88, 0xD8, 0xA7 };
665-
static const symbol s_60[] = { 0xD8, 0xA8, 0xD8, 0xA7 };
666-
static const symbol s_61[] = { 0xD8, 0xA8 };
667-
static const symbol s_62[] = { 0xD9, 0x83 };
668-
static const symbol s_63[] = { 0xD9, 0x8A };
669-
static const symbol s_64[] = { 0xD8, 0xAA };
670-
static const symbol s_65[] = { 0xD9, 0x86 };
671-
static const symbol s_66[] = { 0xD8, 0xA3 };
672-
static const symbol s_67[] = { 0xD8, 0xA7, 0xD8, 0xB3, 0xD8, 0xAA };
673-
static const symbol s_68[] = { 0xD9, 0x8A };
665+
static const symbol s_58[] = { 0xD8, 0xA7 };
666+
static const symbol s_59[] = { 0xD8, 0xA8 };
667+
static const symbol s_60[] = { 0xD9, 0x83 };
668+
static const symbol s_61[] = { 0xD9, 0x8A };
669+
static const symbol s_62[] = { 0xD8, 0xAA };
670+
static const symbol s_63[] = { 0xD9, 0x86 };
671+
static const symbol s_64[] = { 0xD8, 0xA3 };
672+
static const symbol s_65[] = { 0xD8, 0xA7, 0xD8, 0xB3, 0xD8, 0xAA };
673+
static const symbol s_66[] = { 0xD9, 0x8A };
674674

675675
static int r_Normalize_pre(struct SN_env * z) {
676676
int among_var;
@@ -1080,23 +1080,17 @@ static int r_Prefix_Step1(struct SN_env * z) {
10801080
}
10811081

10821082
static int r_Prefix_Step2(struct SN_env * z) {
1083-
{ int c1 = z->c;
1084-
if (!(eq_s(z, 4, s_58))) goto lab0;
1085-
return 0;
1086-
lab0:
1087-
z->c = c1;
1088-
}
1089-
{ int c2 = z->c;
1090-
if (!(eq_s(z, 4, s_59))) goto lab1;
1091-
return 0;
1092-
lab1:
1093-
z->c = c2;
1094-
}
10951083
z->bra = z->c;
10961084
if (z->c + 1 >= z->l || (z->p[z->c + 1] != 129 && z->p[z->c + 1] != 136)) return 0;
10971085
if (!(find_among(z, a_5, 2))) return 0;
10981086
z->ket = z->c;
10991087
if (!(len_utf8(z->p) > 3)) return 0;
1088+
{ int c1 = z->c;
1089+
if (!(eq_s(z, 2, s_58))) goto lab0;
1090+
return 0;
1091+
lab0:
1092+
z->c = c1;
1093+
}
11001094
{ int ret = slice_del(z);
11011095
if (ret < 0) return ret;
11021096
}
@@ -1129,15 +1123,9 @@ static int r_Prefix_Step3a_Noun(struct SN_env * z) {
11291123

11301124
static int r_Prefix_Step3b_Noun(struct SN_env * z) {
11311125
int among_var;
1132-
{ int c1 = z->c;
1133-
if (!(eq_s(z, 4, s_60))) goto lab0;
1134-
return 0;
1135-
lab0:
1136-
z->c = c1;
1137-
}
11381126
z->bra = z->c;
11391127
if (z->c + 1 >= z->l || (z->p[z->c + 1] != 168 && z->p[z->c + 1] != 131)) return 0;
1140-
among_var = find_among(z, a_7, 3);
1128+
among_var = find_among(z, a_7, 4);
11411129
if (!(among_var)) return 0;
11421130
z->ket = z->c;
11431131
switch (among_var) {
@@ -1149,13 +1137,13 @@ static int r_Prefix_Step3b_Noun(struct SN_env * z) {
11491137
break;
11501138
case 2:
11511139
if (!(len_utf8(z->p) > 3)) return 0;
1152-
{ int ret = slice_from_s(z, 2, s_61);
1140+
{ int ret = slice_from_s(z, 2, s_59);
11531141
if (ret < 0) return ret;
11541142
}
11551143
break;
11561144
case 3:
11571145
if (!(len_utf8(z->p) > 3)) return 0;
1158-
{ int ret = slice_from_s(z, 2, s_62);
1146+
{ int ret = slice_from_s(z, 2, s_60);
11591147
if (ret < 0) return ret;
11601148
}
11611149
break;
@@ -1172,25 +1160,25 @@ static int r_Prefix_Step3_Verb(struct SN_env * z) {
11721160
switch (among_var) {
11731161
case 1:
11741162
if (!(len_utf8(z->p) > 4)) return 0;
1175-
{ int ret = slice_from_s(z, 2, s_63);
1163+
{ int ret = slice_from_s(z, 2, s_61);
11761164
if (ret < 0) return ret;
11771165
}
11781166
break;
11791167
case 2:
11801168
if (!(len_utf8(z->p) > 4)) return 0;
1181-
{ int ret = slice_from_s(z, 2, s_64);
1169+
{ int ret = slice_from_s(z, 2, s_62);
11821170
if (ret < 0) return ret;
11831171
}
11841172
break;
11851173
case 3:
11861174
if (!(len_utf8(z->p) > 4)) return 0;
1187-
{ int ret = slice_from_s(z, 2, s_65);
1175+
{ int ret = slice_from_s(z, 2, s_63);
11881176
if (ret < 0) return ret;
11891177
}
11901178
break;
11911179
case 4:
11921180
if (!(len_utf8(z->p) > 4)) return 0;
1193-
{ int ret = slice_from_s(z, 2, s_66);
1181+
{ int ret = slice_from_s(z, 2, s_64);
11941182
if (ret < 0) return ret;
11951183
}
11961184
break;
@@ -1206,7 +1194,7 @@ static int r_Prefix_Step4_Verb(struct SN_env * z) {
12061194
if (!(len_utf8(z->p) > 4)) return 0;
12071195
z->I[1] = 1;
12081196
z->I[2] = 0;
1209-
{ int ret = slice_from_s(z, 6, s_67);
1197+
{ int ret = slice_from_s(z, 6, s_65);
12101198
if (ret < 0) return ret;
12111199
}
12121200
return 1;
@@ -1417,7 +1405,7 @@ static int r_Suffix_All_alef_maqsura(struct SN_env * z) {
14171405
if (z->c - 1 <= z->lb || z->p[z->c - 1] != 137) return 0;
14181406
if (!(find_among_b(z, a_21, 1))) return 0;
14191407
z->bra = z->c;
1420-
{ int ret = slice_from_s(z, 2, s_68);
1408+
{ int ret = slice_from_s(z, 2, s_66);
14211409
if (ret < 0) return ret;
14221410
}
14231411
return 1;

src/backend/snowball/libstemmer/stem_UTF_8_armenian.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_UTF_8_basque.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_UTF_8_catalan.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_UTF_8_danish.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_UTF_8_dutch.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_UTF_8_english.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_UTF_8_finnish.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_UTF_8_french.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

src/backend/snowball/libstemmer/stem_UTF_8_german.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by Snowball 2.1.0 - https://snowballstem.org/ */
1+
/* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
22

33
#include "header.h"
44

0 commit comments

Comments
 (0)