1 // This file was generated automatically by the Snowball to Java compiler
2
3 package org.tartarus.snowball.ext;
4
5 import org.tartarus.snowball.Among;
6
7 /***
8 * This class was automatically generated by a Snowball to Java compiler
9 * It implements the stemming algorithm defined by a snowball script.
10 */
11
12 public class germanStemmer extends org.tartarus.snowball.SnowballStemmer {
13
14 private static final long serialVersionUID = 1L;
15
16 private final static germanStemmer methodObject = new germanStemmer ();
17
18 private final static Among a_0[] = {
19 new Among ( "", -1, 6, "", methodObject ),
20 new Among ( "U", 0, 2, "", methodObject ),
21 new Among ( "Y", 0, 1, "", methodObject ),
22 new Among ( "\u00E4", 0, 3, "", methodObject ),
23 new Among ( "\u00F6", 0, 4, "", methodObject ),
24 new Among ( "\u00FC", 0, 5, "", methodObject )
25 };
26
27 private final static Among a_1[] = {
28 new Among ( "e", -1, 1, "", methodObject ),
29 new Among ( "em", -1, 1, "", methodObject ),
30 new Among ( "en", -1, 1, "", methodObject ),
31 new Among ( "ern", -1, 1, "", methodObject ),
32 new Among ( "er", -1, 1, "", methodObject ),
33 new Among ( "s", -1, 2, "", methodObject ),
34 new Among ( "es", 5, 1, "", methodObject )
35 };
36
37 private final static Among a_2[] = {
38 new Among ( "en", -1, 1, "", methodObject ),
39 new Among ( "er", -1, 1, "", methodObject ),
40 new Among ( "st", -1, 2, "", methodObject ),
41 new Among ( "est", 2, 1, "", methodObject )
42 };
43
44 private final static Among a_3[] = {
45 new Among ( "ig", -1, 1, "", methodObject ),
46 new Among ( "lich", -1, 1, "", methodObject )
47 };
48
49 private final static Among a_4[] = {
50 new Among ( "end", -1, 1, "", methodObject ),
51 new Among ( "ig", -1, 2, "", methodObject ),
52 new Among ( "ung", -1, 1, "", methodObject ),
53 new Among ( "lich", -1, 3, "", methodObject ),
54 new Among ( "isch", -1, 2, "", methodObject ),
55 new Among ( "ik", -1, 2, "", methodObject ),
56 new Among ( "heit", -1, 3, "", methodObject ),
57 new Among ( "keit", -1, 4, "", methodObject )
58 };
59
60 private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8 };
61
62 private static final char g_s_ending[] = {117, 30, 5 };
63
64 private static final char g_st_ending[] = {117, 30, 4 };
65
66 private int I_x;
67 private int I_p2;
68 private int I_p1;
69
70 private void copy_from(germanStemmer other) {
71 I_x = other.I_x;
72 I_p2 = other.I_p2;
73 I_p1 = other.I_p1;
74 super.copy_from(other);
75 }
76
77 private boolean r_prelude() {
78 int v_1;
79 int v_2;
80 int v_3;
81 int v_4;
82 int v_5;
83 int v_6;
84 // (, line 28
85 // test, line 30
86 v_1 = cursor;
87 // repeat, line 30
88 replab0: while(true)
89 {
90 v_2 = cursor;
91 lab1: do {
92 // (, line 30
93 // or, line 33
94 lab2: do {
95 v_3 = cursor;
96 lab3: do {
97 // (, line 31
98 // [, line 32
99 bra = cursor;
100 // literal, line 32
101 if (!(eq_s(1, "\u00DF")))
102 {
103 break lab3;
104 }
105 // ], line 32
106 ket = cursor;
107 // <-, line 32
108 slice_from("ss");
109 break lab2;
110 } while (false);
111 cursor = v_3;
112 // next, line 33
113 if (cursor >= limit)
114 {
115 break lab1;
116 }
117 cursor++;
118 } while (false);
119 continue replab0;
120 } while (false);
121 cursor = v_2;
122 break replab0;
123 }
124 cursor = v_1;
125 // repeat, line 36
126 replab4: while(true)
127 {
128 v_4 = cursor;
129 lab5: do {
130 // goto, line 36
131 golab6: while(true)
132 {
133 v_5 = cursor;
134 lab7: do {
135 // (, line 36
136 if (!(in_grouping(g_v, 97, 252)))
137 {
138 break lab7;
139 }
140 // [, line 37
141 bra = cursor;
142 // or, line 37
143 lab8: do {
144 v_6 = cursor;
145 lab9: do {
146 // (, line 37
147 // literal, line 37
148 if (!(eq_s(1, "u")))
149 {
150 break lab9;
151 }
152 // ], line 37
153 ket = cursor;
154 if (!(in_grouping(g_v, 97, 252)))
155 {
156 break lab9;
157 }
158 // <-, line 37
159 slice_from("U");
160 break lab8;
161 } while (false);
162 cursor = v_6;
163 // (, line 38
164 // literal, line 38
165 if (!(eq_s(1, "y")))
166 {
167 break lab7;
168 }
169 // ], line 38
170 ket = cursor;
171 if (!(in_grouping(g_v, 97, 252)))
172 {
173 break lab7;
174 }
175 // <-, line 38
176 slice_from("Y");
177 } while (false);
178 cursor = v_5;
179 break golab6;
180 } while (false);
181 cursor = v_5;
182 if (cursor >= limit)
183 {
184 break lab5;
185 }
186 cursor++;
187 }
188 continue replab4;
189 } while (false);
190 cursor = v_4;
191 break replab4;
192 }
193 return true;
194 }
195
196 private boolean r_mark_regions() {
197 int v_1;
198 // (, line 42
199 I_p1 = limit;
200 I_p2 = limit;
201 // test, line 47
202 v_1 = cursor;
203 // (, line 47
204 // hop, line 47
205 {
206 int c = cursor + 3;
207 if (0 > c || c > limit)
208 {
209 return false;
210 }
211 cursor = c;
212 }
213 // setmark x, line 47
214 I_x = cursor;
215 cursor = v_1;
216 // gopast, line 49
217 golab0: while(true)
218 {
219 lab1: do {
220 if (!(in_grouping(g_v, 97, 252)))
221 {
222 break lab1;
223 }
224 break golab0;
225 } while (false);
226 if (cursor >= limit)
227 {
228 return false;
229 }
230 cursor++;
231 }
232 // gopast, line 49
233 golab2: while(true)
234 {
235 lab3: do {
236 if (!(out_grouping(g_v, 97, 252)))
237 {
238 break lab3;
239 }
240 break golab2;
241 } while (false);
242 if (cursor >= limit)
243 {
244 return false;
245 }
246 cursor++;
247 }
248 // setmark p1, line 49
249 I_p1 = cursor;
250 // try, line 50
251 lab4: do {
252 // (, line 50
253 if (!(I_p1 < I_x))
254 {
255 break lab4;
256 }
257 I_p1 = I_x;
258 } while (false);
259 // gopast, line 51
260 golab5: while(true)
261 {
262 lab6: do {
263 if (!(in_grouping(g_v, 97, 252)))
264 {
265 break lab6;
266 }
267 break golab5;
268 } while (false);
269 if (cursor >= limit)
270 {
271 return false;
272 }
273 cursor++;
274 }
275 // gopast, line 51
276 golab7: while(true)
277 {
278 lab8: do {
279 if (!(out_grouping(g_v, 97, 252)))
280 {
281 break lab8;
282 }
283 break golab7;
284 } while (false);
285 if (cursor >= limit)
286 {
287 return false;
288 }
289 cursor++;
290 }
291 // setmark p2, line 51
292 I_p2 = cursor;
293 return true;
294 }
295
296 private boolean r_postlude() {
297 int among_var;
298 int v_1;
299 // repeat, line 55
300 replab0: while(true)
301 {
302 v_1 = cursor;
303 lab1: do {
304 // (, line 55
305 // [, line 57
306 bra = cursor;
307 // substring, line 57
308 among_var = find_among(a_0, 6);
309 if (among_var == 0)
310 {
311 break lab1;
312 }
313 // ], line 57
314 ket = cursor;
315 switch(among_var) {
316 case 0:
317 break lab1;
318 case 1:
319 // (, line 58
320 // <-, line 58
321 slice_from("y");
322 break;
323 case 2:
324 // (, line 59
325 // <-, line 59
326 slice_from("u");
327 break;
328 case 3:
329 // (, line 60
330 // <-, line 60
331 slice_from("a");
332 break;
333 case 4:
334 // (, line 61
335 // <-, line 61
336 slice_from("o");
337 break;
338 case 5:
339 // (, line 62
340 // <-, line 62
341 slice_from("u");
342 break;
343 case 6:
344 // (, line 63
345 // next, line 63
346 if (cursor >= limit)
347 {
348 break lab1;
349 }
350 cursor++;
351 break;
352 }
353 continue replab0;
354 } while (false);
355 cursor = v_1;
356 break replab0;
357 }
358 return true;
359 }
360
361 private boolean r_R1() {
362 if (!(I_p1 <= cursor))
363 {
364 return false;
365 }
366 return true;
367 }
368
369 private boolean r_R2() {
370 if (!(I_p2 <= cursor))
371 {
372 return false;
373 }
374 return true;
375 }
376
377 private boolean r_standard_suffix() {
378 int among_var;
379 int v_1;
380 int v_2;
381 int v_3;
382 int v_4;
383 int v_5;
384 int v_6;
385 int v_7;
386 int v_8;
387 int v_9;
388 // (, line 73
389 // do, line 74
390 v_1 = limit - cursor;
391 lab0: do {
392 // (, line 74
393 // [, line 75
394 ket = cursor;
395 // substring, line 75
396 among_var = find_among_b(a_1, 7);
397 if (among_var == 0)
398 {
399 break lab0;
400 }
401 // ], line 75
402 bra = cursor;
403 // call R1, line 75
404 if (!r_R1())
405 {
406 break lab0;
407 }
408 switch(among_var) {
409 case 0:
410 break lab0;
411 case 1:
412 // (, line 77
413 // delete, line 77
414 slice_del();
415 break;
416 case 2:
417 // (, line 80
418 if (!(in_grouping_b(g_s_ending, 98, 116)))
419 {
420 break lab0;
421 }
422 // delete, line 80
423 slice_del();
424 break;
425 }
426 } while (false);
427 cursor = limit - v_1;
428 // do, line 84
429 v_2 = limit - cursor;
430 lab1: do {
431 // (, line 84
432 // [, line 85
433 ket = cursor;
434 // substring, line 85
435 among_var = find_among_b(a_2, 4);
436 if (among_var == 0)
437 {
438 break lab1;
439 }
440 // ], line 85
441 bra = cursor;
442 // call R1, line 85
443 if (!r_R1())
444 {
445 break lab1;
446 }
447 switch(among_var) {
448 case 0:
449 break lab1;
450 case 1:
451 // (, line 87
452 // delete, line 87
453 slice_del();
454 break;
455 case 2:
456 // (, line 90
457 if (!(in_grouping_b(g_st_ending, 98, 116)))
458 {
459 break lab1;
460 }
461 // hop, line 90
462 {
463 int c = cursor - 3;
464 if (limit_backward > c || c > limit)
465 {
466 break lab1;
467 }
468 cursor = c;
469 }
470 // delete, line 90
471 slice_del();
472 break;
473 }
474 } while (false);
475 cursor = limit - v_2;
476 // do, line 94
477 v_3 = limit - cursor;
478 lab2: do {
479 // (, line 94
480 // [, line 95
481 ket = cursor;
482 // substring, line 95
483 among_var = find_among_b(a_4, 8);
484 if (among_var == 0)
485 {
486 break lab2;
487 }
488 // ], line 95
489 bra = cursor;
490 // call R2, line 95
491 if (!r_R2())
492 {
493 break lab2;
494 }
495 switch(among_var) {
496 case 0:
497 break lab2;
498 case 1:
499 // (, line 97
500 // delete, line 97
501 slice_del();
502 // try, line 98
503 v_4 = limit - cursor;
504 lab3: do {
505 // (, line 98
506 // [, line 98
507 ket = cursor;
508 // literal, line 98
509 if (!(eq_s_b(2, "ig")))
510 {
511 cursor = limit - v_4;
512 break lab3;
513 }
514 // ], line 98
515 bra = cursor;
516 // not, line 98
517 {
518 v_5 = limit - cursor;
519 lab4: do {
520 // literal, line 98
521 if (!(eq_s_b(1, "e")))
522 {
523 break lab4;
524 }
525 cursor = limit - v_4;
526 break lab3;
527 } while (false);
528 cursor = limit - v_5;
529 }
530 // call R2, line 98
531 if (!r_R2())
532 {
533 cursor = limit - v_4;
534 break lab3;
535 }
536 // delete, line 98
537 slice_del();
538 } while (false);
539 break;
540 case 2:
541 // (, line 101
542 // not, line 101
543 {
544 v_6 = limit - cursor;
545 lab5: do {
546 // literal, line 101
547 if (!(eq_s_b(1, "e")))
548 {
549 break lab5;
550 }
551 break lab2;
552 } while (false);
553 cursor = limit - v_6;
554 }
555 // delete, line 101
556 slice_del();
557 break;
558 case 3:
559 // (, line 104
560 // delete, line 104
561 slice_del();
562 // try, line 105
563 v_7 = limit - cursor;
564 lab6: do {
565 // (, line 105
566 // [, line 106
567 ket = cursor;
568 // or, line 106
569 lab7: do {
570 v_8 = limit - cursor;
571 lab8: do {
572 // literal, line 106
573 if (!(eq_s_b(2, "er")))
574 {
575 break lab8;
576 }
577 break lab7;
578 } while (false);
579 cursor = limit - v_8;
580 // literal, line 106
581 if (!(eq_s_b(2, "en")))
582 {
583 cursor = limit - v_7;
584 break lab6;
585 }
586 } while (false);
587 // ], line 106
588 bra = cursor;
589 // call R1, line 106
590 if (!r_R1())
591 {
592 cursor = limit - v_7;
593 break lab6;
594 }
595 // delete, line 106
596 slice_del();
597 } while (false);
598 break;
599 case 4:
600 // (, line 110
601 // delete, line 110
602 slice_del();
603 // try, line 111
604 v_9 = limit - cursor;
605 lab9: do {
606 // (, line 111
607 // [, line 112
608 ket = cursor;
609 // substring, line 112
610 among_var = find_among_b(a_3, 2);
611 if (among_var == 0)
612 {
613 cursor = limit - v_9;
614 break lab9;
615 }
616 // ], line 112
617 bra = cursor;
618 // call R2, line 112
619 if (!r_R2())
620 {
621 cursor = limit - v_9;
622 break lab9;
623 }
624 switch(among_var) {
625 case 0:
626 cursor = limit - v_9;
627 break lab9;
628 case 1:
629 // (, line 114
630 // delete, line 114
631 slice_del();
632 break;
633 }
634 } while (false);
635 break;
636 }
637 } while (false);
638 cursor = limit - v_3;
639 return true;
640 }
641
642 public boolean stem() {
643 int v_1;
644 int v_2;
645 int v_3;
646 int v_4;
647 // (, line 124
648 // do, line 125
649 v_1 = cursor;
650 lab0: do {
651 // call prelude, line 125
652 if (!r_prelude())
653 {
654 break lab0;
655 }
656 } while (false);
657 cursor = v_1;
658 // do, line 126
659 v_2 = cursor;
660 lab1: do {
661 // call mark_regions, line 126
662 if (!r_mark_regions())
663 {
664 break lab1;
665 }
666 } while (false);
667 cursor = v_2;
668 // backwards, line 127
669 limit_backward = cursor; cursor = limit;
670 // do, line 128
671 v_3 = limit - cursor;
672 lab2: do {
673 // call standard_suffix, line 128
674 if (!r_standard_suffix())
675 {
676 break lab2;
677 }
678 } while (false);
679 cursor = limit - v_3;
680 cursor = limit_backward; // do, line 129
681 v_4 = cursor;
682 lab3: do {
683 // call postlude, line 129
684 if (!r_postlude())
685 {
686 break lab3;
687 }
688 } while (false);
689 cursor = v_4;
690 return true;
691 }
692
693 public boolean equals( Object o ) {
694 return o instanceof germanStemmer;
695 }
696
697 public int hashCode() {
698 return germanStemmer.class.getName().hashCode();
699 }
700
701
702
703 }
704