isomorfeus-ferret 0.12.2 → 0.12.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +612 -612
  3. data/README.md +80 -44
  4. data/ext/isomorfeus_ferret_ext/bm_hash.c +9 -6
  5. data/ext/isomorfeus_ferret_ext/bm_micro_string.c +4 -2
  6. data/ext/isomorfeus_ferret_ext/frb_search.c +14 -2
  7. data/ext/isomorfeus_ferret_ext/frb_store.c +34 -5
  8. data/ext/isomorfeus_ferret_ext/frt_posh.h +11 -19
  9. data/ext/isomorfeus_ferret_ext/frt_q_parser.c +1844 -1911
  10. data/ext/isomorfeus_ferret_ext/frt_q_phrase.c +12 -15
  11. data/ext/isomorfeus_ferret_ext/frt_scanner.c +1 -0
  12. data/ext/isomorfeus_ferret_ext/frt_scanner_mb.c +1 -0
  13. data/ext/isomorfeus_ferret_ext/frt_scanner_utf8.c +1 -0
  14. data/ext/isomorfeus_ferret_ext/frt_search.h +1 -1
  15. data/ext/isomorfeus_ferret_ext/libstemmer.c +14 -11
  16. data/ext/isomorfeus_ferret_ext/libstemmer.h +4 -9
  17. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_basque.c +1167 -0
  18. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_basque.h +6 -0
  19. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_catalan.c +1433 -0
  20. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_catalan.h +6 -0
  21. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_danish.c +120 -143
  22. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_danish.h +1 -2
  23. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_dutch.c +217 -237
  24. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_dutch.h +1 -1
  25. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_english.c +377 -432
  26. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_english.h +1 -1
  27. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_finnish.c +298 -342
  28. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_finnish.h +1 -2
  29. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_french.c +530 -524
  30. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_french.h +1 -1
  31. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_german.c +201 -214
  32. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_german.h +1 -1
  33. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_hungarian.c +1 -1
  34. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_indonesian.c +394 -0
  35. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_indonesian.h +6 -0
  36. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_irish.c +457 -0
  37. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_irish.h +6 -0
  38. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_italian.c +396 -439
  39. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_italian.h +1 -1
  40. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_norwegian.c +104 -128
  41. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_norwegian.h +1 -1
  42. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_porter.c +242 -273
  43. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_porter.h +1 -1
  44. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_portuguese.c +406 -461
  45. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_portuguese.h +1 -2
  46. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_spanish.c +405 -456
  47. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_spanish.h +1 -1
  48. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_swedish.c +108 -126
  49. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_swedish.h +1 -1
  50. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_hungarian.c +849 -0
  51. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_hungarian.h +6 -0
  52. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_romanian.c +373 -405
  53. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_romanian.h +1 -1
  54. data/ext/isomorfeus_ferret_ext/stem_KOI8_R_russian.c +288 -305
  55. data/ext/isomorfeus_ferret_ext/stem_KOI8_R_russian.h +1 -1
  56. data/ext/isomorfeus_ferret_ext/stem_UTF_8_arabic.c +1651 -0
  57. data/ext/isomorfeus_ferret_ext/stem_UTF_8_arabic.h +6 -0
  58. data/ext/isomorfeus_ferret_ext/stem_UTF_8_armenian.c +546 -0
  59. data/ext/isomorfeus_ferret_ext/stem_UTF_8_armenian.h +6 -0
  60. data/ext/isomorfeus_ferret_ext/stem_UTF_8_basque.c +1171 -0
  61. data/ext/isomorfeus_ferret_ext/stem_UTF_8_basque.h +6 -0
  62. data/ext/isomorfeus_ferret_ext/stem_UTF_8_catalan.c +1436 -0
  63. data/ext/isomorfeus_ferret_ext/stem_UTF_8_catalan.h +6 -0
  64. data/ext/isomorfeus_ferret_ext/stem_UTF_8_danish.c +121 -141
  65. data/ext/isomorfeus_ferret_ext/stem_UTF_8_danish.h +1 -1
  66. data/ext/isomorfeus_ferret_ext/stem_UTF_8_dutch.c +221 -241
  67. data/ext/isomorfeus_ferret_ext/stem_UTF_8_dutch.h +1 -1
  68. data/ext/isomorfeus_ferret_ext/stem_UTF_8_english.c +381 -431
  69. data/ext/isomorfeus_ferret_ext/stem_UTF_8_english.h +1 -1
  70. data/ext/isomorfeus_ferret_ext/stem_UTF_8_finnish.c +300 -345
  71. data/ext/isomorfeus_ferret_ext/stem_UTF_8_finnish.h +1 -1
  72. data/ext/isomorfeus_ferret_ext/stem_UTF_8_french.c +518 -511
  73. data/ext/isomorfeus_ferret_ext/stem_UTF_8_french.h +1 -1
  74. data/ext/isomorfeus_ferret_ext/stem_UTF_8_german.c +201 -209
  75. data/ext/isomorfeus_ferret_ext/stem_UTF_8_german.h +1 -1
  76. data/ext/isomorfeus_ferret_ext/stem_UTF_8_greek.c +3660 -0
  77. data/ext/isomorfeus_ferret_ext/stem_UTF_8_greek.h +6 -0
  78. data/ext/isomorfeus_ferret_ext/stem_UTF_8_hindi.c +309 -0
  79. data/ext/isomorfeus_ferret_ext/stem_UTF_8_hindi.h +6 -0
  80. data/ext/isomorfeus_ferret_ext/stem_UTF_8_hungarian.c +306 -671
  81. data/ext/isomorfeus_ferret_ext/stem_UTF_8_hungarian.h +1 -1
  82. data/ext/isomorfeus_ferret_ext/stem_UTF_8_indonesian.c +394 -0
  83. data/ext/isomorfeus_ferret_ext/stem_UTF_8_indonesian.h +6 -0
  84. data/ext/isomorfeus_ferret_ext/stem_UTF_8_irish.c +457 -0
  85. data/ext/isomorfeus_ferret_ext/stem_UTF_8_irish.h +6 -0
  86. data/ext/isomorfeus_ferret_ext/stem_UTF_8_italian.c +400 -442
  87. data/ext/isomorfeus_ferret_ext/stem_UTF_8_italian.h +1 -1
  88. data/ext/isomorfeus_ferret_ext/stem_UTF_8_lithuanian.c +824 -0
  89. data/ext/isomorfeus_ferret_ext/stem_UTF_8_lithuanian.h +6 -0
  90. data/ext/isomorfeus_ferret_ext/stem_UTF_8_nepali.c +408 -0
  91. data/ext/isomorfeus_ferret_ext/stem_UTF_8_nepali.h +6 -0
  92. data/ext/isomorfeus_ferret_ext/stem_UTF_8_norwegian.c +105 -127
  93. data/ext/isomorfeus_ferret_ext/stem_UTF_8_norwegian.h +1 -1
  94. data/ext/isomorfeus_ferret_ext/stem_UTF_8_porter.c +245 -276
  95. data/ext/isomorfeus_ferret_ext/stem_UTF_8_porter.h +1 -1
  96. data/ext/isomorfeus_ferret_ext/stem_UTF_8_portuguese.c +409 -464
  97. data/ext/isomorfeus_ferret_ext/stem_UTF_8_portuguese.h +1 -1
  98. data/ext/isomorfeus_ferret_ext/stem_UTF_8_romanian.c +376 -408
  99. data/ext/isomorfeus_ferret_ext/stem_UTF_8_romanian.h +1 -1
  100. data/ext/isomorfeus_ferret_ext/stem_UTF_8_russian.c +272 -287
  101. data/ext/isomorfeus_ferret_ext/stem_UTF_8_russian.h +1 -1
  102. data/ext/isomorfeus_ferret_ext/stem_UTF_8_serbian.c +6530 -0
  103. data/ext/isomorfeus_ferret_ext/stem_UTF_8_serbian.h +6 -0
  104. data/ext/isomorfeus_ferret_ext/stem_UTF_8_spanish.c +407 -458
  105. data/ext/isomorfeus_ferret_ext/stem_UTF_8_spanish.h +1 -1
  106. data/ext/isomorfeus_ferret_ext/stem_UTF_8_swedish.c +110 -125
  107. data/ext/isomorfeus_ferret_ext/stem_UTF_8_swedish.h +1 -1
  108. data/ext/isomorfeus_ferret_ext/stem_UTF_8_tamil.c +1865 -0
  109. data/ext/isomorfeus_ferret_ext/stem_UTF_8_tamil.h +6 -0
  110. data/ext/isomorfeus_ferret_ext/stem_UTF_8_turkish.c +698 -806
  111. data/ext/isomorfeus_ferret_ext/stem_UTF_8_turkish.h +1 -1
  112. data/ext/isomorfeus_ferret_ext/stem_UTF_8_yiddish.c +1220 -0
  113. data/ext/isomorfeus_ferret_ext/stem_UTF_8_yiddish.h +6 -0
  114. data/ext/isomorfeus_ferret_ext/stem_api.c +1 -9
  115. data/ext/isomorfeus_ferret_ext/stem_api.h +1 -3
  116. data/ext/isomorfeus_ferret_ext/stem_header.h +30 -26
  117. data/ext/isomorfeus_ferret_ext/stem_modules.h +113 -26
  118. data/ext/isomorfeus_ferret_ext/stem_modules.txt +18 -5
  119. data/ext/isomorfeus_ferret_ext/stem_utilities.c +167 -132
  120. data/ext/isomorfeus_ferret_ext/test.c +7 -1
  121. data/ext/isomorfeus_ferret_ext/test_search.c +0 -1
  122. data/lib/isomorfeus/ferret/index/index.rb +1 -1
  123. data/lib/isomorfeus/ferret/version.rb +1 -1
  124. metadata +43 -7
  125. data/ext/isomorfeus_ferret_ext/q_parser.y +0 -1366
