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,691 @@
|
|
1
|
+
/*!
|
2
|
+
* Lunr languages, `French` 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.fr = function() {
|
57
|
+
this.pipeline.reset();
|
58
|
+
this.pipeline.add(
|
59
|
+
lunr.fr.stopWordFilter,
|
60
|
+
lunr.fr.stemmer
|
61
|
+
);
|
62
|
+
};
|
63
|
+
|
64
|
+
/* lunr stemmer function */
|
65
|
+
lunr.fr.stemmer = (function() {
|
66
|
+
/* create the wrapped stemmer object */
|
67
|
+
var Among = lunr.stemmerSupport.Among,
|
68
|
+
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
69
|
+
st = new function FrenchStemmer() {
|
70
|
+
var a_0 = [new Among("col", -1, -1), new Among("par", -1, -1),
|
71
|
+
new Among("tap", -1, -1)
|
72
|
+
],
|
73
|
+
a_1 = [new Among("", -1, 4),
|
74
|
+
new Among("I", 0, 1), new Among("U", 0, 2), new Among("Y", 0, 3)
|
75
|
+
],
|
76
|
+
a_2 = [
|
77
|
+
new Among("iqU", -1, 3), new Among("abl", -1, 3),
|
78
|
+
new Among("I\u00E8r", -1, 4), new Among("i\u00E8r", -1, 4),
|
79
|
+
new Among("eus", -1, 2), new Among("iv", -1, 1)
|
80
|
+
],
|
81
|
+
a_3 = [
|
82
|
+
new Among("ic", -1, 2), new Among("abil", -1, 1),
|
83
|
+
new Among("iv", -1, 3)
|
84
|
+
],
|
85
|
+
a_4 = [new Among("iqUe", -1, 1),
|
86
|
+
new Among("atrice", -1, 2), new Among("ance", -1, 1),
|
87
|
+
new Among("ence", -1, 5), new Among("logie", -1, 3),
|
88
|
+
new Among("able", -1, 1), new Among("isme", -1, 1),
|
89
|
+
new Among("euse", -1, 11), new Among("iste", -1, 1),
|
90
|
+
new Among("ive", -1, 8), new Among("if", -1, 8),
|
91
|
+
new Among("usion", -1, 4), new Among("ation", -1, 2),
|
92
|
+
new Among("ution", -1, 4), new Among("ateur", -1, 2),
|
93
|
+
new Among("iqUes", -1, 1), new Among("atrices", -1, 2),
|
94
|
+
new Among("ances", -1, 1), new Among("ences", -1, 5),
|
95
|
+
new Among("logies", -1, 3), new Among("ables", -1, 1),
|
96
|
+
new Among("ismes", -1, 1), new Among("euses", -1, 11),
|
97
|
+
new Among("istes", -1, 1), new Among("ives", -1, 8),
|
98
|
+
new Among("ifs", -1, 8), new Among("usions", -1, 4),
|
99
|
+
new Among("ations", -1, 2), new Among("utions", -1, 4),
|
100
|
+
new Among("ateurs", -1, 2), new Among("ments", -1, 15),
|
101
|
+
new Among("ements", 30, 6), new Among("issements", 31, 12),
|
102
|
+
new Among("it\u00E9s", -1, 7), new Among("ment", -1, 15),
|
103
|
+
new Among("ement", 34, 6), new Among("issement", 35, 12),
|
104
|
+
new Among("amment", 34, 13), new Among("emment", 34, 14),
|
105
|
+
new Among("aux", -1, 10), new Among("eaux", 39, 9),
|
106
|
+
new Among("eux", -1, 1), new Among("it\u00E9", -1, 7)
|
107
|
+
],
|
108
|
+
a_5 = [
|
109
|
+
new Among("ira", -1, 1), new Among("ie", -1, 1),
|
110
|
+
new Among("isse", -1, 1), new Among("issante", -1, 1),
|
111
|
+
new Among("i", -1, 1), new Among("irai", 4, 1),
|
112
|
+
new Among("ir", -1, 1), new Among("iras", -1, 1),
|
113
|
+
new Among("ies", -1, 1), new Among("\u00EEmes", -1, 1),
|
114
|
+
new Among("isses", -1, 1), new Among("issantes", -1, 1),
|
115
|
+
new Among("\u00EEtes", -1, 1), new Among("is", -1, 1),
|
116
|
+
new Among("irais", 13, 1), new Among("issais", 13, 1),
|
117
|
+
new Among("irions", -1, 1), new Among("issions", -1, 1),
|
118
|
+
new Among("irons", -1, 1), new Among("issons", -1, 1),
|
119
|
+
new Among("issants", -1, 1), new Among("it", -1, 1),
|
120
|
+
new Among("irait", 21, 1), new Among("issait", 21, 1),
|
121
|
+
new Among("issant", -1, 1), new Among("iraIent", -1, 1),
|
122
|
+
new Among("issaIent", -1, 1), new Among("irent", -1, 1),
|
123
|
+
new Among("issent", -1, 1), new Among("iront", -1, 1),
|
124
|
+
new Among("\u00EEt", -1, 1), new Among("iriez", -1, 1),
|
125
|
+
new Among("issiez", -1, 1), new Among("irez", -1, 1),
|
126
|
+
new Among("issez", -1, 1)
|
127
|
+
],
|
128
|
+
a_6 = [new Among("a", -1, 3),
|
129
|
+
new Among("era", 0, 2), new Among("asse", -1, 3),
|
130
|
+
new Among("ante", -1, 3), new Among("\u00E9e", -1, 2),
|
131
|
+
new Among("ai", -1, 3), new Among("erai", 5, 2),
|
132
|
+
new Among("er", -1, 2), new Among("as", -1, 3),
|
133
|
+
new Among("eras", 8, 2), new Among("\u00E2mes", -1, 3),
|
134
|
+
new Among("asses", -1, 3), new Among("antes", -1, 3),
|
135
|
+
new Among("\u00E2tes", -1, 3), new Among("\u00E9es", -1, 2),
|
136
|
+
new Among("ais", -1, 3), new Among("erais", 15, 2),
|
137
|
+
new Among("ions", -1, 1), new Among("erions", 17, 2),
|
138
|
+
new Among("assions", 17, 3), new Among("erons", -1, 2),
|
139
|
+
new Among("ants", -1, 3), new Among("\u00E9s", -1, 2),
|
140
|
+
new Among("ait", -1, 3), new Among("erait", 23, 2),
|
141
|
+
new Among("ant", -1, 3), new Among("aIent", -1, 3),
|
142
|
+
new Among("eraIent", 26, 2), new Among("\u00E8rent", -1, 2),
|
143
|
+
new Among("assent", -1, 3), new Among("eront", -1, 2),
|
144
|
+
new Among("\u00E2t", -1, 3), new Among("ez", -1, 2),
|
145
|
+
new Among("iez", 32, 2), new Among("eriez", 33, 2),
|
146
|
+
new Among("assiez", 33, 3), new Among("erez", 32, 2),
|
147
|
+
new Among("\u00E9", -1, 2)
|
148
|
+
],
|
149
|
+
a_7 = [new Among("e", -1, 3),
|
150
|
+
new Among("I\u00E8re", 0, 2), new Among("i\u00E8re", 0, 2),
|
151
|
+
new Among("ion", -1, 1), new Among("Ier", -1, 2),
|
152
|
+
new Among("ier", -1, 2), new Among("\u00EB", -1, 4)
|
153
|
+
],
|
154
|
+
a_8 = [
|
155
|
+
new Among("ell", -1, -1), new Among("eill", -1, -1),
|
156
|
+
new Among("enn", -1, -1), new Among("onn", -1, -1),
|
157
|
+
new Among("ett", -1, -1)
|
158
|
+
],
|
159
|
+
g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0,
|
160
|
+
0, 0, 0, 0, 0, 128, 130, 103, 8, 5
|
161
|
+
],
|
162
|
+
g_keep_with_s = [1, 65, 20, 0,
|
163
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
164
|
+
],
|
165
|
+
I_p2, I_p1, I_pV, sbp = new SnowballProgram();
|
166
|
+
this.setCurrent = function(word) {
|
167
|
+
sbp.setCurrent(word);
|
168
|
+
};
|
169
|
+
this.getCurrent = function() {
|
170
|
+
return sbp.getCurrent();
|
171
|
+
};
|
172
|
+
|
173
|
+
function habr1(c1, c2, v_1) {
|
174
|
+
if (sbp.eq_s(1, c1)) {
|
175
|
+
sbp.ket = sbp.cursor;
|
176
|
+
if (sbp.in_grouping(g_v, 97, 251)) {
|
177
|
+
sbp.slice_from(c2);
|
178
|
+
sbp.cursor = v_1;
|
179
|
+
return true;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
return false;
|
183
|
+
}
|
184
|
+
|
185
|
+
function habr2(c1, c2, v_1) {
|
186
|
+
if (sbp.eq_s(1, c1)) {
|
187
|
+
sbp.ket = sbp.cursor;
|
188
|
+
sbp.slice_from(c2);
|
189
|
+
sbp.cursor = v_1;
|
190
|
+
return true;
|
191
|
+
}
|
192
|
+
return false;
|
193
|
+
}
|
194
|
+
|
195
|
+
function r_prelude() {
|
196
|
+
var v_1, v_2;
|
197
|
+
while (true) {
|
198
|
+
v_1 = sbp.cursor;
|
199
|
+
if (sbp.in_grouping(g_v, 97, 251)) {
|
200
|
+
sbp.bra = sbp.cursor;
|
201
|
+
v_2 = sbp.cursor;
|
202
|
+
if (habr1("u", "U", v_1))
|
203
|
+
continue;
|
204
|
+
sbp.cursor = v_2;
|
205
|
+
if (habr1("i", "I", v_1))
|
206
|
+
continue;
|
207
|
+
sbp.cursor = v_2;
|
208
|
+
if (habr2("y", "Y", v_1))
|
209
|
+
continue;
|
210
|
+
}
|
211
|
+
sbp.cursor = v_1;
|
212
|
+
sbp.bra = v_1;
|
213
|
+
if (!habr1("y", "Y", v_1)) {
|
214
|
+
sbp.cursor = v_1;
|
215
|
+
if (sbp.eq_s(1, "q")) {
|
216
|
+
sbp.bra = sbp.cursor;
|
217
|
+
if (habr2("u", "U", v_1))
|
218
|
+
continue;
|
219
|
+
}
|
220
|
+
sbp.cursor = v_1;
|
221
|
+
if (v_1 >= sbp.limit)
|
222
|
+
return;
|
223
|
+
sbp.cursor++;
|
224
|
+
}
|
225
|
+
}
|
226
|
+
}
|
227
|
+
|
228
|
+
function habr3() {
|
229
|
+
while (!sbp.in_grouping(g_v, 97, 251)) {
|
230
|
+
if (sbp.cursor >= sbp.limit)
|
231
|
+
return true;
|
232
|
+
sbp.cursor++;
|
233
|
+
}
|
234
|
+
while (!sbp.out_grouping(g_v, 97, 251)) {
|
235
|
+
if (sbp.cursor >= sbp.limit)
|
236
|
+
return true;
|
237
|
+
sbp.cursor++;
|
238
|
+
}
|
239
|
+
return false;
|
240
|
+
}
|
241
|
+
|
242
|
+
function r_mark_regions() {
|
243
|
+
var v_1 = sbp.cursor;
|
244
|
+
I_pV = sbp.limit;
|
245
|
+
I_p1 = I_pV;
|
246
|
+
I_p2 = I_pV;
|
247
|
+
if (sbp.in_grouping(g_v, 97, 251) && sbp.in_grouping(g_v, 97, 251) && sbp.cursor < sbp.limit)
|
248
|
+
sbp.cursor++;
|
249
|
+
else {
|
250
|
+
sbp.cursor = v_1;
|
251
|
+
if (!sbp.find_among(a_0, 3)) {
|
252
|
+
sbp.cursor = v_1;
|
253
|
+
do {
|
254
|
+
if (sbp.cursor >= sbp.limit) {
|
255
|
+
sbp.cursor = I_pV;
|
256
|
+
break;
|
257
|
+
}
|
258
|
+
sbp.cursor++;
|
259
|
+
} while (!sbp.in_grouping(g_v, 97, 251));
|
260
|
+
}
|
261
|
+
}
|
262
|
+
I_pV = sbp.cursor;
|
263
|
+
sbp.cursor = v_1;
|
264
|
+
if (!habr3()) {
|
265
|
+
I_p1 = sbp.cursor;
|
266
|
+
if (!habr3())
|
267
|
+
I_p2 = sbp.cursor;
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
function r_postlude() {
|
272
|
+
var among_var, v_1;
|
273
|
+
while (true) {
|
274
|
+
v_1 = sbp.cursor;
|
275
|
+
sbp.bra = v_1;
|
276
|
+
among_var = sbp.find_among(a_1, 4);
|
277
|
+
if (!among_var)
|
278
|
+
break;
|
279
|
+
sbp.ket = sbp.cursor;
|
280
|
+
switch (among_var) {
|
281
|
+
case 1:
|
282
|
+
sbp.slice_from("i");
|
283
|
+
break;
|
284
|
+
case 2:
|
285
|
+
sbp.slice_from("u");
|
286
|
+
break;
|
287
|
+
case 3:
|
288
|
+
sbp.slice_from("y");
|
289
|
+
break;
|
290
|
+
case 4:
|
291
|
+
if (sbp.cursor >= sbp.limit)
|
292
|
+
return;
|
293
|
+
sbp.cursor++;
|
294
|
+
break;
|
295
|
+
}
|
296
|
+
}
|
297
|
+
}
|
298
|
+
|
299
|
+
function r_RV() {
|
300
|
+
return I_pV <= sbp.cursor;
|
301
|
+
}
|
302
|
+
|
303
|
+
function r_R1() {
|
304
|
+
return I_p1 <= sbp.cursor;
|
305
|
+
}
|
306
|
+
|
307
|
+
function r_R2() {
|
308
|
+
return I_p2 <= sbp.cursor;
|
309
|
+
}
|
310
|
+
|
311
|
+
function r_standard_suffix() {
|
312
|
+
var among_var, v_1;
|
313
|
+
sbp.ket = sbp.cursor;
|
314
|
+
among_var = sbp.find_among_b(a_4, 43);
|
315
|
+
if (among_var) {
|
316
|
+
sbp.bra = sbp.cursor;
|
317
|
+
switch (among_var) {
|
318
|
+
case 1:
|
319
|
+
if (!r_R2())
|
320
|
+
return false;
|
321
|
+
sbp.slice_del();
|
322
|
+
break;
|
323
|
+
case 2:
|
324
|
+
if (!r_R2())
|
325
|
+
return false;
|
326
|
+
sbp.slice_del();
|
327
|
+
sbp.ket = sbp.cursor;
|
328
|
+
if (sbp.eq_s_b(2, "ic")) {
|
329
|
+
sbp.bra = sbp.cursor;
|
330
|
+
if (!r_R2())
|
331
|
+
sbp.slice_from("iqU");
|
332
|
+
else
|
333
|
+
sbp.slice_del();
|
334
|
+
}
|
335
|
+
break;
|
336
|
+
case 3:
|
337
|
+
if (!r_R2())
|
338
|
+
return false;
|
339
|
+
sbp.slice_from("log");
|
340
|
+
break;
|
341
|
+
case 4:
|
342
|
+
if (!r_R2())
|
343
|
+
return false;
|
344
|
+
sbp.slice_from("u");
|
345
|
+
break;
|
346
|
+
case 5:
|
347
|
+
if (!r_R2())
|
348
|
+
return false;
|
349
|
+
sbp.slice_from("ent");
|
350
|
+
break;
|
351
|
+
case 6:
|
352
|
+
if (!r_RV())
|
353
|
+
return false;
|
354
|
+
sbp.slice_del();
|
355
|
+
sbp.ket = sbp.cursor;
|
356
|
+
among_var = sbp.find_among_b(a_2, 6);
|
357
|
+
if (among_var) {
|
358
|
+
sbp.bra = sbp.cursor;
|
359
|
+
switch (among_var) {
|
360
|
+
case 1:
|
361
|
+
if (r_R2()) {
|
362
|
+
sbp.slice_del();
|
363
|
+
sbp.ket = sbp.cursor;
|
364
|
+
if (sbp.eq_s_b(2, "at")) {
|
365
|
+
sbp.bra = sbp.cursor;
|
366
|
+
if (r_R2())
|
367
|
+
sbp.slice_del();
|
368
|
+
}
|
369
|
+
}
|
370
|
+
break;
|
371
|
+
case 2:
|
372
|
+
if (r_R2())
|
373
|
+
sbp.slice_del();
|
374
|
+
else if (r_R1())
|
375
|
+
sbp.slice_from("eux");
|
376
|
+
break;
|
377
|
+
case 3:
|
378
|
+
if (r_R2())
|
379
|
+
sbp.slice_del();
|
380
|
+
break;
|
381
|
+
case 4:
|
382
|
+
if (r_RV())
|
383
|
+
sbp.slice_from("i");
|
384
|
+
break;
|
385
|
+
}
|
386
|
+
}
|
387
|
+
break;
|
388
|
+
case 7:
|
389
|
+
if (!r_R2())
|
390
|
+
return false;
|
391
|
+
sbp.slice_del();
|
392
|
+
sbp.ket = sbp.cursor;
|
393
|
+
among_var = sbp.find_among_b(a_3, 3);
|
394
|
+
if (among_var) {
|
395
|
+
sbp.bra = sbp.cursor;
|
396
|
+
switch (among_var) {
|
397
|
+
case 1:
|
398
|
+
if (r_R2())
|
399
|
+
sbp.slice_del();
|
400
|
+
else
|
401
|
+
sbp.slice_from("abl");
|
402
|
+
break;
|
403
|
+
case 2:
|
404
|
+
if (r_R2())
|
405
|
+
sbp.slice_del();
|
406
|
+
else
|
407
|
+
sbp.slice_from("iqU");
|
408
|
+
break;
|
409
|
+
case 3:
|
410
|
+
if (r_R2())
|
411
|
+
sbp.slice_del();
|
412
|
+
break;
|
413
|
+
}
|
414
|
+
}
|
415
|
+
break;
|
416
|
+
case 8:
|
417
|
+
if (!r_R2())
|
418
|
+
return false;
|
419
|
+
sbp.slice_del();
|
420
|
+
sbp.ket = sbp.cursor;
|
421
|
+
if (sbp.eq_s_b(2, "at")) {
|
422
|
+
sbp.bra = sbp.cursor;
|
423
|
+
if (r_R2()) {
|
424
|
+
sbp.slice_del();
|
425
|
+
sbp.ket = sbp.cursor;
|
426
|
+
if (sbp.eq_s_b(2, "ic")) {
|
427
|
+
sbp.bra = sbp.cursor;
|
428
|
+
if (r_R2())
|
429
|
+
sbp.slice_del();
|
430
|
+
else
|
431
|
+
sbp.slice_from("iqU");
|
432
|
+
break;
|
433
|
+
}
|
434
|
+
}
|
435
|
+
}
|
436
|
+
break;
|
437
|
+
case 9:
|
438
|
+
sbp.slice_from("eau");
|
439
|
+
break;
|
440
|
+
case 10:
|
441
|
+
if (!r_R1())
|
442
|
+
return false;
|
443
|
+
sbp.slice_from("al");
|
444
|
+
break;
|
445
|
+
case 11:
|
446
|
+
if (r_R2())
|
447
|
+
sbp.slice_del();
|
448
|
+
else if (!r_R1())
|
449
|
+
return false;
|
450
|
+
else
|
451
|
+
sbp.slice_from("eux");
|
452
|
+
break;
|
453
|
+
case 12:
|
454
|
+
if (!r_R1() || !sbp.out_grouping_b(g_v, 97, 251))
|
455
|
+
return false;
|
456
|
+
sbp.slice_del();
|
457
|
+
break;
|
458
|
+
case 13:
|
459
|
+
if (r_RV())
|
460
|
+
sbp.slice_from("ant");
|
461
|
+
return false;
|
462
|
+
case 14:
|
463
|
+
if (r_RV())
|
464
|
+
sbp.slice_from("ent");
|
465
|
+
return false;
|
466
|
+
case 15:
|
467
|
+
v_1 = sbp.limit - sbp.cursor;
|
468
|
+
if (sbp.in_grouping_b(g_v, 97, 251) && r_RV()) {
|
469
|
+
sbp.cursor = sbp.limit - v_1;
|
470
|
+
sbp.slice_del();
|
471
|
+
}
|
472
|
+
return false;
|
473
|
+
}
|
474
|
+
return true;
|
475
|
+
}
|
476
|
+
return false;
|
477
|
+
}
|
478
|
+
|
479
|
+
function r_i_verb_suffix() {
|
480
|
+
var among_var, v_1;
|
481
|
+
if (sbp.cursor < I_pV)
|
482
|
+
return false;
|
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_5, 35);
|
487
|
+
if (!among_var) {
|
488
|
+
sbp.limit_backward = v_1;
|
489
|
+
return false;
|
490
|
+
}
|
491
|
+
sbp.bra = sbp.cursor;
|
492
|
+
if (among_var == 1) {
|
493
|
+
if (!sbp.out_grouping_b(g_v, 97, 251)) {
|
494
|
+
sbp.limit_backward = v_1;
|
495
|
+
return false;
|
496
|
+
}
|
497
|
+
sbp.slice_del();
|
498
|
+
}
|
499
|
+
sbp.limit_backward = v_1;
|
500
|
+
return true;
|
501
|
+
}
|
502
|
+
|
503
|
+
function r_verb_suffix() {
|
504
|
+
var among_var, v_2, v_3;
|
505
|
+
if (sbp.cursor < I_pV)
|
506
|
+
return false;
|
507
|
+
v_2 = sbp.limit_backward;
|
508
|
+
sbp.limit_backward = I_pV;
|
509
|
+
sbp.ket = sbp.cursor;
|
510
|
+
among_var = sbp.find_among_b(a_6, 38);
|
511
|
+
if (!among_var) {
|
512
|
+
sbp.limit_backward = v_2;
|
513
|
+
return false;
|
514
|
+
}
|
515
|
+
sbp.bra = sbp.cursor;
|
516
|
+
switch (among_var) {
|
517
|
+
case 1:
|
518
|
+
if (!r_R2()) {
|
519
|
+
sbp.limit_backward = v_2;
|
520
|
+
return false;
|
521
|
+
}
|
522
|
+
sbp.slice_del();
|
523
|
+
break;
|
524
|
+
case 2:
|
525
|
+
sbp.slice_del();
|
526
|
+
break;
|
527
|
+
case 3:
|
528
|
+
sbp.slice_del();
|
529
|
+
v_3 = sbp.limit - sbp.cursor;
|
530
|
+
sbp.ket = sbp.cursor;
|
531
|
+
if (sbp.eq_s_b(1, "e")) {
|
532
|
+
sbp.bra = sbp.cursor;
|
533
|
+
sbp.slice_del();
|
534
|
+
} else
|
535
|
+
sbp.cursor = sbp.limit - v_3;
|
536
|
+
break;
|
537
|
+
}
|
538
|
+
sbp.limit_backward = v_2;
|
539
|
+
return true;
|
540
|
+
}
|
541
|
+
|
542
|
+
function r_residual_suffix() {
|
543
|
+
var among_var, v_1 = sbp.limit - sbp.cursor,
|
544
|
+
v_2, v_4, v_5;
|
545
|
+
sbp.ket = sbp.cursor;
|
546
|
+
if (sbp.eq_s_b(1, "s")) {
|
547
|
+
sbp.bra = sbp.cursor;
|
548
|
+
v_2 = sbp.limit - sbp.cursor;
|
549
|
+
if (sbp.out_grouping_b(g_keep_with_s, 97, 232)) {
|
550
|
+
sbp.cursor = sbp.limit - v_2;
|
551
|
+
sbp.slice_del();
|
552
|
+
} else
|
553
|
+
sbp.cursor = sbp.limit - v_1;
|
554
|
+
} else
|
555
|
+
sbp.cursor = sbp.limit - v_1;
|
556
|
+
if (sbp.cursor >= I_pV) {
|
557
|
+
v_4 = sbp.limit_backward;
|
558
|
+
sbp.limit_backward = I_pV;
|
559
|
+
sbp.ket = sbp.cursor;
|
560
|
+
among_var = sbp.find_among_b(a_7, 7);
|
561
|
+
if (among_var) {
|
562
|
+
sbp.bra = sbp.cursor;
|
563
|
+
switch (among_var) {
|
564
|
+
case 1:
|
565
|
+
if (r_R2()) {
|
566
|
+
v_5 = sbp.limit - sbp.cursor;
|
567
|
+
if (!sbp.eq_s_b(1, "s")) {
|
568
|
+
sbp.cursor = sbp.limit - v_5;
|
569
|
+
if (!sbp.eq_s_b(1, "t"))
|
570
|
+
break;
|
571
|
+
}
|
572
|
+
sbp.slice_del();
|
573
|
+
}
|
574
|
+
break;
|
575
|
+
case 2:
|
576
|
+
sbp.slice_from("i");
|
577
|
+
break;
|
578
|
+
case 3:
|
579
|
+
sbp.slice_del();
|
580
|
+
break;
|
581
|
+
case 4:
|
582
|
+
if (sbp.eq_s_b(2, "gu"))
|
583
|
+
sbp.slice_del();
|
584
|
+
break;
|
585
|
+
}
|
586
|
+
}
|
587
|
+
sbp.limit_backward = v_4;
|
588
|
+
}
|
589
|
+
}
|
590
|
+
|
591
|
+
function r_un_double() {
|
592
|
+
var v_1 = sbp.limit - sbp.cursor;
|
593
|
+
if (sbp.find_among_b(a_8, 5)) {
|
594
|
+
sbp.cursor = sbp.limit - v_1;
|
595
|
+
sbp.ket = sbp.cursor;
|
596
|
+
if (sbp.cursor > sbp.limit_backward) {
|
597
|
+
sbp.cursor--;
|
598
|
+
sbp.bra = sbp.cursor;
|
599
|
+
sbp.slice_del();
|
600
|
+
}
|
601
|
+
}
|
602
|
+
}
|
603
|
+
|
604
|
+
function r_un_accent() {
|
605
|
+
var v_1, v_2 = 1;
|
606
|
+
while (sbp.out_grouping_b(g_v, 97, 251))
|
607
|
+
v_2--;
|
608
|
+
if (v_2 <= 0) {
|
609
|
+
sbp.ket = sbp.cursor;
|
610
|
+
v_1 = sbp.limit - sbp.cursor;
|
611
|
+
if (!sbp.eq_s_b(1, "\u00E9")) {
|
612
|
+
sbp.cursor = sbp.limit - v_1;
|
613
|
+
if (!sbp.eq_s_b(1, "\u00E8"))
|
614
|
+
return;
|
615
|
+
}
|
616
|
+
sbp.bra = sbp.cursor;
|
617
|
+
sbp.slice_from("e");
|
618
|
+
}
|
619
|
+
}
|
620
|
+
|
621
|
+
function habr5() {
|
622
|
+
if (!r_standard_suffix()) {
|
623
|
+
sbp.cursor = sbp.limit;
|
624
|
+
if (!r_i_verb_suffix()) {
|
625
|
+
sbp.cursor = sbp.limit;
|
626
|
+
if (!r_verb_suffix()) {
|
627
|
+
sbp.cursor = sbp.limit;
|
628
|
+
r_residual_suffix();
|
629
|
+
return;
|
630
|
+
}
|
631
|
+
}
|
632
|
+
}
|
633
|
+
sbp.cursor = sbp.limit;
|
634
|
+
sbp.ket = sbp.cursor;
|
635
|
+
if (sbp.eq_s_b(1, "Y")) {
|
636
|
+
sbp.bra = sbp.cursor;
|
637
|
+
sbp.slice_from("i");
|
638
|
+
} else {
|
639
|
+
sbp.cursor = sbp.limit;
|
640
|
+
if (sbp.eq_s_b(1, "\u00E7")) {
|
641
|
+
sbp.bra = sbp.cursor;
|
642
|
+
sbp.slice_from("c");
|
643
|
+
}
|
644
|
+
}
|
645
|
+
}
|
646
|
+
this.stem = function() {
|
647
|
+
var v_1 = sbp.cursor;
|
648
|
+
r_prelude();
|
649
|
+
sbp.cursor = v_1;
|
650
|
+
r_mark_regions();
|
651
|
+
sbp.limit_backward = v_1;
|
652
|
+
sbp.cursor = sbp.limit;
|
653
|
+
habr5();
|
654
|
+
sbp.cursor = sbp.limit;
|
655
|
+
r_un_double();
|
656
|
+
sbp.cursor = sbp.limit;
|
657
|
+
r_un_accent();
|
658
|
+
sbp.cursor = sbp.limit_backward;
|
659
|
+
r_postlude();
|
660
|
+
return true;
|
661
|
+
}
|
662
|
+
};
|
663
|
+
|
664
|
+
/* and return a function that stems a word for the current locale */
|
665
|
+
return function(word) {
|
666
|
+
st.setCurrent(word);
|
667
|
+
st.stem();
|
668
|
+
return st.getCurrent();
|
669
|
+
}
|
670
|
+
})();
|
671
|
+
|
672
|
+
lunr.Pipeline.registerFunction(lunr.fr.stemmer, 'stemmer-fr');
|
673
|
+
|
674
|
+
/* stop word filter function */
|
675
|
+
lunr.fr.stopWordFilter = function(token) {
|
676
|
+
if (lunr.fr.stopWordFilter.stopWords.indexOf(token) === -1) {
|
677
|
+
return token;
|
678
|
+
}
|
679
|
+
};
|
680
|
+
|
681
|
+
lunr.fr.stopWordFilter.stopWords = new lunr.SortedSet();
|
682
|
+
lunr.fr.stopWordFilter.stopWords.length = 164;
|
683
|
+
|
684
|
+
// The space at the beginning is crucial: It marks the empty string
|
685
|
+
// as a stop word. lunr.js crashes during search when documents
|
686
|
+
// processed by the pipeline still contain the empty string.
|
687
|
+
lunr.fr.stopWordFilter.stopWords.elements = ' ai aie aient aies ait as au aura aurai auraient aurais aurait auras aurez auriez aurions aurons auront aux avaient avais avait avec avez aviez avions avons ayant ayez ayons c ce ceci celà ces cet cette d dans de des du elle en es est et eu eue eues eurent eus eusse eussent eusses eussiez eussions eut eux eûmes eût eûtes furent fus fusse fussent fusses fussiez fussions fut fûmes fût fûtes ici il ils j je l la le les leur leurs lui m ma mais me mes moi mon même n ne nos notre nous on ont ou par pas pour qu que quel quelle quelles quels qui s sa sans se sera serai seraient serais serait seras serez seriez serions serons seront ses soi soient sois soit sommes son sont soyez soyons suis sur t ta te tes toi ton tu un une vos votre vous y à étaient étais était étant étiez étions été étée étées étés êtes'.split(' ');
|
688
|
+
|
689
|
+
lunr.Pipeline.registerFunction(lunr.fr.stopWordFilter, 'stopWordFilter-fr');
|
690
|
+
};
|
691
|
+
}))
|