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,437 @@
|
|
1
|
+
/*!
|
2
|
+
* Lunr languages, `Dutch` 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.du = function() {
|
57
|
+
this.pipeline.reset();
|
58
|
+
this.pipeline.add(
|
59
|
+
lunr.du.stopWordFilter,
|
60
|
+
lunr.du.stemmer
|
61
|
+
);
|
62
|
+
};
|
63
|
+
|
64
|
+
/* lunr stemmer function */
|
65
|
+
lunr.du.stemmer = (function() {
|
66
|
+
/* create the wrapped stemmer object */
|
67
|
+
var Among = lunr.stemmerSupport.Among,
|
68
|
+
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
69
|
+
st = new function DutchStemmer() {
|
70
|
+
var a_0 = [new Among("", -1, 6), new Among("\u00E1", 0, 1),
|
71
|
+
new Among("\u00E4", 0, 1), new Among("\u00E9", 0, 2),
|
72
|
+
new Among("\u00EB", 0, 2), new Among("\u00ED", 0, 3),
|
73
|
+
new Among("\u00EF", 0, 3), new Among("\u00F3", 0, 4),
|
74
|
+
new Among("\u00F6", 0, 4), new Among("\u00FA", 0, 5),
|
75
|
+
new Among("\u00FC", 0, 5)
|
76
|
+
],
|
77
|
+
a_1 = [new Among("", -1, 3),
|
78
|
+
new Among("I", 0, 2), new Among("Y", 0, 1)
|
79
|
+
],
|
80
|
+
a_2 = [
|
81
|
+
new Among("dd", -1, -1), new Among("kk", -1, -1),
|
82
|
+
new Among("tt", -1, -1)
|
83
|
+
],
|
84
|
+
a_3 = [new Among("ene", -1, 2),
|
85
|
+
new Among("se", -1, 3), new Among("en", -1, 2),
|
86
|
+
new Among("heden", 2, 1), new Among("s", -1, 3)
|
87
|
+
],
|
88
|
+
a_4 = [
|
89
|
+
new Among("end", -1, 1), new Among("ig", -1, 2),
|
90
|
+
new Among("ing", -1, 1), new Among("lijk", -1, 3),
|
91
|
+
new Among("baar", -1, 4), new Among("bar", -1, 5)
|
92
|
+
],
|
93
|
+
a_5 = [
|
94
|
+
new Among("aa", -1, -1), new Among("ee", -1, -1),
|
95
|
+
new Among("oo", -1, -1), new Among("uu", -1, -1)
|
96
|
+
],
|
97
|
+
g_v = [17, 65,
|
98
|
+
16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
99
|
+
],
|
100
|
+
g_v_I = [1, 0, 0,
|
101
|
+
17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
102
|
+
],
|
103
|
+
g_v_j = [
|
104
|
+
17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
105
|
+
],
|
106
|
+
I_p2, I_p1, B_e_found, sbp = new SnowballProgram();
|
107
|
+
this.setCurrent = function(word) {
|
108
|
+
sbp.setCurrent(word);
|
109
|
+
};
|
110
|
+
this.getCurrent = function() {
|
111
|
+
return sbp.getCurrent();
|
112
|
+
};
|
113
|
+
|
114
|
+
function r_prelude() {
|
115
|
+
var among_var, v_1 = sbp.cursor,
|
116
|
+
v_2, v_3;
|
117
|
+
while (true) {
|
118
|
+
sbp.bra = sbp.cursor;
|
119
|
+
among_var = sbp.find_among(a_0, 11);
|
120
|
+
if (among_var) {
|
121
|
+
sbp.ket = sbp.cursor;
|
122
|
+
switch (among_var) {
|
123
|
+
case 1:
|
124
|
+
sbp.slice_from("a");
|
125
|
+
continue;
|
126
|
+
case 2:
|
127
|
+
sbp.slice_from("e");
|
128
|
+
continue;
|
129
|
+
case 3:
|
130
|
+
sbp.slice_from("i");
|
131
|
+
continue;
|
132
|
+
case 4:
|
133
|
+
sbp.slice_from("o");
|
134
|
+
continue;
|
135
|
+
case 5:
|
136
|
+
sbp.slice_from("u");
|
137
|
+
continue;
|
138
|
+
case 6:
|
139
|
+
if (sbp.cursor >= sbp.limit)
|
140
|
+
break;
|
141
|
+
sbp.cursor++;
|
142
|
+
continue;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
break;
|
146
|
+
}
|
147
|
+
sbp.cursor = v_1;
|
148
|
+
sbp.bra = v_1;
|
149
|
+
if (sbp.eq_s(1, "y")) {
|
150
|
+
sbp.ket = sbp.cursor;
|
151
|
+
sbp.slice_from("Y");
|
152
|
+
} else
|
153
|
+
sbp.cursor = v_1;
|
154
|
+
while (true) {
|
155
|
+
v_2 = sbp.cursor;
|
156
|
+
if (sbp.in_grouping(g_v, 97, 232)) {
|
157
|
+
v_3 = sbp.cursor;
|
158
|
+
sbp.bra = v_3;
|
159
|
+
if (sbp.eq_s(1, "i")) {
|
160
|
+
sbp.ket = sbp.cursor;
|
161
|
+
if (sbp.in_grouping(g_v, 97, 232)) {
|
162
|
+
sbp.slice_from("I");
|
163
|
+
sbp.cursor = v_2;
|
164
|
+
}
|
165
|
+
} else {
|
166
|
+
sbp.cursor = v_3;
|
167
|
+
if (sbp.eq_s(1, "y")) {
|
168
|
+
sbp.ket = sbp.cursor;
|
169
|
+
sbp.slice_from("Y");
|
170
|
+
sbp.cursor = v_2;
|
171
|
+
} else if (habr1(v_2))
|
172
|
+
break;
|
173
|
+
}
|
174
|
+
} else if (habr1(v_2))
|
175
|
+
break;
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
function habr1(v_1) {
|
180
|
+
sbp.cursor = v_1;
|
181
|
+
if (v_1 >= sbp.limit)
|
182
|
+
return true;
|
183
|
+
sbp.cursor++;
|
184
|
+
return false;
|
185
|
+
}
|
186
|
+
|
187
|
+
function r_mark_regions() {
|
188
|
+
I_p1 = sbp.limit;
|
189
|
+
I_p2 = I_p1;
|
190
|
+
if (!habr2()) {
|
191
|
+
I_p1 = sbp.cursor;
|
192
|
+
if (I_p1 < 3)
|
193
|
+
I_p1 = 3;
|
194
|
+
if (!habr2())
|
195
|
+
I_p2 = sbp.cursor;
|
196
|
+
}
|
197
|
+
}
|
198
|
+
|
199
|
+
function habr2() {
|
200
|
+
while (!sbp.in_grouping(g_v, 97, 232)) {
|
201
|
+
if (sbp.cursor >= sbp.limit)
|
202
|
+
return true;
|
203
|
+
sbp.cursor++;
|
204
|
+
}
|
205
|
+
while (!sbp.out_grouping(g_v, 97, 232)) {
|
206
|
+
if (sbp.cursor >= sbp.limit)
|
207
|
+
return true;
|
208
|
+
sbp.cursor++;
|
209
|
+
}
|
210
|
+
return false;
|
211
|
+
}
|
212
|
+
|
213
|
+
function r_postlude() {
|
214
|
+
var among_var;
|
215
|
+
while (true) {
|
216
|
+
sbp.bra = sbp.cursor;
|
217
|
+
among_var = sbp.find_among(a_1, 3);
|
218
|
+
if (among_var) {
|
219
|
+
sbp.ket = sbp.cursor;
|
220
|
+
switch (among_var) {
|
221
|
+
case 1:
|
222
|
+
sbp.slice_from("y");
|
223
|
+
break;
|
224
|
+
case 2:
|
225
|
+
sbp.slice_from("i");
|
226
|
+
break;
|
227
|
+
case 3:
|
228
|
+
if (sbp.cursor >= sbp.limit)
|
229
|
+
return;
|
230
|
+
sbp.cursor++;
|
231
|
+
break;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
}
|
235
|
+
}
|
236
|
+
|
237
|
+
function r_R1() {
|
238
|
+
return I_p1 <= sbp.cursor;
|
239
|
+
}
|
240
|
+
|
241
|
+
function r_R2() {
|
242
|
+
return I_p2 <= sbp.cursor;
|
243
|
+
}
|
244
|
+
|
245
|
+
function r_undouble() {
|
246
|
+
var v_1 = sbp.limit - sbp.cursor;
|
247
|
+
if (sbp.find_among_b(a_2, 3)) {
|
248
|
+
sbp.cursor = sbp.limit - v_1;
|
249
|
+
sbp.ket = sbp.cursor;
|
250
|
+
if (sbp.cursor > sbp.limit_backward) {
|
251
|
+
sbp.cursor--;
|
252
|
+
sbp.bra = sbp.cursor;
|
253
|
+
sbp.slice_del();
|
254
|
+
}
|
255
|
+
}
|
256
|
+
}
|
257
|
+
|
258
|
+
function r_e_ending() {
|
259
|
+
var v_1;
|
260
|
+
B_e_found = false;
|
261
|
+
sbp.ket = sbp.cursor;
|
262
|
+
if (sbp.eq_s_b(1, "e")) {
|
263
|
+
sbp.bra = sbp.cursor;
|
264
|
+
if (r_R1()) {
|
265
|
+
v_1 = sbp.limit - sbp.cursor;
|
266
|
+
if (sbp.out_grouping_b(g_v, 97, 232)) {
|
267
|
+
sbp.cursor = sbp.limit - v_1;
|
268
|
+
sbp.slice_del();
|
269
|
+
B_e_found = true;
|
270
|
+
r_undouble();
|
271
|
+
}
|
272
|
+
}
|
273
|
+
}
|
274
|
+
}
|
275
|
+
|
276
|
+
function r_en_ending() {
|
277
|
+
var v_1;
|
278
|
+
if (r_R1()) {
|
279
|
+
v_1 = sbp.limit - sbp.cursor;
|
280
|
+
if (sbp.out_grouping_b(g_v, 97, 232)) {
|
281
|
+
sbp.cursor = sbp.limit - v_1;
|
282
|
+
if (!sbp.eq_s_b(3, "gem")) {
|
283
|
+
sbp.cursor = sbp.limit - v_1;
|
284
|
+
sbp.slice_del();
|
285
|
+
r_undouble();
|
286
|
+
}
|
287
|
+
}
|
288
|
+
}
|
289
|
+
}
|
290
|
+
|
291
|
+
function r_standard_suffix() {
|
292
|
+
var among_var, v_1 = sbp.limit - sbp.cursor,
|
293
|
+
v_2, v_3, v_4, v_5, v_6;
|
294
|
+
sbp.ket = sbp.cursor;
|
295
|
+
among_var = sbp.find_among_b(a_3, 5);
|
296
|
+
if (among_var) {
|
297
|
+
sbp.bra = sbp.cursor;
|
298
|
+
switch (among_var) {
|
299
|
+
case 1:
|
300
|
+
if (r_R1())
|
301
|
+
sbp.slice_from("heid");
|
302
|
+
break;
|
303
|
+
case 2:
|
304
|
+
r_en_ending();
|
305
|
+
break;
|
306
|
+
case 3:
|
307
|
+
if (r_R1() && sbp.out_grouping_b(g_v_j, 97, 232))
|
308
|
+
sbp.slice_del();
|
309
|
+
break;
|
310
|
+
}
|
311
|
+
}
|
312
|
+
sbp.cursor = sbp.limit - v_1;
|
313
|
+
r_e_ending();
|
314
|
+
sbp.cursor = sbp.limit - v_1;
|
315
|
+
sbp.ket = sbp.cursor;
|
316
|
+
if (sbp.eq_s_b(4, "heid")) {
|
317
|
+
sbp.bra = sbp.cursor;
|
318
|
+
if (r_R2()) {
|
319
|
+
v_2 = sbp.limit - sbp.cursor;
|
320
|
+
if (!sbp.eq_s_b(1, "c")) {
|
321
|
+
sbp.cursor = sbp.limit - v_2;
|
322
|
+
sbp.slice_del();
|
323
|
+
sbp.ket = sbp.cursor;
|
324
|
+
if (sbp.eq_s_b(2, "en")) {
|
325
|
+
sbp.bra = sbp.cursor;
|
326
|
+
r_en_ending();
|
327
|
+
}
|
328
|
+
}
|
329
|
+
}
|
330
|
+
}
|
331
|
+
sbp.cursor = sbp.limit - v_1;
|
332
|
+
sbp.ket = sbp.cursor;
|
333
|
+
among_var = sbp.find_among_b(a_4, 6);
|
334
|
+
if (among_var) {
|
335
|
+
sbp.bra = sbp.cursor;
|
336
|
+
switch (among_var) {
|
337
|
+
case 1:
|
338
|
+
if (r_R2()) {
|
339
|
+
sbp.slice_del();
|
340
|
+
v_3 = sbp.limit - sbp.cursor;
|
341
|
+
sbp.ket = sbp.cursor;
|
342
|
+
if (sbp.eq_s_b(2, "ig")) {
|
343
|
+
sbp.bra = sbp.cursor;
|
344
|
+
if (r_R2()) {
|
345
|
+
v_4 = sbp.limit - sbp.cursor;
|
346
|
+
if (!sbp.eq_s_b(1, "e")) {
|
347
|
+
sbp.cursor = sbp.limit - v_4;
|
348
|
+
sbp.slice_del();
|
349
|
+
break;
|
350
|
+
}
|
351
|
+
}
|
352
|
+
}
|
353
|
+
sbp.cursor = sbp.limit - v_3;
|
354
|
+
r_undouble();
|
355
|
+
}
|
356
|
+
break;
|
357
|
+
case 2:
|
358
|
+
if (r_R2()) {
|
359
|
+
v_5 = sbp.limit - sbp.cursor;
|
360
|
+
if (!sbp.eq_s_b(1, "e")) {
|
361
|
+
sbp.cursor = sbp.limit - v_5;
|
362
|
+
sbp.slice_del();
|
363
|
+
}
|
364
|
+
}
|
365
|
+
break;
|
366
|
+
case 3:
|
367
|
+
if (r_R2()) {
|
368
|
+
sbp.slice_del();
|
369
|
+
r_e_ending();
|
370
|
+
}
|
371
|
+
break;
|
372
|
+
case 4:
|
373
|
+
if (r_R2())
|
374
|
+
sbp.slice_del();
|
375
|
+
break;
|
376
|
+
case 5:
|
377
|
+
if (r_R2() && B_e_found)
|
378
|
+
sbp.slice_del();
|
379
|
+
break;
|
380
|
+
}
|
381
|
+
}
|
382
|
+
sbp.cursor = sbp.limit - v_1;
|
383
|
+
if (sbp.out_grouping_b(g_v_I, 73, 232)) {
|
384
|
+
v_6 = sbp.limit - sbp.cursor;
|
385
|
+
if (sbp.find_among_b(a_5, 4) && sbp.out_grouping_b(g_v, 97, 232)) {
|
386
|
+
sbp.cursor = sbp.limit - v_6;
|
387
|
+
sbp.ket = sbp.cursor;
|
388
|
+
if (sbp.cursor > sbp.limit_backward) {
|
389
|
+
sbp.cursor--;
|
390
|
+
sbp.bra = sbp.cursor;
|
391
|
+
sbp.slice_del();
|
392
|
+
}
|
393
|
+
}
|
394
|
+
}
|
395
|
+
}
|
396
|
+
this.stem = function() {
|
397
|
+
var v_1 = sbp.cursor;
|
398
|
+
r_prelude();
|
399
|
+
sbp.cursor = v_1;
|
400
|
+
r_mark_regions();
|
401
|
+
sbp.limit_backward = v_1;
|
402
|
+
sbp.cursor = sbp.limit;
|
403
|
+
r_standard_suffix();
|
404
|
+
sbp.cursor = sbp.limit_backward;
|
405
|
+
r_postlude();
|
406
|
+
return true;
|
407
|
+
}
|
408
|
+
};
|
409
|
+
|
410
|
+
/* and return a function that stems a word for the current locale */
|
411
|
+
return function(word) {
|
412
|
+
st.setCurrent(word);
|
413
|
+
st.stem();
|
414
|
+
return st.getCurrent();
|
415
|
+
}
|
416
|
+
})();
|
417
|
+
|
418
|
+
lunr.Pipeline.registerFunction(lunr.du.stemmer, 'stemmer-du');
|
419
|
+
|
420
|
+
/* stop word filter function */
|
421
|
+
lunr.du.stopWordFilter = function(token) {
|
422
|
+
if (lunr.du.stopWordFilter.stopWords.indexOf(token) === -1) {
|
423
|
+
return token;
|
424
|
+
}
|
425
|
+
};
|
426
|
+
|
427
|
+
lunr.du.stopWordFilter.stopWords = new lunr.SortedSet();
|
428
|
+
lunr.du.stopWordFilter.stopWords.length = 103;
|
429
|
+
|
430
|
+
// The space at the beginning is crucial: It marks the empty string
|
431
|
+
// as a stop word. lunr.js crashes during search when documents
|
432
|
+
// processed by the pipeline still contain the empty string.
|
433
|
+
lunr.du.stopWordFilter.stopWords.elements = ' aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou'.split(' ');
|
434
|
+
|
435
|
+
lunr.Pipeline.registerFunction(lunr.du.stopWordFilter, 'stopWordFilter-du');
|
436
|
+
};
|
437
|
+
}))
|
@@ -0,0 +1,588 @@
|
|
1
|
+
/*!
|
2
|
+
* Lunr languages, `Spanish` 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.es = function() {
|
57
|
+
this.pipeline.reset();
|
58
|
+
this.pipeline.add(
|
59
|
+
lunr.es.stopWordFilter,
|
60
|
+
lunr.es.stemmer
|
61
|
+
);
|
62
|
+
};
|
63
|
+
|
64
|
+
/* lunr stemmer function */
|
65
|
+
lunr.es.stemmer = (function() {
|
66
|
+
/* create the wrapped stemmer object */
|
67
|
+
var Among = lunr.stemmerSupport.Among,
|
68
|
+
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
69
|
+
st = new function SpanishStemmer() {
|
70
|
+
var a_0 = [new Among("", -1, 6), new Among("\u00E1", 0, 1),
|
71
|
+
new Among("\u00E9", 0, 2), new Among("\u00ED", 0, 3),
|
72
|
+
new Among("\u00F3", 0, 4), new Among("\u00FA", 0, 5)
|
73
|
+
],
|
74
|
+
a_1 = [
|
75
|
+
new Among("la", -1, -1), new Among("sela", 0, -1),
|
76
|
+
new Among("le", -1, -1), new Among("me", -1, -1),
|
77
|
+
new Among("se", -1, -1), new Among("lo", -1, -1),
|
78
|
+
new Among("selo", 5, -1), new Among("las", -1, -1),
|
79
|
+
new Among("selas", 7, -1), new Among("les", -1, -1),
|
80
|
+
new Among("los", -1, -1), new Among("selos", 10, -1),
|
81
|
+
new Among("nos", -1, -1)
|
82
|
+
],
|
83
|
+
a_2 = [new Among("ando", -1, 6),
|
84
|
+
new Among("iendo", -1, 6), new Among("yendo", -1, 7),
|
85
|
+
new Among("\u00E1ndo", -1, 2), new Among("i\u00E9ndo", -1, 1),
|
86
|
+
new Among("ar", -1, 6), new Among("er", -1, 6),
|
87
|
+
new Among("ir", -1, 6), new Among("\u00E1r", -1, 3),
|
88
|
+
new Among("\u00E9r", -1, 4), new Among("\u00EDr", -1, 5)
|
89
|
+
],
|
90
|
+
a_3 = [
|
91
|
+
new Among("ic", -1, -1), new Among("ad", -1, -1),
|
92
|
+
new Among("os", -1, -1), new Among("iv", -1, 1)
|
93
|
+
],
|
94
|
+
a_4 = [
|
95
|
+
new Among("able", -1, 1), new Among("ible", -1, 1),
|
96
|
+
new Among("ante", -1, 1)
|
97
|
+
],
|
98
|
+
a_5 = [new Among("ic", -1, 1),
|
99
|
+
new Among("abil", -1, 1), new Among("iv", -1, 1)
|
100
|
+
],
|
101
|
+
a_6 = [
|
102
|
+
new Among("ica", -1, 1), new Among("ancia", -1, 2),
|
103
|
+
new Among("encia", -1, 5), new Among("adora", -1, 2),
|
104
|
+
new Among("osa", -1, 1), new Among("ista", -1, 1),
|
105
|
+
new Among("iva", -1, 9), new Among("anza", -1, 1),
|
106
|
+
new Among("log\u00EDa", -1, 3), new Among("idad", -1, 8),
|
107
|
+
new Among("able", -1, 1), new Among("ible", -1, 1),
|
108
|
+
new Among("ante", -1, 2), new Among("mente", -1, 7),
|
109
|
+
new Among("amente", 13, 6), new Among("aci\u00F3n", -1, 2),
|
110
|
+
new Among("uci\u00F3n", -1, 4), new Among("ico", -1, 1),
|
111
|
+
new Among("ismo", -1, 1), new Among("oso", -1, 1),
|
112
|
+
new Among("amiento", -1, 1), new Among("imiento", -1, 1),
|
113
|
+
new Among("ivo", -1, 9), new Among("ador", -1, 2),
|
114
|
+
new Among("icas", -1, 1), new Among("ancias", -1, 2),
|
115
|
+
new Among("encias", -1, 5), new Among("adoras", -1, 2),
|
116
|
+
new Among("osas", -1, 1), new Among("istas", -1, 1),
|
117
|
+
new Among("ivas", -1, 9), new Among("anzas", -1, 1),
|
118
|
+
new Among("log\u00EDas", -1, 3), new Among("idades", -1, 8),
|
119
|
+
new Among("ables", -1, 1), new Among("ibles", -1, 1),
|
120
|
+
new Among("aciones", -1, 2), new Among("uciones", -1, 4),
|
121
|
+
new Among("adores", -1, 2), new Among("antes", -1, 2),
|
122
|
+
new Among("icos", -1, 1), new Among("ismos", -1, 1),
|
123
|
+
new Among("osos", -1, 1), new Among("amientos", -1, 1),
|
124
|
+
new Among("imientos", -1, 1), new Among("ivos", -1, 9)
|
125
|
+
],
|
126
|
+
a_7 = [
|
127
|
+
new Among("ya", -1, 1), new Among("ye", -1, 1),
|
128
|
+
new Among("yan", -1, 1), new Among("yen", -1, 1),
|
129
|
+
new Among("yeron", -1, 1), new Among("yendo", -1, 1),
|
130
|
+
new Among("yo", -1, 1), new Among("yas", -1, 1),
|
131
|
+
new Among("yes", -1, 1), new Among("yais", -1, 1),
|
132
|
+
new Among("yamos", -1, 1), new Among("y\u00F3", -1, 1)
|
133
|
+
],
|
134
|
+
a_8 = [
|
135
|
+
new Among("aba", -1, 2), new Among("ada", -1, 2),
|
136
|
+
new Among("ida", -1, 2), new Among("ara", -1, 2),
|
137
|
+
new Among("iera", -1, 2), new Among("\u00EDa", -1, 2),
|
138
|
+
new Among("ar\u00EDa", 5, 2), new Among("er\u00EDa", 5, 2),
|
139
|
+
new Among("ir\u00EDa", 5, 2), new Among("ad", -1, 2),
|
140
|
+
new Among("ed", -1, 2), new Among("id", -1, 2),
|
141
|
+
new Among("ase", -1, 2), new Among("iese", -1, 2),
|
142
|
+
new Among("aste", -1, 2), new Among("iste", -1, 2),
|
143
|
+
new Among("an", -1, 2), new Among("aban", 16, 2),
|
144
|
+
new Among("aran", 16, 2), new Among("ieran", 16, 2),
|
145
|
+
new Among("\u00EDan", 16, 2), new Among("ar\u00EDan", 20, 2),
|
146
|
+
new Among("er\u00EDan", 20, 2), new Among("ir\u00EDan", 20, 2),
|
147
|
+
new Among("en", -1, 1), new Among("asen", 24, 2),
|
148
|
+
new Among("iesen", 24, 2), new Among("aron", -1, 2),
|
149
|
+
new Among("ieron", -1, 2), new Among("ar\u00E1n", -1, 2),
|
150
|
+
new Among("er\u00E1n", -1, 2), new Among("ir\u00E1n", -1, 2),
|
151
|
+
new Among("ado", -1, 2), new Among("ido", -1, 2),
|
152
|
+
new Among("ando", -1, 2), new Among("iendo", -1, 2),
|
153
|
+
new Among("ar", -1, 2), new Among("er", -1, 2),
|
154
|
+
new Among("ir", -1, 2), new Among("as", -1, 2),
|
155
|
+
new Among("abas", 39, 2), new Among("adas", 39, 2),
|
156
|
+
new Among("idas", 39, 2), new Among("aras", 39, 2),
|
157
|
+
new Among("ieras", 39, 2), new Among("\u00EDas", 39, 2),
|
158
|
+
new Among("ar\u00EDas", 45, 2), new Among("er\u00EDas", 45, 2),
|
159
|
+
new Among("ir\u00EDas", 45, 2), new Among("es", -1, 1),
|
160
|
+
new Among("ases", 49, 2), new Among("ieses", 49, 2),
|
161
|
+
new Among("abais", -1, 2), new Among("arais", -1, 2),
|
162
|
+
new Among("ierais", -1, 2), new Among("\u00EDais", -1, 2),
|
163
|
+
new Among("ar\u00EDais", 55, 2), new Among("er\u00EDais", 55, 2),
|
164
|
+
new Among("ir\u00EDais", 55, 2), new Among("aseis", -1, 2),
|
165
|
+
new Among("ieseis", -1, 2), new Among("asteis", -1, 2),
|
166
|
+
new Among("isteis", -1, 2), new Among("\u00E1is", -1, 2),
|
167
|
+
new Among("\u00E9is", -1, 1), new Among("ar\u00E9is", 64, 2),
|
168
|
+
new Among("er\u00E9is", 64, 2), new Among("ir\u00E9is", 64, 2),
|
169
|
+
new Among("ados", -1, 2), new Among("idos", -1, 2),
|
170
|
+
new Among("amos", -1, 2), new Among("\u00E1bamos", 70, 2),
|
171
|
+
new Among("\u00E1ramos", 70, 2), new Among("i\u00E9ramos", 70, 2),
|
172
|
+
new Among("\u00EDamos", 70, 2), new Among("ar\u00EDamos", 74, 2),
|
173
|
+
new Among("er\u00EDamos", 74, 2), new Among("ir\u00EDamos", 74, 2),
|
174
|
+
new Among("emos", -1, 1), new Among("aremos", 78, 2),
|
175
|
+
new Among("eremos", 78, 2), new Among("iremos", 78, 2),
|
176
|
+
new Among("\u00E1semos", 78, 2), new Among("i\u00E9semos", 78, 2),
|
177
|
+
new Among("imos", -1, 2), new Among("ar\u00E1s", -1, 2),
|
178
|
+
new Among("er\u00E1s", -1, 2), new Among("ir\u00E1s", -1, 2),
|
179
|
+
new Among("\u00EDs", -1, 2), new Among("ar\u00E1", -1, 2),
|
180
|
+
new Among("er\u00E1", -1, 2), new Among("ir\u00E1", -1, 2),
|
181
|
+
new Among("ar\u00E9", -1, 2), new Among("er\u00E9", -1, 2),
|
182
|
+
new Among("ir\u00E9", -1, 2), new Among("i\u00F3", -1, 2)
|
183
|
+
],
|
184
|
+
a_9 = [
|
185
|
+
new Among("a", -1, 1), new Among("e", -1, 2),
|
186
|
+
new Among("o", -1, 1), new Among("os", -1, 1),
|
187
|
+
new Among("\u00E1", -1, 1), new Among("\u00E9", -1, 2),
|
188
|
+
new Among("\u00ED", -1, 1), new Among("\u00F3", -1, 1)
|
189
|
+
],
|
190
|
+
g_v = [17,
|
191
|
+
65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 10
|
192
|
+
],
|
193
|
+
I_p2, I_p1, I_pV, sbp = new SnowballProgram();
|
194
|
+
this.setCurrent = function(word) {
|
195
|
+
sbp.setCurrent(word);
|
196
|
+
};
|
197
|
+
this.getCurrent = function() {
|
198
|
+
return sbp.getCurrent();
|
199
|
+
};
|
200
|
+
|
201
|
+
function habr1() {
|
202
|
+
if (sbp.out_grouping(g_v, 97, 252)) {
|
203
|
+
while (!sbp.in_grouping(g_v, 97, 252)) {
|
204
|
+
if (sbp.cursor >= sbp.limit)
|
205
|
+
return true;
|
206
|
+
sbp.cursor++;
|
207
|
+
}
|
208
|
+
return false;
|
209
|
+
}
|
210
|
+
return true;
|
211
|
+
}
|
212
|
+
|
213
|
+
function habr2() {
|
214
|
+
if (sbp.in_grouping(g_v, 97, 252)) {
|
215
|
+
var v_1 = sbp.cursor;
|
216
|
+
if (habr1()) {
|
217
|
+
sbp.cursor = v_1;
|
218
|
+
if (!sbp.in_grouping(g_v, 97, 252))
|
219
|
+
return true;
|
220
|
+
while (!sbp.out_grouping(g_v, 97, 252)) {
|
221
|
+
if (sbp.cursor >= sbp.limit)
|
222
|
+
return true;
|
223
|
+
sbp.cursor++;
|
224
|
+
}
|
225
|
+
}
|
226
|
+
return false;
|
227
|
+
}
|
228
|
+
return true;
|
229
|
+
}
|
230
|
+
|
231
|
+
function habr3() {
|
232
|
+
var v_1 = sbp.cursor,
|
233
|
+
v_2;
|
234
|
+
if (habr2()) {
|
235
|
+
sbp.cursor = v_1;
|
236
|
+
if (!sbp.out_grouping(g_v, 97, 252))
|
237
|
+
return;
|
238
|
+
v_2 = sbp.cursor;
|
239
|
+
if (habr1()) {
|
240
|
+
sbp.cursor = v_2;
|
241
|
+
if (!sbp.in_grouping(g_v, 97, 252) || sbp.cursor >= sbp.limit)
|
242
|
+
return;
|
243
|
+
sbp.cursor++;
|
244
|
+
}
|
245
|
+
}
|
246
|
+
I_pV = sbp.cursor;
|
247
|
+
}
|
248
|
+
|
249
|
+
function habr4() {
|
250
|
+
while (!sbp.in_grouping(g_v, 97, 252)) {
|
251
|
+
if (sbp.cursor >= sbp.limit)
|
252
|
+
return false;
|
253
|
+
sbp.cursor++;
|
254
|
+
}
|
255
|
+
while (!sbp.out_grouping(g_v, 97, 252)) {
|
256
|
+
if (sbp.cursor >= sbp.limit)
|
257
|
+
return false;
|
258
|
+
sbp.cursor++;
|
259
|
+
}
|
260
|
+
return true;
|
261
|
+
}
|
262
|
+
|
263
|
+
function r_mark_regions() {
|
264
|
+
var v_1 = sbp.cursor;
|
265
|
+
I_pV = sbp.limit;
|
266
|
+
I_p1 = I_pV;
|
267
|
+
I_p2 = I_pV;
|
268
|
+
habr3();
|
269
|
+
sbp.cursor = v_1;
|
270
|
+
if (habr4()) {
|
271
|
+
I_p1 = sbp.cursor;
|
272
|
+
if (habr4())
|
273
|
+
I_p2 = sbp.cursor;
|
274
|
+
}
|
275
|
+
}
|
276
|
+
|
277
|
+
function r_postlude() {
|
278
|
+
var among_var;
|
279
|
+
while (true) {
|
280
|
+
sbp.bra = sbp.cursor;
|
281
|
+
among_var = sbp.find_among(a_0, 6);
|
282
|
+
if (among_var) {
|
283
|
+
sbp.ket = sbp.cursor;
|
284
|
+
switch (among_var) {
|
285
|
+
case 1:
|
286
|
+
sbp.slice_from("a");
|
287
|
+
continue;
|
288
|
+
case 2:
|
289
|
+
sbp.slice_from("e");
|
290
|
+
continue;
|
291
|
+
case 3:
|
292
|
+
sbp.slice_from("i");
|
293
|
+
continue;
|
294
|
+
case 4:
|
295
|
+
sbp.slice_from("o");
|
296
|
+
continue;
|
297
|
+
case 5:
|
298
|
+
sbp.slice_from("u");
|
299
|
+
continue;
|
300
|
+
case 6:
|
301
|
+
if (sbp.cursor >= sbp.limit)
|
302
|
+
break;
|
303
|
+
sbp.cursor++;
|
304
|
+
continue;
|
305
|
+
}
|
306
|
+
}
|
307
|
+
break;
|
308
|
+
}
|
309
|
+
}
|
310
|
+
|
311
|
+
function r_RV() {
|
312
|
+
return I_pV <= sbp.cursor;
|
313
|
+
}
|
314
|
+
|
315
|
+
function r_R1() {
|
316
|
+
return I_p1 <= sbp.cursor;
|
317
|
+
}
|
318
|
+
|
319
|
+
function r_R2() {
|
320
|
+
return I_p2 <= sbp.cursor;
|
321
|
+
}
|
322
|
+
|
323
|
+
function r_attached_pronoun() {
|
324
|
+
var among_var;
|
325
|
+
sbp.ket = sbp.cursor;
|
326
|
+
if (sbp.find_among_b(a_1, 13)) {
|
327
|
+
sbp.bra = sbp.cursor;
|
328
|
+
among_var = sbp.find_among_b(a_2, 11);
|
329
|
+
if (among_var && r_RV())
|
330
|
+
switch (among_var) {
|
331
|
+
case 1:
|
332
|
+
sbp.bra = sbp.cursor;
|
333
|
+
sbp.slice_from("iendo");
|
334
|
+
break;
|
335
|
+
case 2:
|
336
|
+
sbp.bra = sbp.cursor;
|
337
|
+
sbp.slice_from("ando");
|
338
|
+
break;
|
339
|
+
case 3:
|
340
|
+
sbp.bra = sbp.cursor;
|
341
|
+
sbp.slice_from("ar");
|
342
|
+
break;
|
343
|
+
case 4:
|
344
|
+
sbp.bra = sbp.cursor;
|
345
|
+
sbp.slice_from("er");
|
346
|
+
break;
|
347
|
+
case 5:
|
348
|
+
sbp.bra = sbp.cursor;
|
349
|
+
sbp.slice_from("ir");
|
350
|
+
break;
|
351
|
+
case 6:
|
352
|
+
sbp.slice_del();
|
353
|
+
break;
|
354
|
+
case 7:
|
355
|
+
if (sbp.eq_s_b(1, "u"))
|
356
|
+
sbp.slice_del();
|
357
|
+
break;
|
358
|
+
}
|
359
|
+
}
|
360
|
+
}
|
361
|
+
|
362
|
+
function habr5(a, n) {
|
363
|
+
if (!r_R2())
|
364
|
+
return true;
|
365
|
+
sbp.slice_del();
|
366
|
+
sbp.ket = sbp.cursor;
|
367
|
+
var among_var = sbp.find_among_b(a, n);
|
368
|
+
if (among_var) {
|
369
|
+
sbp.bra = sbp.cursor;
|
370
|
+
if (among_var == 1 && r_R2())
|
371
|
+
sbp.slice_del();
|
372
|
+
}
|
373
|
+
return false;
|
374
|
+
}
|
375
|
+
|
376
|
+
function habr6(c1) {
|
377
|
+
if (!r_R2())
|
378
|
+
return true;
|
379
|
+
sbp.slice_del();
|
380
|
+
sbp.ket = sbp.cursor;
|
381
|
+
if (sbp.eq_s_b(2, c1)) {
|
382
|
+
sbp.bra = sbp.cursor;
|
383
|
+
if (r_R2())
|
384
|
+
sbp.slice_del();
|
385
|
+
}
|
386
|
+
return false;
|
387
|
+
}
|
388
|
+
|
389
|
+
function r_standard_suffix() {
|
390
|
+
var among_var;
|
391
|
+
sbp.ket = sbp.cursor;
|
392
|
+
among_var = sbp.find_among_b(a_6, 46);
|
393
|
+
if (among_var) {
|
394
|
+
sbp.bra = sbp.cursor;
|
395
|
+
switch (among_var) {
|
396
|
+
case 1:
|
397
|
+
if (!r_R2())
|
398
|
+
return false;
|
399
|
+
sbp.slice_del();
|
400
|
+
break;
|
401
|
+
case 2:
|
402
|
+
if (habr6("ic"))
|
403
|
+
return false;
|
404
|
+
break;
|
405
|
+
case 3:
|
406
|
+
if (!r_R2())
|
407
|
+
return false;
|
408
|
+
sbp.slice_from("log");
|
409
|
+
break;
|
410
|
+
case 4:
|
411
|
+
if (!r_R2())
|
412
|
+
return false;
|
413
|
+
sbp.slice_from("u");
|
414
|
+
break;
|
415
|
+
case 5:
|
416
|
+
if (!r_R2())
|
417
|
+
return false;
|
418
|
+
sbp.slice_from("ente");
|
419
|
+
break;
|
420
|
+
case 6:
|
421
|
+
if (!r_R1())
|
422
|
+
return false;
|
423
|
+
sbp.slice_del();
|
424
|
+
sbp.ket = sbp.cursor;
|
425
|
+
among_var = sbp.find_among_b(a_3, 4);
|
426
|
+
if (among_var) {
|
427
|
+
sbp.bra = sbp.cursor;
|
428
|
+
if (r_R2()) {
|
429
|
+
sbp.slice_del();
|
430
|
+
if (among_var == 1) {
|
431
|
+
sbp.ket = sbp.cursor;
|
432
|
+
if (sbp.eq_s_b(2, "at")) {
|
433
|
+
sbp.bra = sbp.cursor;
|
434
|
+
if (r_R2())
|
435
|
+
sbp.slice_del();
|
436
|
+
}
|
437
|
+
}
|
438
|
+
}
|
439
|
+
}
|
440
|
+
break;
|
441
|
+
case 7:
|
442
|
+
if (habr5(a_4, 3))
|
443
|
+
return false;
|
444
|
+
break;
|
445
|
+
case 8:
|
446
|
+
if (habr5(a_5, 3))
|
447
|
+
return false;
|
448
|
+
break;
|
449
|
+
case 9:
|
450
|
+
if (habr6("at"))
|
451
|
+
return false;
|
452
|
+
break;
|
453
|
+
}
|
454
|
+
return true;
|
455
|
+
}
|
456
|
+
return false;
|
457
|
+
}
|
458
|
+
|
459
|
+
function r_y_verb_suffix() {
|
460
|
+
var among_var, v_1;
|
461
|
+
if (sbp.cursor >= I_pV) {
|
462
|
+
v_1 = sbp.limit_backward;
|
463
|
+
sbp.limit_backward = I_pV;
|
464
|
+
sbp.ket = sbp.cursor;
|
465
|
+
among_var = sbp.find_among_b(a_7, 12);
|
466
|
+
sbp.limit_backward = v_1;
|
467
|
+
if (among_var) {
|
468
|
+
sbp.bra = sbp.cursor;
|
469
|
+
if (among_var == 1) {
|
470
|
+
if (!sbp.eq_s_b(1, "u"))
|
471
|
+
return false;
|
472
|
+
sbp.slice_del();
|
473
|
+
}
|
474
|
+
return true;
|
475
|
+
}
|
476
|
+
}
|
477
|
+
return false;
|
478
|
+
}
|
479
|
+
|
480
|
+
function r_verb_suffix() {
|
481
|
+
var among_var, v_1, v_2, v_3;
|
482
|
+
if (sbp.cursor >= I_pV) {
|
483
|
+
v_1 = sbp.limit_backward;
|
484
|
+
sbp.limit_backward = I_pV;
|
485
|
+
sbp.ket = sbp.cursor;
|
486
|
+
among_var = sbp.find_among_b(a_8, 96);
|
487
|
+
sbp.limit_backward = v_1;
|
488
|
+
if (among_var) {
|
489
|
+
sbp.bra = sbp.cursor;
|
490
|
+
switch (among_var) {
|
491
|
+
case 1:
|
492
|
+
v_2 = sbp.limit - sbp.cursor;
|
493
|
+
if (sbp.eq_s_b(1, "u")) {
|
494
|
+
v_3 = sbp.limit - sbp.cursor;
|
495
|
+
if (sbp.eq_s_b(1, "g"))
|
496
|
+
sbp.cursor = sbp.limit - v_3;
|
497
|
+
else
|
498
|
+
sbp.cursor = sbp.limit - v_2;
|
499
|
+
} else
|
500
|
+
sbp.cursor = sbp.limit - v_2;
|
501
|
+
sbp.bra = sbp.cursor;
|
502
|
+
case 2:
|
503
|
+
sbp.slice_del();
|
504
|
+
break;
|
505
|
+
}
|
506
|
+
}
|
507
|
+
}
|
508
|
+
}
|
509
|
+
|
510
|
+
function r_residual_suffix() {
|
511
|
+
var among_var, v_1;
|
512
|
+
sbp.ket = sbp.cursor;
|
513
|
+
among_var = sbp.find_among_b(a_9, 8);
|
514
|
+
if (among_var) {
|
515
|
+
sbp.bra = sbp.cursor;
|
516
|
+
switch (among_var) {
|
517
|
+
case 1:
|
518
|
+
if (r_RV())
|
519
|
+
sbp.slice_del();
|
520
|
+
break;
|
521
|
+
case 2:
|
522
|
+
if (r_RV()) {
|
523
|
+
sbp.slice_del();
|
524
|
+
sbp.ket = sbp.cursor;
|
525
|
+
if (sbp.eq_s_b(1, "u")) {
|
526
|
+
sbp.bra = sbp.cursor;
|
527
|
+
v_1 = sbp.limit - sbp.cursor;
|
528
|
+
if (sbp.eq_s_b(1, "g")) {
|
529
|
+
sbp.cursor = sbp.limit - v_1;
|
530
|
+
if (r_RV())
|
531
|
+
sbp.slice_del();
|
532
|
+
}
|
533
|
+
}
|
534
|
+
}
|
535
|
+
break;
|
536
|
+
}
|
537
|
+
}
|
538
|
+
}
|
539
|
+
this.stem = function() {
|
540
|
+
var v_1 = sbp.cursor;
|
541
|
+
r_mark_regions();
|
542
|
+
sbp.limit_backward = v_1;
|
543
|
+
sbp.cursor = sbp.limit;
|
544
|
+
r_attached_pronoun();
|
545
|
+
sbp.cursor = sbp.limit;
|
546
|
+
if (!r_standard_suffix()) {
|
547
|
+
sbp.cursor = sbp.limit;
|
548
|
+
if (!r_y_verb_suffix()) {
|
549
|
+
sbp.cursor = sbp.limit;
|
550
|
+
r_verb_suffix();
|
551
|
+
}
|
552
|
+
}
|
553
|
+
sbp.cursor = sbp.limit;
|
554
|
+
r_residual_suffix();
|
555
|
+
sbp.cursor = sbp.limit_backward;
|
556
|
+
r_postlude();
|
557
|
+
return true;
|
558
|
+
}
|
559
|
+
};
|
560
|
+
|
561
|
+
/* and return a function that stems a word for the current locale */
|
562
|
+
return function(word) {
|
563
|
+
st.setCurrent(word);
|
564
|
+
st.stem();
|
565
|
+
return st.getCurrent();
|
566
|
+
}
|
567
|
+
})();
|
568
|
+
|
569
|
+
lunr.Pipeline.registerFunction(lunr.es.stemmer, 'stemmer-es');
|
570
|
+
|
571
|
+
/* stop word filter function */
|
572
|
+
lunr.es.stopWordFilter = function(token) {
|
573
|
+
if (lunr.es.stopWordFilter.stopWords.indexOf(token) === -1) {
|
574
|
+
return token;
|
575
|
+
}
|
576
|
+
};
|
577
|
+
|
578
|
+
lunr.es.stopWordFilter.stopWords = new lunr.SortedSet();
|
579
|
+
lunr.es.stopWordFilter.stopWords.length = 309;
|
580
|
+
|
581
|
+
// The space at the beginning is crucial: It marks the empty string
|
582
|
+
// as a stop word. lunr.js crashes during search when documents
|
583
|
+
// processed by the pipeline still contain the empty string.
|
584
|
+
lunr.es.stopWordFilter.stopWords.elements = ' a al algo algunas algunos ante antes como con contra cual cuando de del desde donde durante e el ella ellas ellos en entre era erais eran eras eres es esa esas ese eso esos esta estaba estabais estaban estabas estad estada estadas estado estados estamos estando estar estaremos estará estarán estarás estaré estaréis estaría estaríais estaríamos estarían estarías estas este estemos esto estos estoy estuve estuviera estuvierais estuvieran estuvieras estuvieron estuviese estuvieseis estuviesen estuvieses estuvimos estuviste estuvisteis estuviéramos estuviésemos estuvo está estábamos estáis están estás esté estéis estén estés fue fuera fuerais fueran fueras fueron fuese fueseis fuesen fueses fui fuimos fuiste fuisteis fuéramos fuésemos ha habida habidas habido habidos habiendo habremos habrá habrán habrás habré habréis habría habríais habríamos habrían habrías habéis había habíais habíamos habían habías han has hasta hay haya hayamos hayan hayas hayáis he hemos hube hubiera hubierais hubieran hubieras hubieron hubiese hubieseis hubiesen hubieses hubimos hubiste hubisteis hubiéramos hubiésemos hubo la las le les lo los me mi mis mucho muchos muy más mí mía mías mío míos nada ni no nos nosotras nosotros nuestra nuestras nuestro nuestros o os otra otras otro otros para pero poco por porque que quien quienes qué se sea seamos sean seas seremos será serán serás seré seréis sería seríais seríamos serían serías seáis sido siendo sin sobre sois somos son soy su sus suya suyas suyo suyos sí también tanto te tendremos tendrá tendrán tendrás tendré tendréis tendría tendríais tendríamos tendrían tendrías tened tenemos tenga tengamos tengan tengas tengo tengáis tenida tenidas tenido tenidos teniendo tenéis tenía teníais teníamos tenían tenías ti tiene tienen tienes todo todos tu tus tuve tuviera tuvierais tuvieran tuvieras tuvieron tuviese tuvieseis tuviesen tuvieses tuvimos tuviste tuvisteis tuviéramos tuviésemos tuvo tuya tuyas tuyo tuyos tú un una uno unos vosotras vosotros vuestra vuestras vuestro vuestros y ya yo él éramos'.split(' ');
|
585
|
+
|
586
|
+
lunr.Pipeline.registerFunction(lunr.es.stopWordFilter, 'stopWordFilter-es');
|
587
|
+
};
|
588
|
+
}))
|