@@ -1,4 +1,4 @@
1
- /* This file was generated automatically by the Snowball to ANSI C compiler */
1
+ /* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
2
2
 
3
3
  extern struct SN_env * spanish_UTF_8_create_env(void);
4
4
  extern void spanish_UTF_8_close_env(struct SN_env * z);
@@ -1,8 +1,9 @@
1
- /* This file was generated automatically by the Snowball to ANSI C compiler */
1
+ /* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
2
2
 
3
3
  #include "stem_header.h"
4
4
 
5
5
  extern int swedish_UTF_8_stem(struct SN_env * z);
6
+
6
7
  static int r_other_suffix(struct SN_env * z);
7
8
  static int r_consonant_pair(struct SN_env * z);
8
9
  static int r_main_suffix(struct SN_env * z);
@@ -51,43 +52,43 @@ static const symbol s_0_36[3] = { 'a', 's', 't' };
51
52
 
52
53
  static const struct among a_0[37] =
53
54
  {
54
- /* 0 */ { 1, s_0_0, -1, 1, 0},
55
- /* 1 */ { 4, s_0_1, 0, 1, 0},
56
- /* 2 */ { 4, s_0_2, 0, 1, 0},
57
- /* 3 */ { 7, s_0_3, 2, 1, 0},
58
- /* 4 */ { 4, s_0_4, 0, 1, 0},
59
- /* 5 */ { 2, s_0_5, -1, 1, 0},
60
- /* 6 */ { 1, s_0_6, -1, 1, 0},
61
- /* 7 */ { 3, s_0_7, 6, 1, 0},
62
- /* 8 */ { 4, s_0_8, 6, 1, 0},
63
- /* 9 */ { 4, s_0_9, 6, 1, 0},
64
- /* 10 */ { 3, s_0_10, 6, 1, 0},
65
- /* 11 */ { 4, s_0_11, 6, 1, 0},
66
- /* 12 */ { 2, s_0_12, -1, 1, 0},
67
- /* 13 */ { 5, s_0_13, 12, 1, 0},
68
- /* 14 */ { 4, s_0_14, 12, 1, 0},
69
- /* 15 */ { 5, s_0_15, 12, 1, 0},
70
- /* 16 */ { 3, s_0_16, -1, 1, 0},
71
- /* 17 */ { 2, s_0_17, -1, 1, 0},
72
- /* 18 */ { 2, s_0_18, -1, 1, 0},
73
- /* 19 */ { 5, s_0_19, 18, 1, 0},
74
- /* 20 */ { 2, s_0_20, -1, 1, 0},
75
- /* 21 */ { 1, s_0_21, -1, 2, 0},
76
- /* 22 */ { 2, s_0_22, 21, 1, 0},
77
- /* 23 */ { 5, s_0_23, 22, 1, 0},
78
- /* 24 */ { 5, s_0_24, 22, 1, 0},
79
- /* 25 */ { 5, s_0_25, 22, 1, 0},
80
- /* 26 */ { 2, s_0_26, 21, 1, 0},
81
- /* 27 */ { 4, s_0_27, 26, 1, 0},
82
- /* 28 */ { 5, s_0_28, 26, 1, 0},
83
- /* 29 */ { 3, s_0_29, 21, 1, 0},
84
- /* 30 */ { 5, s_0_30, 29, 1, 0},
85
- /* 31 */ { 6, s_0_31, 29, 1, 0},
86
- /* 32 */ { 4, s_0_32, 21, 1, 0},
87
- /* 33 */ { 2, s_0_33, -1, 1, 0},
88
- /* 34 */ { 5, s_0_34, -1, 1, 0},
89
- /* 35 */ { 3, s_0_35, -1, 1, 0},
90
- /* 36 */ { 3, s_0_36, -1, 1, 0}
55
+ { 1, s_0_0, -1, 1, 0},
56
+ { 4, s_0_1, 0, 1, 0},
57
+ { 4, s_0_2, 0, 1, 0},
58
+ { 7, s_0_3, 2, 1, 0},
59
+ { 4, s_0_4, 0, 1, 0},
60
+ { 2, s_0_5, -1, 1, 0},
61
+ { 1, s_0_6, -1, 1, 0},
62
+ { 3, s_0_7, 6, 1, 0},
63
+ { 4, s_0_8, 6, 1, 0},
64
+ { 4, s_0_9, 6, 1, 0},
65
+ { 3, s_0_10, 6, 1, 0},
66
+ { 4, s_0_11, 6, 1, 0},
67
+ { 2, s_0_12, -1, 1, 0},
68
+ { 5, s_0_13, 12, 1, 0},
69
+ { 4, s_0_14, 12, 1, 0},
70
+ { 5, s_0_15, 12, 1, 0},
71
+ { 3, s_0_16, -1, 1, 0},
72
+ { 2, s_0_17, -1, 1, 0},
73
+ { 2, s_0_18, -1, 1, 0},
74
+ { 5, s_0_19, 18, 1, 0},
75
+ { 2, s_0_20, -1, 1, 0},
76
+ { 1, s_0_21, -1, 2, 0},
77
+ { 2, s_0_22, 21, 1, 0},
78
+ { 5, s_0_23, 22, 1, 0},
79
+ { 5, s_0_24, 22, 1, 0},
80
+ { 5, s_0_25, 22, 1, 0},
81
+ { 2, s_0_26, 21, 1, 0},
82
+ { 4, s_0_27, 26, 1, 0},
83
+ { 5, s_0_28, 26, 1, 0},
84
+ { 3, s_0_29, 21, 1, 0},
85
+ { 5, s_0_30, 29, 1, 0},
86
+ { 6, s_0_31, 29, 1, 0},
87
+ { 4, s_0_32, 21, 1, 0},
88
+ { 2, s_0_33, -1, 1, 0},
89
+ { 5, s_0_34, -1, 1, 0},
90
+ { 3, s_0_35, -1, 1, 0},
91
+ { 3, s_0_36, -1, 1, 0}
91
92
  };
