middleman-search-gds 0.11.0a

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ module MiddlemanSearch
2
+ VERSION = "0.11.0a"
3
+ end
@@ -0,0 +1 @@
1
+ require "middleman-search"
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'middleman-search/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "middleman-search-gds"
8
+ spec.version = MiddlemanSearch::VERSION
9
+ spec.authors = ["Government Digital Service", "Matías García Isaía", "Santiago Palladino"]
10
+ spec.email = ["govuk-dev@digital.cabinet-office.gov.uk", "mgarcia@manas.com.ar", "spalladino@manas.com.ar"]
11
+ spec.summary = %q{LunrJS-based search for Middleman}
12
+ spec.description = %q{LunrJS-based search for Middleman. This is an unofficial fork of the middleman-search gem.}
13
+ spec.homepage = "http://github.com/alphagov/middleman-search"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "middleman-core", [">= 3.2"]
22
+ spec.add_dependency "execjs", ["~> 2.6"]
23
+ spec.add_dependency "nokogiri", ["~> 1.6"]
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.5"
26
+ spec.add_development_dependency "rake"
27
+ end
@@ -0,0 +1,273 @@
1
+ /*!
2
+ * Lunr languages, `Danish` 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.da = function() {
57
+ this.pipeline.reset();
58
+ this.pipeline.add(
59
+ lunr.da.stopWordFilter,
60
+ lunr.da.stemmer
61
+ );
62
+ };
63
+
64
+ /* lunr stemmer function */
65
+ lunr.da.stemmer = (function() {
66
+ /* create the wrapped stemmer object */
67
+ var Among = lunr.stemmerSupport.Among,
68
+ SnowballProgram = lunr.stemmerSupport.SnowballProgram,
69
+ st = new function DanishStemmer() {
70
+ var a_0 = [new Among("hed", -1, 1), new Among("ethed", 0, 1),
71
+ new Among("ered", -1, 1), new Among("e", -1, 1),
72
+ new Among("erede", 3, 1), new Among("ende", 3, 1),
73
+ new Among("erende", 5, 1), new Among("ene", 3, 1),
74
+ new Among("erne", 3, 1), new Among("ere", 3, 1),
75
+ new Among("en", -1, 1), new Among("heden", 10, 1),
76
+ new Among("eren", 10, 1), new Among("er", -1, 1),
77
+ new Among("heder", 13, 1), new Among("erer", 13, 1),
78
+ new Among("s", -1, 2), new Among("heds", 16, 1),
79
+ new Among("es", 16, 1), new Among("endes", 18, 1),
80
+ new Among("erendes", 19, 1), new Among("enes", 18, 1),
81
+ new Among("ernes", 18, 1), new Among("eres", 18, 1),
82
+ new Among("ens", 16, 1), new Among("hedens", 24, 1),
83
+ new Among("erens", 24, 1), new Among("ers", 16, 1),
84
+ new Among("ets", 16, 1), new Among("erets", 28, 1),
85
+ new Among("et", -1, 1), new Among("eret", 30, 1)
86
+ ],
87
+ a_1 = [
88
+ new Among("gd", -1, -1), new Among("dt", -1, -1),
89
+ new Among("gt", -1, -1), new Among("kt", -1, -1)
90
+ ],
91
+ a_2 = [
92
+ new Among("ig", -1, 1), new Among("lig", 0, 1),
93
+ new Among("elig", 1, 1), new Among("els", -1, 1),
94
+ new Among("l\u00F8st", -1, 2)
95
+ ],
96
+ g_v = [17, 65, 16, 1, 0, 0, 0, 0,
97
+ 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128
98
+ ],
99
+ g_s_ending = [239, 254, 42, 3,
100
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16
101
+ ],
102
+ I_x, I_p1, S_ch, sbp = new SnowballProgram();
103
+ this.setCurrent = function(word) {
104
+ sbp.setCurrent(word);
105
+ };
106
+ this.getCurrent = function() {
107
+ return sbp.getCurrent();
108
+ };
109
+
110
+ function r_mark_regions() {
111
+ var v_1, c = sbp.cursor + 3;
112
+ I_p1 = sbp.limit;
113
+ if (0 <= c && c <= sbp.limit) {
114
+ I_x = c;
115
+ while (true) {
116
+ v_1 = sbp.cursor;
117
+ if (sbp.in_grouping(g_v, 97, 248)) {
118
+ sbp.cursor = v_1;
119
+ break;
120
+ }
121
+ sbp.cursor = v_1;
122
+ if (v_1 >= sbp.limit)
123
+ return;
124
+ sbp.cursor++;
125
+ }
126
+ while (!sbp.out_grouping(g_v, 97, 248)) {
127
+ if (sbp.cursor >= sbp.limit)
128
+ return;
129
+ sbp.cursor++;
130
+ }
131
+ I_p1 = sbp.cursor;
132
+ if (I_p1 < I_x)
133
+ I_p1 = I_x;
134
+ }
135
+ }
136
+
137
+ function r_main_suffix() {
138
+ var among_var, v_1;
139
+ if (sbp.cursor >= I_p1) {
140
+ v_1 = sbp.limit_backward;
141
+ sbp.limit_backward = I_p1;
142
+ sbp.ket = sbp.cursor;
143
+ among_var = sbp.find_among_b(a_0, 32);
144
+ sbp.limit_backward = v_1;
145
+ if (among_var) {
146
+ sbp.bra = sbp.cursor;
147
+ switch (among_var) {
148
+ case 1:
149
+ sbp.slice_del();
150
+ break;
151
+ case 2:
152
+ if (sbp.in_grouping_b(g_s_ending, 97, 229))
153
+ sbp.slice_del();
154
+ break;
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ function r_consonant_pair() {
161
+ var v_1 = sbp.limit - sbp.cursor,
162
+ v_2;
163
+ if (sbp.cursor >= I_p1) {
164
+ v_2 = sbp.limit_backward;
165
+ sbp.limit_backward = I_p1;
166
+ sbp.ket = sbp.cursor;
167
+ if (sbp.find_among_b(a_1, 4)) {
168
+ sbp.bra = sbp.cursor;
169
+ sbp.limit_backward = v_2;
170
+ sbp.cursor = sbp.limit - v_1;
171
+ if (sbp.cursor > sbp.limit_backward) {
172
+ sbp.cursor--;
173
+ sbp.bra = sbp.cursor;
174
+ sbp.slice_del();
175
+ }
176
+ } else
177
+ sbp.limit_backward = v_2;
178
+ }
179
+ }
180
+
181
+ function r_other_suffix() {
182
+ var among_var, v_1 = sbp.limit - sbp.cursor,
183
+ v_2, v_3;
184
+ sbp.ket = sbp.cursor;
185
+ if (sbp.eq_s_b(2, "st")) {
186
+ sbp.bra = sbp.cursor;
187
+ if (sbp.eq_s_b(2, "ig"))
188
+ sbp.slice_del();
189
+ }
190
+ sbp.cursor = sbp.limit - v_1;
191
+ if (sbp.cursor >= I_p1) {
192
+ v_2 = sbp.limit_backward;
193
+ sbp.limit_backward = I_p1;
194
+ sbp.ket = sbp.cursor;
195
+ among_var = sbp.find_among_b(a_2, 5);
196
+ sbp.limit_backward = v_2;
197
+ if (among_var) {
198
+ sbp.bra = sbp.cursor;
199
+ switch (among_var) {
200
+ case 1:
201
+ sbp.slice_del();
202
+ v_3 = sbp.limit - sbp.cursor;
203
+ r_consonant_pair();
204
+ sbp.cursor = sbp.limit - v_3;
205
+ break;
206
+ case 2:
207
+ sbp.slice_from("l\u00F8s");
208
+ break;
209
+ }
210
+ }
211
+ }
212
+ }
213
+
214
+ function r_undouble() {
215
+ var v_1;
216
+ if (sbp.cursor >= I_p1) {
217
+ v_1 = sbp.limit_backward;
218
+ sbp.limit_backward = I_p1;
219
+ sbp.ket = sbp.cursor;
220
+ if (sbp.out_grouping_b(g_v, 97, 248)) {
221
+ sbp.bra = sbp.cursor;
222
+ S_ch = sbp.slice_to(S_ch);
223
+ sbp.limit_backward = v_1;
224
+ if (sbp.eq_v_b(S_ch))
225
+ sbp.slice_del();
226
+ } else
227
+ sbp.limit_backward = v_1;
228
+ }
229
+ }
230
+ this.stem = function() {
231
+ var v_1 = sbp.cursor;
232
+ r_mark_regions();
233
+ sbp.limit_backward = v_1;
234
+ sbp.cursor = sbp.limit;
235
+ r_main_suffix();
236
+ sbp.cursor = sbp.limit;
237
+ r_consonant_pair();
238
+ sbp.cursor = sbp.limit;
239
+ r_other_suffix();
240
+ sbp.cursor = sbp.limit;
241
+ r_undouble();
242
+ return true;
243
+ }
244
+ };
245
+
246
+ /* and return a function that stems a word for the current locale */
247
+ return function(word) {
248
+ st.setCurrent(word);
249
+ st.stem();
250
+ return st.getCurrent();
251
+ }
252
+ })();
253
+
254
+ lunr.Pipeline.registerFunction(lunr.da.stemmer, 'stemmer-da');
255
+
256
+ /* stop word filter function */
257
+ lunr.da.stopWordFilter = function(token) {
258
+ if (lunr.da.stopWordFilter.stopWords.indexOf(token) === -1) {
259
+ return token;
260
+ }
261
+ };
262
+
263
+ lunr.da.stopWordFilter.stopWords = new lunr.SortedSet();
264
+ lunr.da.stopWordFilter.stopWords.length = 95;
265
+
266
+ // The space at the beginning is crucial: It marks the empty string
267
+ // as a stop word. lunr.js crashes during search when documents
268
+ // processed by the pipeline still contain the empty string.
269
+ lunr.da.stopWordFilter.stopWords.elements = ' ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været'.split(' ');
270
+
271
+ lunr.Pipeline.registerFunction(lunr.da.stopWordFilter, 'stopWordFilter-da');
272
+ };
273
+ }))
@@ -0,0 +1,373 @@
1
+ /*!
2
+ * Lunr languages, `German` 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.de = function() {
57
+ this.pipeline.reset();
58
+ this.pipeline.add(
59
+ lunr.de.stopWordFilter,
60
+ lunr.de.stemmer
61
+ );
62
+ };
63
+
64
+ /* lunr stemmer function */
65
+ lunr.de.stemmer = (function() {
66
+ /* create the wrapped stemmer object */
67
+ var Among = lunr.stemmerSupport.Among,
68
+ SnowballProgram = lunr.stemmerSupport.SnowballProgram,
69
+ st = new function GermanStemmer() {
70
+ var a_0 = [new Among("", -1, 6), new Among("U", 0, 2),
71
+ new Among("Y", 0, 1), new Among("\u00E4", 0, 3),
72
+ new Among("\u00F6", 0, 4), new Among("\u00FC", 0, 5)
73
+ ],
74
+ a_1 = [
75
+ new Among("e", -1, 2), new Among("em", -1, 1),
76
+ new Among("en", -1, 2), new Among("ern", -1, 1),
77
+ new Among("er", -1, 1), new Among("s", -1, 3),
78
+ new Among("es", 5, 2)
79
+ ],
80
+ a_2 = [new Among("en", -1, 1),
81
+ new Among("er", -1, 1), new Among("st", -1, 2),
82
+ new Among("est", 2, 1)
83
+ ],
84
+ a_3 = [new Among("ig", -1, 1),
85
+ new Among("lich", -1, 1)
86
+ ],
87
+ a_4 = [new Among("end", -1, 1),
88
+ new Among("ig", -1, 2), new Among("ung", -1, 1),
89
+ new Among("lich", -1, 3), new Among("isch", -1, 2),
90
+ new Among("ik", -1, 2), new Among("heit", -1, 3),
91
+ new Among("keit", -1, 4)
92
+ ],
93
+ g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0,
94
+ 0, 0, 0, 0, 0, 0, 8, 0, 32, 8
95
+ ],
96
+ g_s_ending = [117, 30, 5],
97
+ g_st_ending = [
98
+ 117, 30, 4
99
+ ],
100
+ I_x, I_p2, I_p1, sbp = new SnowballProgram();
101
+ this.setCurrent = function(word) {
102
+ sbp.setCurrent(word);
103
+ };
104
+ this.getCurrent = function() {
105
+ return sbp.getCurrent();
106
+ };
107
+
108
+ function habr1(c1, c2, v_1) {
109
+ if (sbp.eq_s(1, c1)) {
110
+ sbp.ket = sbp.cursor;
111
+ if (sbp.in_grouping(g_v, 97, 252)) {
112
+ sbp.slice_from(c2);
113
+ sbp.cursor = v_1;
114
+ return true;
115
+ }
116
+ }
117
+ return false;
118
+ }
119
+
120
+ function r_prelude() {
121
+ var v_1 = sbp.cursor,
122
+ v_2, v_3, v_4, v_5;
123
+ while (true) {
124
+ v_2 = sbp.cursor;
125
+ sbp.bra = v_2;
126
+ if (sbp.eq_s(1, "\u00DF")) {
127
+ sbp.ket = sbp.cursor;
128
+ sbp.slice_from("ss");
129
+ } else {
130
+ if (v_2 >= sbp.limit)
131
+ break;
132
+ sbp.cursor = v_2 + 1;
133
+ }
134
+ }
135
+ sbp.cursor = v_1;
136
+ while (true) {
137
+ v_3 = sbp.cursor;
138
+ while (true) {
139
+ v_4 = sbp.cursor;
140
+ if (sbp.in_grouping(g_v, 97, 252)) {
141
+ v_5 = sbp.cursor;
142
+ sbp.bra = v_5;
143
+ if (habr1("u", "U", v_4))
144
+ break;
145
+ sbp.cursor = v_5;
146
+ if (habr1("y", "Y", v_4))
147
+ break;
148
+ }
149
+ if (v_4 >= sbp.limit) {
150
+ sbp.cursor = v_3;
151
+ return;
152
+ }
153
+ sbp.cursor = v_4 + 1;
154
+ }
155
+ }
156
+ }
157
+
158
+ function habr2() {
159
+ while (!sbp.in_grouping(g_v, 97, 252)) {
160
+ if (sbp.cursor >= sbp.limit)
161
+ return true;
162
+ sbp.cursor++;
163
+ }
164
+ while (!sbp.out_grouping(g_v, 97, 252)) {
165
+ if (sbp.cursor >= sbp.limit)
166
+ return true;
167
+ sbp.cursor++;
168
+ }
169
+ return false;
170
+ }
171
+
172
+ function r_mark_regions() {
173
+ I_p1 = sbp.limit;
174
+ I_p2 = I_p1;
175
+ var c = sbp.cursor + 3;
176
+ if (0 <= c && c <= sbp.limit) {
177
+ I_x = c;
178
+ if (!habr2()) {
179
+ I_p1 = sbp.cursor;
180
+ if (I_p1 < I_x)
181
+ I_p1 = I_x;
182
+ if (!habr2())
183
+ I_p2 = sbp.cursor;
184
+ }
185
+ }
186
+ }
187
+
188
+ function r_postlude() {
189
+ var among_var, v_1;
190
+ while (true) {
191
+ v_1 = sbp.cursor;
192
+ sbp.bra = v_1;
193
+ among_var = sbp.find_among(a_0, 6);
194
+ if (!among_var)
195
+ return;
196
+ sbp.ket = sbp.cursor;
197
+ switch (among_var) {
198
+ case 1:
199
+ sbp.slice_from("y");
200
+ break;
201
+ case 2:
202
+ case 5:
203
+ sbp.slice_from("u");
204
+ break;
205
+ case 3:
206
+ sbp.slice_from("a");
207
+ break;
208
+ case 4:
209
+ sbp.slice_from("o");
210
+ break;
211
+ case 6:
212
+ if (sbp.cursor >= sbp.limit)
213
+ return;
214
+ sbp.cursor++;
215
+ break;
216
+ }
217
+ }
218
+ }
219
+
220
+ function r_R1() {
221
+ return I_p1 <= sbp.cursor;
222
+ }
223
+
224
+ function r_R2() {
225
+ return I_p2 <= sbp.cursor;
226
+ }
227
+
228
+ function r_standard_suffix() {
229
+ var among_var, v_1 = sbp.limit - sbp.cursor,
230
+ v_2, v_3, v_4;
231
+ sbp.ket = sbp.cursor;
232
+ among_var = sbp.find_among_b(a_1, 7);
233
+ if (among_var) {
234
+ sbp.bra = sbp.cursor;
235
+ if (r_R1()) {
236
+ switch (among_var) {
237
+ case 1:
238
+ sbp.slice_del();
239
+ break;
240
+ case 2:
241
+ sbp.slice_del();
242
+ sbp.ket = sbp.cursor;
243
+ if (sbp.eq_s_b(1, "s")) {
244
+ sbp.bra = sbp.cursor;
245
+ if (sbp.eq_s_b(3, "nis"))
246
+ sbp.slice_del();
247
+ }
248
+ break;
249
+ case 3:
250
+ if (sbp.in_grouping_b(g_s_ending, 98, 116))
251
+ sbp.slice_del();
252
+ break;
253
+ }
254
+ }
255
+ }
256
+ sbp.cursor = sbp.limit - v_1;
257
+ sbp.ket = sbp.cursor;
258
+ among_var = sbp.find_among_b(a_2, 4);
259
+ if (among_var) {
260
+ sbp.bra = sbp.cursor;
261
+ if (r_R1()) {
262
+ switch (among_var) {
263
+ case 1:
264
+ sbp.slice_del();
265
+ break;
266
+ case 2:
267
+ if (sbp.in_grouping_b(g_st_ending, 98, 116)) {
268
+ var c = sbp.cursor - 3;
269
+ if (sbp.limit_backward <= c && c <= sbp.limit) {
270
+ sbp.cursor = c;
271
+ sbp.slice_del();
272
+ }
273
+ }
274
+ break;
275
+ }
276
+ }
277
+ }
278
+ sbp.cursor = sbp.limit - v_1;
279
+ sbp.ket = sbp.cursor;
280
+ among_var = sbp.find_among_b(a_4, 8);
281
+ if (among_var) {
282
+ sbp.bra = sbp.cursor;
283
+ if (r_R2()) {
284
+ switch (among_var) {
285
+ case 1:
286
+ sbp.slice_del();
287
+ sbp.ket = sbp.cursor;
288
+ if (sbp.eq_s_b(2, "ig")) {
289
+ sbp.bra = sbp.cursor;
290
+ v_2 = sbp.limit - sbp.cursor;
291
+ if (!sbp.eq_s_b(1, "e")) {
292
+ sbp.cursor = sbp.limit - v_2;
293
+ if (r_R2())
294
+ sbp.slice_del();
295
+ }
296
+ }
297
+ break;
298
+ case 2:
299
+ v_3 = sbp.limit - sbp.cursor;
300
+ if (!sbp.eq_s_b(1, "e")) {
301
+ sbp.cursor = sbp.limit - v_3;
302
+ sbp.slice_del();
303
+ }
304
+ break;
305
+ case 3:
306
+ sbp.slice_del();
307
+ sbp.ket = sbp.cursor;
308
+ v_4 = sbp.limit - sbp.cursor;
309
+ if (!sbp.eq_s_b(2, "er")) {
310
+ sbp.cursor = sbp.limit - v_4;
311
+ if (!sbp.eq_s_b(2, "en"))
312
+ break;
313
+ }
314
+ sbp.bra = sbp.cursor;
315
+ if (r_R1())
316
+ sbp.slice_del();
317
+ break;
318
+ case 4:
319
+ sbp.slice_del();
320
+ sbp.ket = sbp.cursor;
321
+ among_var = sbp.find_among_b(a_3, 2);
322
+ if (among_var) {
323
+ sbp.bra = sbp.cursor;
324
+ if (r_R2() && among_var == 1)
325
+ sbp.slice_del();
326
+ }
327
+ break;
328
+ }
329
+ }
330
+ }
331
+ }
332
+ this.stem = function() {
333
+ var v_1 = sbp.cursor;
334
+ r_prelude();
335
+ sbp.cursor = v_1;
336
+ r_mark_regions();
337
+ sbp.limit_backward = v_1;
338
+ sbp.cursor = sbp.limit;
339
+ r_standard_suffix();
340
+ sbp.cursor = sbp.limit_backward;
341
+ r_postlude();
342
+ return true;
343
+ }
344
+ };
345
+
346
+ /* and return a function that stems a word for the current locale */
347
+ return function(word) {
348
+ st.setCurrent(word);
349
+ st.stem();
350
+ return st.getCurrent();
351
+ }
352
+ })();
353
+
354
+ lunr.Pipeline.registerFunction(lunr.de.stemmer, 'stemmer-de');
355
+
356
+ /* stop word filter function */
357
+ lunr.de.stopWordFilter = function(token) {
358
+ if (lunr.de.stopWordFilter.stopWords.indexOf(token) === -1) {
359
+ return token;
360
+ }
361
+ };
362
+
363
+ lunr.de.stopWordFilter.stopWords = new lunr.SortedSet();
364
+ lunr.de.stopWordFilter.stopWords.length = 232;
365
+
366
+ // The space at the beginning is crucial: It marks the empty string
367
+ // as a stop word. lunr.js crashes during search when documents
368
+ // processed by the pipeline still contain the empty string.
369
+ lunr.de.stopWordFilter.stopWords.elements = ' aber alle allem allen aller alles als also am an ander andere anderem anderen anderer anderes anderm andern anderr anders auch auf aus bei bin bis bist da damit dann das dasselbe dazu daß dein deine deinem deinen deiner deines dem demselben den denn denselben der derer derselbe derselben des desselben dessen dich die dies diese dieselbe dieselben diesem diesen dieser dieses dir doch dort du durch ein eine einem einen einer eines einig einige einigem einigen einiger einiges einmal er es etwas euch euer eure eurem euren eurer eures für gegen gewesen hab habe haben hat hatte hatten hier hin hinter ich ihm ihn ihnen ihr ihre ihrem ihren ihrer ihres im in indem ins ist jede jedem jeden jeder jedes jene jenem jenen jener jenes jetzt kann kein keine keinem keinen keiner keines können könnte machen man manche manchem manchen mancher manches mein meine meinem meinen meiner meines mich mir mit muss musste nach nicht nichts noch nun nur ob oder ohne sehr sein seine seinem seinen seiner seines selbst sich sie sind so solche solchem solchen solcher solches soll sollte sondern sonst um und uns unse unsem unsen unser unses unter viel vom von vor war waren warst was weg weil weiter welche welchem welchen welcher welches wenn werde werden wie wieder will wir wird wirst wo wollen wollte während würde würden zu zum zur zwar zwischen über'.split(' ');
370
+
371
+ lunr.Pipeline.registerFunction(lunr.de.stopWordFilter, 'stopWordFilter-de');
372
+ };
373
+ }))