middleman-search-gds 0.11.0a
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +191 -0
- data/lib/middleman-search.rb +7 -0
- data/lib/middleman-search/extension.rb +35 -0
- data/lib/middleman-search/search-index-resource.rb +157 -0
- data/lib/middleman-search/version.rb +3 -0
- data/lib/middleman_extension.rb +1 -0
- data/middleman-search.gemspec +27 -0
- data/vendor/assets/javascripts/lunr.da.js +273 -0
- data/vendor/assets/javascripts/lunr.de.js +373 -0
- data/vendor/assets/javascripts/lunr.du.js +437 -0
- data/vendor/assets/javascripts/lunr.es.js +588 -0
- data/vendor/assets/javascripts/lunr.fi.js +529 -0
- data/vendor/assets/javascripts/lunr.fr.js +691 -0
- data/vendor/assets/javascripts/lunr.hu.js +554 -0
- data/vendor/assets/javascripts/lunr.it.js +605 -0
- data/vendor/assets/javascripts/lunr.jp.js +118 -0
- data/vendor/assets/javascripts/lunr.min.js +7 -0
- data/vendor/assets/javascripts/lunr.no.js +246 -0
- data/vendor/assets/javascripts/lunr.pt.js +559 -0
- data/vendor/assets/javascripts/lunr.ro.js +547 -0
- data/vendor/assets/javascripts/lunr.ru.js +380 -0
- data/vendor/assets/javascripts/lunr.stemmer.support.js +282 -0
- data/vendor/assets/javascripts/lunr.sv.js +245 -0
- data/vendor/assets/javascripts/lunr.tr.js +1063 -0
- metadata +147 -0
@@ -0,0 +1,547 @@
|
|
1
|
+
/*!
|
2
|
+
* Lunr languages, `Romanian` language
|
3
|
+
* https://github.com/MihaiValentin/lunr-languages
|
4
|
+
*
|
5
|
+
* Copyright 2014, Mihai Valentin
|
6
|
+
* http://www.mozilla.org/MPL/
|
7
|
+
*/
|
8
|
+
/*!
|
9
|
+
* based on
|
10
|
+
* Snowball JavaScript Library v0.3
|
11
|
+
* http://code.google.com/p/urim/
|
12
|
+
* http://snowball.tartarus.org/
|
13
|
+
*
|
14
|
+
* Copyright 2010, Oleg Mazko
|
15
|
+
* http://www.mozilla.org/MPL/
|
16
|
+
*/
|
17
|
+
|
18
|
+
/**
|
19
|
+
* export the module via AMD, CommonJS or as a browser global
|
20
|
+
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
21
|
+
*/
|
22
|
+
;
|
23
|
+
(function(root, factory) {
|
24
|
+
if (typeof define === 'function' && define.amd) {
|
25
|
+
// AMD. Register as an anonymous module.
|
26
|
+
define(factory)
|
27
|
+
} else if (typeof exports === 'object') {
|
28
|
+
/**
|
29
|
+
* Node. Does not work with strict CommonJS, but
|
30
|
+
* only CommonJS-like environments that support module.exports,
|
31
|
+
* like Node.
|
32
|
+
*/
|
33
|
+
module.exports = factory()
|
34
|
+
} else {
|
35
|
+
// Browser globals (root is window)
|
36
|
+
factory()(root.lunr);
|
37
|
+
}
|
38
|
+
}(this, function() {
|
39
|
+
/**
|
40
|
+
* Just return a value to define the module export.
|
41
|
+
* This example returns an object, but the module
|
42
|
+
* can return a function as the exported value.
|
43
|
+
*/
|
44
|
+
return function(lunr) {
|
45
|
+
/* throw error if lunr is not yet included */
|
46
|
+
if ('undefined' === typeof lunr) {
|
47
|
+
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
48
|
+
}
|
49
|
+
|
50
|
+
/* throw error if lunr stemmer support is not yet included */
|
51
|
+
if ('undefined' === typeof lunr.stemmerSupport) {
|
52
|
+
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
53
|
+
}
|
54
|
+
|
55
|
+
/* register specific locale function */
|
56
|
+
lunr.ro = function() {
|
57
|
+
this.pipeline.reset();
|
58
|
+
this.pipeline.add(
|
59
|
+
lunr.ro.stopWordFilter,
|
60
|
+
lunr.ro.stemmer
|
61
|
+
);
|
62
|
+
};
|
63
|
+
|
64
|
+
/* lunr stemmer function */
|
65
|
+
lunr.ro.stemmer = (function() {
|
66
|
+
/* create the wrapped stemmer object */
|
67
|
+
var Among = lunr.stemmerSupport.Among,
|
68
|
+
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
69
|
+
st = new function RomanianStemmer() {
|
70
|
+
var a_0 = [new Among("", -1, 3), new Among("I", 0, 1), new Among("U", 0, 2)],
|
71
|
+
a_1 = [
|
72
|
+
new Among("ea", -1, 3), new Among("a\u0163ia", -1, 7),
|
73
|
+
new Among("aua", -1, 2), new Among("iua", -1, 4),
|
74
|
+
new Among("a\u0163ie", -1, 7), new Among("ele", -1, 3),
|
75
|
+
new Among("ile", -1, 5), new Among("iile", 6, 4),
|
76
|
+
new Among("iei", -1, 4), new Among("atei", -1, 6),
|
77
|
+
new Among("ii", -1, 4), new Among("ului", -1, 1),
|
78
|
+
new Among("ul", -1, 1), new Among("elor", -1, 3),
|
79
|
+
new Among("ilor", -1, 4), new Among("iilor", 14, 4)
|
80
|
+
],
|
81
|
+
a_2 = [
|
82
|
+
new Among("icala", -1, 4), new Among("iciva", -1, 4),
|
83
|
+
new Among("ativa", -1, 5), new Among("itiva", -1, 6),
|
84
|
+
new Among("icale", -1, 4), new Among("a\u0163iune", -1, 5),
|
85
|
+
new Among("i\u0163iune", -1, 6), new Among("atoare", -1, 5),
|
86
|
+
new Among("itoare", -1, 6), new Among("\u0103toare", -1, 5),
|
87
|
+
new Among("icitate", -1, 4), new Among("abilitate", -1, 1),
|
88
|
+
new Among("ibilitate", -1, 2), new Among("ivitate", -1, 3),
|
89
|
+
new Among("icive", -1, 4), new Among("ative", -1, 5),
|
90
|
+
new Among("itive", -1, 6), new Among("icali", -1, 4),
|
91
|
+
new Among("atori", -1, 5), new Among("icatori", 18, 4),
|
92
|
+
new Among("itori", -1, 6), new Among("\u0103tori", -1, 5),
|
93
|
+
new Among("icitati", -1, 4), new Among("abilitati", -1, 1),
|
94
|
+
new Among("ivitati", -1, 3), new Among("icivi", -1, 4),
|
95
|
+
new Among("ativi", -1, 5), new Among("itivi", -1, 6),
|
96
|
+
new Among("icit\u0103i", -1, 4), new Among("abilit\u0103i", -1, 1),
|
97
|
+
new Among("ivit\u0103i", -1, 3),
|
98
|
+
new Among("icit\u0103\u0163i", -1, 4),
|
99
|
+
new Among("abilit\u0103\u0163i", -1, 1),
|
100
|
+
new Among("ivit\u0103\u0163i", -1, 3), new Among("ical", -1, 4),
|
101
|
+
new Among("ator", -1, 5), new Among("icator", 35, 4),
|
102
|
+
new Among("itor", -1, 6), new Among("\u0103tor", -1, 5),
|
103
|
+
new Among("iciv", -1, 4), new Among("ativ", -1, 5),
|
104
|
+
new Among("itiv", -1, 6), new Among("ical\u0103", -1, 4),
|
105
|
+
new Among("iciv\u0103", -1, 4), new Among("ativ\u0103", -1, 5),
|
106
|
+
new Among("itiv\u0103", -1, 6)
|
107
|
+
],
|
108
|
+
a_3 = [new Among("ica", -1, 1),
|
109
|
+
new Among("abila", -1, 1), new Among("ibila", -1, 1),
|
110
|
+
new Among("oasa", -1, 1), new Among("ata", -1, 1),
|
111
|
+
new Among("ita", -1, 1), new Among("anta", -1, 1),
|
112
|
+
new Among("ista", -1, 3), new Among("uta", -1, 1),
|
113
|
+
new Among("iva", -1, 1), new Among("ic", -1, 1),
|
114
|
+
new Among("ice", -1, 1), new Among("abile", -1, 1),
|
115
|
+
new Among("ibile", -1, 1), new Among("isme", -1, 3),
|
116
|
+
new Among("iune", -1, 2), new Among("oase", -1, 1),
|
117
|
+
new Among("ate", -1, 1), new Among("itate", 17, 1),
|
118
|
+
new Among("ite", -1, 1), new Among("ante", -1, 1),
|
119
|
+
new Among("iste", -1, 3), new Among("ute", -1, 1),
|
120
|
+
new Among("ive", -1, 1), new Among("ici", -1, 1),
|
121
|
+
new Among("abili", -1, 1), new Among("ibili", -1, 1),
|
122
|
+
new Among("iuni", -1, 2), new Among("atori", -1, 1),
|
123
|
+
new Among("osi", -1, 1), new Among("ati", -1, 1),
|
124
|
+
new Among("itati", 30, 1), new Among("iti", -1, 1),
|
125
|
+
new Among("anti", -1, 1), new Among("isti", -1, 3),
|
126
|
+
new Among("uti", -1, 1), new Among("i\u015Fti", -1, 3),
|
127
|
+
new Among("ivi", -1, 1), new Among("it\u0103i", -1, 1),
|
128
|
+
new Among("o\u015Fi", -1, 1), new Among("it\u0103\u0163i", -1, 1),
|
129
|
+
new Among("abil", -1, 1), new Among("ibil", -1, 1),
|
130
|
+
new Among("ism", -1, 3), new Among("ator", -1, 1),
|
131
|
+
new Among("os", -1, 1), new Among("at", -1, 1),
|
132
|
+
new Among("it", -1, 1), new Among("ant", -1, 1),
|
133
|
+
new Among("ist", -1, 3), new Among("ut", -1, 1),
|
134
|
+
new Among("iv", -1, 1), new Among("ic\u0103", -1, 1),
|
135
|
+
new Among("abil\u0103", -1, 1), new Among("ibil\u0103", -1, 1),
|
136
|
+
new Among("oas\u0103", -1, 1), new Among("at\u0103", -1, 1),
|
137
|
+
new Among("it\u0103", -1, 1), new Among("ant\u0103", -1, 1),
|
138
|
+
new Among("ist\u0103", -1, 3), new Among("ut\u0103", -1, 1),
|
139
|
+
new Among("iv\u0103", -1, 1)
|
140
|
+
],
|
141
|
+
a_4 = [new Among("ea", -1, 1),
|
142
|
+
new Among("ia", -1, 1), new Among("esc", -1, 1),
|
143
|
+
new Among("\u0103sc", -1, 1), new Among("ind", -1, 1),
|
144
|
+
new Among("\u00E2nd", -1, 1), new Among("are", -1, 1),
|
145
|
+
new Among("ere", -1, 1), new Among("ire", -1, 1),
|
146
|
+
new Among("\u00E2re", -1, 1), new Among("se", -1, 2),
|
147
|
+
new Among("ase", 10, 1), new Among("sese", 10, 2),
|
148
|
+
new Among("ise", 10, 1), new Among("use", 10, 1),
|
149
|
+
new Among("\u00E2se", 10, 1), new Among("e\u015Fte", -1, 1),
|
150
|
+
new Among("\u0103\u015Fte", -1, 1), new Among("eze", -1, 1),
|
151
|
+
new Among("ai", -1, 1), new Among("eai", 19, 1),
|
152
|
+
new Among("iai", 19, 1), new Among("sei", -1, 2),
|
153
|
+
new Among("e\u015Fti", -1, 1), new Among("\u0103\u015Fti", -1, 1),
|
154
|
+
new Among("ui", -1, 1), new Among("ezi", -1, 1),
|
155
|
+
new Among("\u00E2i", -1, 1), new Among("a\u015Fi", -1, 1),
|
156
|
+
new Among("se\u015Fi", -1, 2), new Among("ase\u015Fi", 29, 1),
|
157
|
+
new Among("sese\u015Fi", 29, 2), new Among("ise\u015Fi", 29, 1),
|
158
|
+
new Among("use\u015Fi", 29, 1),
|
159
|
+
new Among("\u00E2se\u015Fi", 29, 1), new Among("i\u015Fi", -1, 1),
|
160
|
+
new Among("u\u015Fi", -1, 1), new Among("\u00E2\u015Fi", -1, 1),
|
161
|
+
new Among("a\u0163i", -1, 2), new Among("ea\u0163i", 38, 1),
|
162
|
+
new Among("ia\u0163i", 38, 1), new Among("e\u0163i", -1, 2),
|
163
|
+
new Among("i\u0163i", -1, 2), new Among("\u00E2\u0163i", -1, 2),
|
164
|
+
new Among("ar\u0103\u0163i", -1, 1),
|
165
|
+
new Among("ser\u0103\u0163i", -1, 2),
|
166
|
+
new Among("aser\u0103\u0163i", 45, 1),
|
167
|
+
new Among("seser\u0103\u0163i", 45, 2),
|
168
|
+
new Among("iser\u0103\u0163i", 45, 1),
|
169
|
+
new Among("user\u0103\u0163i", 45, 1),
|
170
|
+
new Among("\u00E2ser\u0103\u0163i", 45, 1),
|
171
|
+
new Among("ir\u0103\u0163i", -1, 1),
|
172
|
+
new Among("ur\u0103\u0163i", -1, 1),
|
173
|
+
new Among("\u00E2r\u0103\u0163i", -1, 1), new Among("am", -1, 1),
|
174
|
+
new Among("eam", 54, 1), new Among("iam", 54, 1),
|
175
|
+
new Among("em", -1, 2), new Among("asem", 57, 1),
|
176
|
+
new Among("sesem", 57, 2), new Among("isem", 57, 1),
|
177
|
+
new Among("usem", 57, 1), new Among("\u00E2sem", 57, 1),
|
178
|
+
new Among("im", -1, 2), new Among("\u00E2m", -1, 2),
|
179
|
+
new Among("\u0103m", -1, 2), new Among("ar\u0103m", 65, 1),
|
180
|
+
new Among("ser\u0103m", 65, 2), new Among("aser\u0103m", 67, 1),
|
181
|
+
new Among("seser\u0103m", 67, 2), new Among("iser\u0103m", 67, 1),
|
182
|
+
new Among("user\u0103m", 67, 1),
|
183
|
+
new Among("\u00E2ser\u0103m", 67, 1),
|
184
|
+
new Among("ir\u0103m", 65, 1), new Among("ur\u0103m", 65, 1),
|
185
|
+
new Among("\u00E2r\u0103m", 65, 1), new Among("au", -1, 1),
|
186
|
+
new Among("eau", 76, 1), new Among("iau", 76, 1),
|
187
|
+
new Among("indu", -1, 1), new Among("\u00E2ndu", -1, 1),
|
188
|
+
new Among("ez", -1, 1), new Among("easc\u0103", -1, 1),
|
189
|
+
new Among("ar\u0103", -1, 1), new Among("ser\u0103", -1, 2),
|
190
|
+
new Among("aser\u0103", 84, 1), new Among("seser\u0103", 84, 2),
|
191
|
+
new Among("iser\u0103", 84, 1), new Among("user\u0103", 84, 1),
|
192
|
+
new Among("\u00E2ser\u0103", 84, 1), new Among("ir\u0103", -1, 1),
|
193
|
+
new Among("ur\u0103", -1, 1), new Among("\u00E2r\u0103", -1, 1),
|
194
|
+
new Among("eaz\u0103", -1, 1)
|
195
|
+
],
|
196
|
+
a_5 = [new Among("a", -1, 1),
|
197
|
+
new Among("e", -1, 1), new Among("ie", 1, 1),
|
198
|
+
new Among("i", -1, 1), new Among("\u0103", -1, 1)
|
199
|
+
],
|
200
|
+
g_v = [17, 65,
|
201
|
+
16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 32, 0, 0, 4
|
202
|
+
],
|
203
|
+
B_standard_suffix_removed, I_p2, I_p1, I_pV, sbp = new SnowballProgram();
|
204
|
+
this.setCurrent = function(word) {
|
205
|
+
sbp.setCurrent(word);
|
206
|
+
};
|
207
|
+
this.getCurrent = function() {
|
208
|
+
return sbp.getCurrent();
|
209
|
+
};
|
210
|
+
|
211
|
+
function habr1(c1, c2) {
|
212
|
+
if (sbp.eq_s(1, c1)) {
|
213
|
+
sbp.ket = sbp.cursor;
|
214
|
+
if (sbp.in_grouping(g_v, 97, 259))
|
215
|
+
sbp.slice_from(c2);
|
216
|
+
}
|
217
|
+
}
|
218
|
+
|
219
|
+
function r_prelude() {
|
220
|
+
var v_1, v_2;
|
221
|
+
while (true) {
|
222
|
+
v_1 = sbp.cursor;
|
223
|
+
if (sbp.in_grouping(g_v, 97, 259)) {
|
224
|
+
v_2 = sbp.cursor;
|
225
|
+
sbp.bra = v_2;
|
226
|
+
habr1("u", "U");
|
227
|
+
sbp.cursor = v_2;
|
228
|
+
habr1("i", "I");
|
229
|
+
}
|
230
|
+
sbp.cursor = v_1;
|
231
|
+
if (sbp.cursor >= sbp.limit) {
|
232
|
+
break;
|
233
|
+
}
|
234
|
+
sbp.cursor++;
|
235
|
+
}
|
236
|
+
}
|
237
|
+
|
238
|
+
function habr2() {
|
239
|
+
if (sbp.out_grouping(g_v, 97, 259)) {
|
240
|
+
while (!sbp.in_grouping(g_v, 97, 259)) {
|
241
|
+
if (sbp.cursor >= sbp.limit)
|
242
|
+
return true;
|
243
|
+
sbp.cursor++;
|
244
|
+
}
|
245
|
+
return false;
|
246
|
+
}
|
247
|
+
return true;
|
248
|
+
}
|
249
|
+
|
250
|
+
function habr3() {
|
251
|
+
if (sbp.in_grouping(g_v, 97, 259)) {
|
252
|
+
while (!sbp.out_grouping(g_v, 97, 259)) {
|
253
|
+
if (sbp.cursor >= sbp.limit)
|
254
|
+
return true;
|
255
|
+
sbp.cursor++;
|
256
|
+
}
|
257
|
+
}
|
258
|
+
return false;
|
259
|
+
}
|
260
|
+
|
261
|
+
function habr4() {
|
262
|
+
var v_1 = sbp.cursor,
|
263
|
+
v_2, v_3;
|
264
|
+
if (sbp.in_grouping(g_v, 97, 259)) {
|
265
|
+
v_2 = sbp.cursor;
|
266
|
+
if (habr2()) {
|
267
|
+
sbp.cursor = v_2;
|
268
|
+
if (!habr3()) {
|
269
|
+
I_pV = sbp.cursor;
|
270
|
+
return;
|
271
|
+
}
|
272
|
+
} else {
|
273
|
+
I_pV = sbp.cursor;
|
274
|
+
return;
|
275
|
+
}
|
276
|
+
}
|
277
|
+
sbp.cursor = v_1;
|
278
|
+
if (sbp.out_grouping(g_v, 97, 259)) {
|
279
|
+
v_3 = sbp.cursor;
|
280
|
+
if (habr2()) {
|
281
|
+
sbp.cursor = v_3;
|
282
|
+
if (sbp.in_grouping(g_v, 97, 259) && sbp.cursor < sbp.limit)
|
283
|
+
sbp.cursor++;
|
284
|
+
}
|
285
|
+
I_pV = sbp.cursor;
|
286
|
+
}
|
287
|
+
}
|
288
|
+
|
289
|
+
function habr5() {
|
290
|
+
while (!sbp.in_grouping(g_v, 97, 259)) {
|
291
|
+
if (sbp.cursor >= sbp.limit)
|
292
|
+
return false;
|
293
|
+
sbp.cursor++;
|
294
|
+
}
|
295
|
+
while (!sbp.out_grouping(g_v, 97, 259)) {
|
296
|
+
if (sbp.cursor >= sbp.limit)
|
297
|
+
return false;
|
298
|
+
sbp.cursor++;
|
299
|
+
}
|
300
|
+
return true;
|
301
|
+
}
|
302
|
+
|
303
|
+
function r_mark_regions() {
|
304
|
+
var v_1 = sbp.cursor;
|
305
|
+
I_pV = sbp.limit;
|
306
|
+
I_p1 = I_pV;
|
307
|
+
I_p2 = I_pV;
|
308
|
+
habr4();
|
309
|
+
sbp.cursor = v_1;
|
310
|
+
if (habr5()) {
|
311
|
+
I_p1 = sbp.cursor;
|
312
|
+
if (habr5())
|
313
|
+
I_p2 = sbp.cursor;
|
314
|
+
}
|
315
|
+
}
|
316
|
+
|
317
|
+
function r_postlude() {
|
318
|
+
var among_var;
|
319
|
+
while (true) {
|
320
|
+
sbp.bra = sbp.cursor;
|
321
|
+
among_var = sbp.find_among(a_0, 3);
|
322
|
+
if (among_var) {
|
323
|
+
sbp.ket = sbp.cursor;
|
324
|
+
switch (among_var) {
|
325
|
+
case 1:
|
326
|
+
sbp.slice_from("i");
|
327
|
+
continue;
|
328
|
+
case 2:
|
329
|
+
sbp.slice_from("u");
|
330
|
+
continue;
|
331
|
+
case 3:
|
332
|
+
if (sbp.cursor >= sbp.limit)
|
333
|
+
break;
|
334
|
+
sbp.cursor++;
|
335
|
+
continue;
|
336
|
+
}
|
337
|
+
}
|
338
|
+
break;
|
339
|
+
}
|
340
|
+
}
|
341
|
+
|
342
|
+
function r_RV() {
|
343
|
+
return I_pV <= sbp.cursor;
|
344
|
+
}
|
345
|
+
|
346
|
+
function r_R1() {
|
347
|
+
return I_p1 <= sbp.cursor;
|
348
|
+
}
|
349
|
+
|
350
|
+
function r_R2() {
|
351
|
+
return I_p2 <= sbp.cursor;
|
352
|
+
}
|
353
|
+
|
354
|
+
function r_step_0() {
|
355
|
+
var among_var, v_1;
|
356
|
+
sbp.ket = sbp.cursor;
|
357
|
+
among_var = sbp.find_among_b(a_1, 16);
|
358
|
+
if (among_var) {
|
359
|
+
sbp.bra = sbp.cursor;
|
360
|
+
if (r_R1()) {
|
361
|
+
switch (among_var) {
|
362
|
+
case 1:
|
363
|
+
sbp.slice_del();
|
364
|
+
break;
|
365
|
+
case 2:
|
366
|
+
sbp.slice_from("a");
|
367
|
+
break;
|
368
|
+
case 3:
|
369
|
+
sbp.slice_from("e");
|
370
|
+
break;
|
371
|
+
case 4:
|
372
|
+
sbp.slice_from("i");
|
373
|
+
break;
|
374
|
+
case 5:
|
375
|
+
v_1 = sbp.limit - sbp.cursor;
|
376
|
+
if (!sbp.eq_s_b(2, "ab")) {
|
377
|
+
sbp.cursor = sbp.limit - v_1;
|
378
|
+
sbp.slice_from("i");
|
379
|
+
}
|
380
|
+
break;
|
381
|
+
case 6:
|
382
|
+
sbp.slice_from("at");
|
383
|
+
break;
|
384
|
+
case 7:
|
385
|
+
sbp.slice_from("a\u0163i");
|
386
|
+
break;
|
387
|
+
}
|
388
|
+
}
|
389
|
+
}
|
390
|
+
}
|
391
|
+
|
392
|
+
function r_combo_suffix() {
|
393
|
+
var among_var, v_1 = sbp.limit - sbp.cursor;
|
394
|
+
sbp.ket = sbp.cursor;
|
395
|
+
among_var = sbp.find_among_b(a_2, 46);
|
396
|
+
if (among_var) {
|
397
|
+
sbp.bra = sbp.cursor;
|
398
|
+
if (r_R1()) {
|
399
|
+
switch (among_var) {
|
400
|
+
case 1:
|
401
|
+
sbp.slice_from("abil");
|
402
|
+
break;
|
403
|
+
case 2:
|
404
|
+
sbp.slice_from("ibil");
|
405
|
+
break;
|
406
|
+
case 3:
|
407
|
+
sbp.slice_from("iv");
|
408
|
+
break;
|
409
|
+
case 4:
|
410
|
+
sbp.slice_from("ic");
|
411
|
+
break;
|
412
|
+
case 5:
|
413
|
+
sbp.slice_from("at");
|
414
|
+
break;
|
415
|
+
case 6:
|
416
|
+
sbp.slice_from("it");
|
417
|
+
break;
|
418
|
+
}
|
419
|
+
B_standard_suffix_removed = true;
|
420
|
+
sbp.cursor = sbp.limit - v_1;
|
421
|
+
return true;
|
422
|
+
}
|
423
|
+
}
|
424
|
+
return false;
|
425
|
+
}
|
426
|
+
|
427
|
+
function r_standard_suffix() {
|
428
|
+
var among_var, v_1;
|
429
|
+
B_standard_suffix_removed = false;
|
430
|
+
while (true) {
|
431
|
+
v_1 = sbp.limit - sbp.cursor;
|
432
|
+
if (!r_combo_suffix()) {
|
433
|
+
sbp.cursor = sbp.limit - v_1;
|
434
|
+
break;
|
435
|
+
}
|
436
|
+
}
|
437
|
+
sbp.ket = sbp.cursor;
|
438
|
+
among_var = sbp.find_among_b(a_3, 62);
|
439
|
+
if (among_var) {
|
440
|
+
sbp.bra = sbp.cursor;
|
441
|
+
if (r_R2()) {
|
442
|
+
switch (among_var) {
|
443
|
+
case 1:
|
444
|
+
sbp.slice_del();
|
445
|
+
break;
|
446
|
+
case 2:
|
447
|
+
if (sbp.eq_s_b(1, "\u0163")) {
|
448
|
+
sbp.bra = sbp.cursor;
|
449
|
+
sbp.slice_from("t");
|
450
|
+
}
|
451
|
+
break;
|
452
|
+
case 3:
|
453
|
+
sbp.slice_from("ist");
|
454
|
+
break;
|
455
|
+
}
|
456
|
+
B_standard_suffix_removed = true;
|
457
|
+
}
|
458
|
+
}
|
459
|
+
}
|
460
|
+
|
461
|
+
function r_verb_suffix() {
|
462
|
+
var among_var, v_1, v_2;
|
463
|
+
if (sbp.cursor >= I_pV) {
|
464
|
+
v_1 = sbp.limit_backward;
|
465
|
+
sbp.limit_backward = I_pV;
|
466
|
+
sbp.ket = sbp.cursor;
|
467
|
+
among_var = sbp.find_among_b(a_4, 94);
|
468
|
+
if (among_var) {
|
469
|
+
sbp.bra = sbp.cursor;
|
470
|
+
switch (among_var) {
|
471
|
+
case 1:
|
472
|
+
v_2 = sbp.limit - sbp.cursor;
|
473
|
+
if (!sbp.out_grouping_b(g_v, 97, 259)) {
|
474
|
+
sbp.cursor = sbp.limit - v_2;
|
475
|
+
if (!sbp.eq_s_b(1, "u"))
|
476
|
+
break;
|
477
|
+
}
|
478
|
+
case 2:
|
479
|
+
sbp.slice_del();
|
480
|
+
break;
|
481
|
+
}
|
482
|
+
}
|
483
|
+
sbp.limit_backward = v_1;
|
484
|
+
}
|
485
|
+
}
|
486
|
+
|
487
|
+
function r_vowel_suffix() {
|
488
|
+
var among_var;
|
489
|
+
sbp.ket = sbp.cursor;
|
490
|
+
among_var = sbp.find_among_b(a_5, 5);
|
491
|
+
if (among_var) {
|
492
|
+
sbp.bra = sbp.cursor;
|
493
|
+
if (r_RV() && among_var == 1)
|
494
|
+
sbp.slice_del();
|
495
|
+
}
|
496
|
+
}
|
497
|
+
this.stem = function() {
|
498
|
+
var v_1 = sbp.cursor;
|
499
|
+
r_prelude();
|
500
|
+
sbp.cursor = v_1;
|
501
|
+
r_mark_regions();
|
502
|
+
sbp.limit_backward = v_1;
|
503
|
+
sbp.cursor = sbp.limit;
|
504
|
+
r_step_0();
|
505
|
+
sbp.cursor = sbp.limit;
|
506
|
+
r_standard_suffix();
|
507
|
+
sbp.cursor = sbp.limit;
|
508
|
+
if (!B_standard_suffix_removed) {
|
509
|
+
sbp.cursor = sbp.limit;
|
510
|
+
r_verb_suffix();
|
511
|
+
sbp.cursor = sbp.limit;
|
512
|
+
}
|
513
|
+
r_vowel_suffix();
|
514
|
+
sbp.cursor = sbp.limit_backward;
|
515
|
+
r_postlude();
|
516
|
+
return true;
|
517
|
+
}
|
518
|
+
};
|
519
|
+
|
520
|
+
/* and return a function that stems a word for the current locale */
|
521
|
+
return function(word) {
|
522
|
+
st.setCurrent(word);
|
523
|
+
st.stem();
|
524
|
+
return st.getCurrent();
|
525
|
+
}
|
526
|
+
})();
|
527
|
+
|
528
|
+
lunr.Pipeline.registerFunction(lunr.ro.stemmer, 'stemmer-ro');
|
529
|
+
|
530
|
+
/* stop word filter function */
|
531
|
+
lunr.ro.stopWordFilter = function(token) {
|
532
|
+
if (lunr.ro.stopWordFilter.stopWords.indexOf(token) === -1) {
|
533
|
+
return token;
|
534
|
+
}
|
535
|
+
};
|
536
|
+
|
537
|
+
lunr.ro.stopWordFilter.stopWords = new lunr.SortedSet();
|
538
|
+
lunr.ro.stopWordFilter.stopWords.length = 282;
|
539
|
+
|
540
|
+
// The space at the beginning is crucial: It marks the empty string
|
541
|
+
// as a stop word. lunr.js crashes during search when documents
|
542
|
+
// processed by the pipeline still contain the empty string.
|
543
|
+
lunr.ro.stopWordFilter.stopWords.elements = ' acea aceasta această aceea acei aceia acel acela acele acelea acest acesta aceste acestea aceşti aceştia acolo acord acum ai aia aibă aici al ale alea altceva altcineva am ar are asemenea asta astea astăzi asupra au avea avem aveţi azi aş aşadar aţi bine bucur bună ca care caut ce cel ceva chiar cinci cine cineva contra cu cum cumva curând curînd când cât câte câtva câţi cînd cît cîte cîtva cîţi că căci cărei căror cărui către da dacă dar datorită dată dau de deci deja deoarece departe deşi din dinaintea dintr- dintre doi doilea două drept după dă ea ei el ele eram este eu eşti face fata fi fie fiecare fii fim fiu fiţi frumos fără graţie halbă iar ieri la le li lor lui lângă lîngă mai mea mei mele mereu meu mi mie mine mult multă mulţi mulţumesc mâine mîine mă ne nevoie nici nicăieri nimeni nimeri nimic nişte noastre noastră noi noroc nostru nouă noştri nu opt ori oricare orice oricine oricum oricând oricât oricînd oricît oriunde patra patru patrulea pe pentru peste pic poate pot prea prima primul prin puţin puţina puţină până pînă rog sa sale sau se spate spre sub sunt suntem sunteţi sută sînt sîntem sînteţi să săi său ta tale te timp tine toate toată tot totuşi toţi trei treia treilea tu tăi tău un una unde undeva unei uneia unele uneori unii unor unora unu unui unuia unul vi voastre voastră voi vostru vouă voştri vreme vreo vreun vă zece zero zi zice îi îl îmi împotriva în înainte înaintea încotro încât încît între întrucât întrucît îţi ăla ălea ăsta ăstea ăştia şapte şase şi ştiu ţi ţie'.split(' ');
|
544
|
+
|
545
|
+
lunr.Pipeline.registerFunction(lunr.ro.stopWordFilter, 'stopWordFilter-ro');
|
546
|
+
};
|
547
|
+
}))
|