92
93
 
93
94
  static const symbol s_1_0[2] = { 'd', 'd' };
@@ -100,13 +101,13 @@ static const symbol s_1_6[2] = { 't', 't' };
100
101
 
101
102
  static const struct among a_1[7] =
102
103
  {
103
- /* 0 */ { 2, s_1_0, -1, -1, 0},
104
- /* 1 */ { 2, s_1_1, -1, -1, 0},
105
- /* 2 */ { 2, s_1_2, -1, -1, 0},
106
- /* 3 */ { 2, s_1_3, -1, -1, 0},
107
- /* 4 */ { 2, s_1_4, -1, -1, 0},
108
- /* 5 */ { 2, s_1_5, -1, -1, 0},
109
- /* 6 */ { 2, s_1_6, -1, -1, 0}
104
+ { 2, s_1_0, -1, -1, 0},
105
+ { 2, s_1_1, -1, -1, 0},
106
+ { 2, s_1_2, -1, -1, 0},
107
+ { 2, s_1_3, -1, -1, 0},
108
+ { 2, s_1_4, -1, -1, 0},
109
+ { 2, s_1_5, -1, -1, 0},
110
+ { 2, s_1_6, -1, -1, 0}
110
111
  };
111
112
 
112
113
  static const symbol s_2_0[2] = { 'i', 'g' };
