isomorfeus-ferret 0.12.1 → 0.12.5

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