@@ -117,11 +118,11 @@ static const symbol s_2_4[5] = { 'l', 0xC3, 0xB6, 's', 't' };
117
118
 
118
119
  static const struct among a_2[5] =
119
120
  {
120
- /* 0 */ { 2, s_2_0, -1, 1, 0},
121
- /* 1 */ { 3, s_2_1, 0, 1, 0},
122
- /* 2 */ { 3, s_2_2, -1, 1, 0},
123
- /* 3 */ { 5, s_2_3, -1, 3, 0},
124
- /* 4 */ { 5, s_2_4, -1, 2, 0}
121
+ { 2, s_2_0, -1, 1, 0},
122
+ { 3, s_2_1, 0, 1, 0},
123
+ { 3, s_2_2, -1, 1, 0},
124
+ { 5, s_2_3, -1, 3, 0},
125
+ { 5, s_2_4, -1, 2, 0}
125
126
  };
126
127
 
127
128
  static const unsigned char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 32 };
@@ -132,54 +133,51 @@ static const symbol s_0[] = { 'l', 0xC3, 0xB6, 's' };
132
133
  static const symbol s_1[] = { 'f', 'u', 'l', 'l' };
133
134
 
134
135
  static int r_mark_regions(struct SN_env * z) {
135
- z->I[0] = z->l;
136
- { int c_test = z->c; /* test, line 29 */
137
- { int ret = skip_utf8(z->p, z->c, 0, z->l, + 3);
136
+ z->I[1] = z->l;
137
+ { int c_test1 = z->c;
138
+ { int ret = skip_utf8(z->p, z->c, z->l, 3);
138
139
  if (ret < 0) return 0;
139
- z->c = ret; /* hop, line 29 */
140
+ z->c = ret;
140
141
  }
141
- z->I[1] = z->c; /* setmark x, line 29 */
142
- z->c = c_test;
142
+ z->I[0] = z->c;
143
+ z->c = c_test1;
143
144
  }
144
- if (out_grouping_U(z, g_v, 97, 246, 1) < 0) return 0; /* goto */ /* grouping v, line 30 */
145
- { /* gopast */ /* non v, line 30 */
145
+ if (out_grouping_U(z, g_v, 97, 246, 1) < 0) return 0;
146
+ {
146
147
  int ret = in_grouping_U(z, g_v, 97, 246, 1);
147
148
  if (ret < 0) return 0;
148
149
  z->c += ret;
149
150
  }
150
- z->I[0] = z->c; /* setmark p1, line 30 */
151
- /* try, line 31 */
152
- if (!(z->I[0] < z->I[1])) goto lab0;
153
- z->I[0] = z->I[1];
151
+ z->I[1] = z->c;
152
+
153
+ if (!(z->I[1] < z->I[0])) goto lab0;
154
+ z->I[1] = z->I[0];
154
155
  lab0:
155
156
  return 1;
156
157
  }
157
158
 
158
159
  static int r_main_suffix(struct SN_env * z) {
159
160
  int among_var;
160
- { int mlimit; /* setlimit, line 37 */
161
- int m1 = z->l - z->c; (void)m1;
162
- if (z->c < z->I[0]) return 0;
163
- z->c = z->I[0]; /* tomark, line 37 */
164
- mlimit = z->lb; z->lb = z->c;
165
- z->c = z->l - m1;
166
- z->ket = z->c; /* [, line 37 */
167
- if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1851442 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
168
- among_var = find_among_b(z, a_0, 37); /* substring, line 37 */
169
- if (!(among_var)) { z->lb = mlimit; return 0; }
170
- z->bra = z->c; /* ], line 37 */
171
- z->lb = mlimit;
161
+
162
+ { int mlimit1;
163
+ if (z->c < z->I[1]) return 0;
164
+ mlimit1 = z->lb; z->lb = z->I[1];
165
+ z->ket = z->c;
166
+ if (z->c <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1851442 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit1; return 0; }
167
+ among_var = find_among_b(z, a_0, 37);
168
+ if (!(among_var)) { z->lb = mlimit1; return 0; }
169
+ z->bra = z->c;
170
+ z->lb = mlimit1;
172
171
  }
173
- switch(among_var) {
174
- case 0: return 0;
172
+ switch (among_var) {
175
173
  case 1:
176
- { int ret = slice_del(z); /* delete, line 44 */
174
+ { int ret = slice_del(z);
177
175
  if (ret < 0) return ret;
178
176
  }
179
177
  break;
180
178
  case 2:
181
179
  if (in_grouping_b_U(z, g_s_ending, 98, 121, 0)) return 0;
182
- { int ret = slice_del(z); /* delete, line 46 */
180
+ { int ret = slice_del(z);
183
181
  if (ret < 0) return ret;
184
182
  }
185
183
  break;
@@ -188,107 +186,94 @@ static int r_main_suffix(struct SN_env * z) {
188
186
  }
189
187
 
190
188
  static int r_consonant_pair(struct SN_env * z) {
191
- { int mlimit; /* setlimit, line 50 */
192
- int m1 = z->l - z->c; (void)m1;
193
- if (z->c < z->I[0]) return 0;
194
- z->c = z->I[0]; /* tomark, line 50 */
195
- mlimit = z->lb; z->lb = z->c;
196
- z->c = z->l - m1;
197
- { int m2 = z->l - z->c; (void)m2; /* and, line 52 */
198
- if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1064976 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
199
- if (!(find_among_b(z, a_1, 7))) { z->lb = mlimit; return 0; } /* among, line 51 */
189
+
190
+ { int mlimit1;
191
+ if (z->c < z->I[1]) return 0;
192
+ mlimit1 = z->lb; z->lb = z->I[1];
193
+ { int m2 = z->l - z->c; (void)m2;
194
+ if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1064976 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit1; return 0; }
195
+ if (!(find_among_b(z, a_1, 7))) { z->lb = mlimit1; return 0; }
200
196
  z->c = z->l - m2;
201
- z->ket = z->c; /* [, line 52 */
202
- { int ret = skip_utf8(z->p, z->c, z->lb, 0, -1);
203
- if (ret < 0) { z->lb = mlimit; return 0; }
204
- z->c = ret; /* next, line 52 */
197
+ z->ket = z->c;
198
+ { int ret = skip_b_utf8(z->p, z->c, z->lb, 1);
199
+ if (ret < 0) { z->lb = mlimit1; return 0; }
200
+ z->c = ret;
205
201
  }
206
- z->bra = z->c; /* ], line 52 */
207
- { int ret = slice_del(z); /* delete, line 52 */
202
+ z->bra = z->c;
203
+ { int ret = slice_del(z);
208
204
  if (ret < 0) return ret;
209
205
  }
210
206
  }
211
- z->lb = mlimit;
207
+ z->lb = mlimit1;
212
208
  }
213
209
  return 1;
214
210
  }
215
211
 
216
212
  static int r_other_suffix(struct SN_env * z) {
217
213
  int among_var;
218
- { int mlimit; /* setlimit, line 55 */
219
- int m1 = z->l - z->c; (void)m1;
220
- if (z->c < z->I[0]) return 0;
221
- z->c = z->I[0]; /* tomark, line 55 */
222
- mlimit = z->lb; z->lb = z->c;
223
- z->c = z->l - m1;
224
- z->ket = z->c; /* [, line 56 */
225
- if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1572992 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit; return 0; }
226
- among_var = find_among_b(z, a_2, 5); /* substring, line 56 */
227
- if (!(among_var)) { z->lb = mlimit; return 0; }
228
- z->bra = z->c; /* ], line 56 */
229
- switch(among_var) {
230
- case 0: { z->lb = mlimit; return 0; }
214
+
215
+ { int mlimit1;
216
+ if (z->c < z->I[1]) return 0;
217
+ mlimit1 = z->lb; z->lb = z->I[1];
218
+ z->ket = z->c;
219
+ if (z->c - 1 <= z->lb || z->p[z->c - 1] >> 5 != 3 || !((1572992 >> (z->p[z->c - 1] & 0x1f)) & 1)) { z->lb = mlimit1; return 0; }
220
+ among_var = find_among_b(z, a_2, 5);
221
+ if (!(among_var)) { z->lb = mlimit1; return 0; }
222
+ z->bra = z->c;
223
+ switch (among_var) {
231
224
  case 1:
232
- { int ret = slice_del(z); /* delete, line 57 */
225
+ { int ret = slice_del(z);
233
226
  if (ret < 0) return ret;
234
227
  }
235
228
  break;
236
229
  case 2:
237
- { int ret = slice_from_s(z, 4, s_0); /* <-, line 58 */
230
+ { int ret = slice_from_s(z, 4, s_0);
238
231
  if (ret < 0) return ret;
239
232
  }
240
233
  break;
241
234
  case 3:
242
- { int ret = slice_from_s(z, 4, s_1); /* <-, line 59 */
235
+ { int ret = slice_from_s(z, 4, s_1);
243
236
  if (ret < 0) return ret;
244
237
  }
245
238
  break;
246
239
  }
247
- z->lb = mlimit;
240
+ z->lb = mlimit1;
248
241
  }
249
242
  return 1;
250
243
  }
251
244
 
252
245
  extern int swedish_UTF_8_stem(struct SN_env * z) {
253
- { int c1 = z->c; /* do, line 66 */
246
+ { int c1 = z->c;
254
247
  { int ret = r_mark_regions(z);
255
- if (ret == 0) goto lab0; /* call mark_regions, line 66 */
256
248
  if (ret < 0) return ret;
257
249
  }
258
- lab0:
259
250
  z->c = c1;
260
251
  }
261
- z->lb = z->c; z->c = z->l; /* backwards, line 67 */
252
+ z->lb = z->c; z->c = z->l;
262
253
 
263
- { int m2 = z->l - z->c; (void)m2; /* do, line 68 */
254
+ { int m2 = z->l - z->c; (void)m2;
264
255
  { int ret = r_main_suffix(z);
265
- if (ret == 0) goto lab1; /* call main_suffix, line 68 */
266
256
  if (ret < 0) return ret;
267
257
  }
268
- lab1:
269
258
  z->c = z->l - m2;
270
259
  }
271
- { int m3 = z->l - z->c; (void)m3; /* do, line 69 */
260
+ { int m3 = z->l - z->c; (void)m3;
272
261
  { int ret = r_consonant_pair(z);
273
- if (ret == 0) goto lab2; /* call consonant_pair, line 69 */
274
262
  if (ret < 0) return ret;
275
263
  }
276
- lab2:
277
264
  z->c = z->l - m3;
278
265
  }
279
- { int m4 = z->l - z->c; (void)m4; /* do, line 70 */
266
+ { int m4 = z->l - z->c; (void)m4;
280
267
  { int ret = r_other_suffix(z);
281
- if (ret == 0) goto lab3; /* call other_suffix, line 70 */
282
268
  if (ret < 0) return ret;
283
269
  }
284
- lab3:
285
270
  z->c = z->l - m4;
286
271
  }
287
272
  z->c = z->lb;
288
273
  return 1;
289
274
  }
290
275
 
291
- extern struct SN_env * swedish_UTF_8_create_env(void) { return SN_create_env(0, 2, 0); }
276
+ extern struct SN_env * swedish_UTF_8_create_env(void) { return SN_create_env(0, 2); }
292
277
 
293
278
  extern void swedish_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }
294
279
 
@@ -1,4 +1,4 @@
1
- /* This file was generated automatically by the Snowball to ANSI C compiler */
1
+ /* Generated by Snowball 2.2.0 - https://snowballstem.org/ */
2
2
 
3
3
  extern struct SN_env * swedish_UTF_8_create_env(void);
4
4
  extern void swedish_UTF_8_close_env(struct SN_env * z);