Initial import into git.
[galago.git] / java / galago / src / org / tartarus / snowball / ext / germanStemmer.java
blob6859e843612f788e7a53119834b6e7ec2266266c
1 // This file was generated automatically by the Snowball to Java compiler
3 package org.tartarus.snowball.ext;
4 import org.tartarus.snowball.SnowballProgram;
5 import org.tartarus.snowball.Among;
7 /**
8 * Generated class implementing code defined by a snowball script.
9 */
10 public class germanStemmer extends SnowballProgram {
12 private Among a_0[] = {
13 new Among ( "", -1, 6, "", this),
14 new Among ( "U", 0, 2, "", this),
15 new Among ( "Y", 0, 1, "", this),
16 new Among ( "\u00E4", 0, 3, "", this),
17 new Among ( "\u00F6", 0, 4, "", this),
18 new Among ( "\u00FC", 0, 5, "", this)
21 private Among a_1[] = {
22 new Among ( "e", -1, 1, "", this),
23 new Among ( "em", -1, 1, "", this),
24 new Among ( "en", -1, 1, "", this),
25 new Among ( "ern", -1, 1, "", this),
26 new Among ( "er", -1, 1, "", this),
27 new Among ( "s", -1, 2, "", this),
28 new Among ( "es", 5, 1, "", this)
31 private Among a_2[] = {
32 new Among ( "en", -1, 1, "", this),
33 new Among ( "er", -1, 1, "", this),
34 new Among ( "st", -1, 2, "", this),
35 new Among ( "est", 2, 1, "", this)
38 private Among a_3[] = {
39 new Among ( "ig", -1, 1, "", this),
40 new Among ( "lich", -1, 1, "", this)
43 private Among a_4[] = {
44 new Among ( "end", -1, 1, "", this),
45 new Among ( "ig", -1, 2, "", this),
46 new Among ( "ung", -1, 1, "", this),
47 new Among ( "lich", -1, 3, "", this),
48 new Among ( "isch", -1, 2, "", this),
49 new Among ( "ik", -1, 2, "", this),
50 new Among ( "heit", -1, 3, "", this),
51 new Among ( "keit", -1, 4, "", this)
54 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 };
56 private static final char g_s_ending[] = {117, 30, 5 };
58 private static final char g_st_ending[] = {117, 30, 4 };
60 private int I_x;
61 private int I_p2;
62 private int I_p1;
64 private void copy_from(germanStemmer other) {
65 I_x = other.I_x;
66 I_p2 = other.I_p2;
67 I_p1 = other.I_p1;
68 super.copy_from(other);
71 private boolean r_prelude() {
72 int v_1;
73 int v_2;
74 int v_3;
75 int v_4;
76 int v_5;
77 int v_6;
78 // (, line 28
79 // test, line 30
80 v_1 = cursor;
81 // repeat, line 30
82 replab0: while(true)
84 v_2 = cursor;
85 lab1: do {
86 // (, line 30
87 // or, line 33
88 lab2: do {
89 v_3 = cursor;
90 lab3: do {
91 // (, line 31
92 // [, line 32
93 bra = cursor;
94 // literal, line 32
95 if (!(eq_s(1, "\u00DF")))
97 break lab3;
99 // ], line 32
100 ket = cursor;
101 // <-, line 32
102 slice_from("ss");
103 break lab2;
104 } while (false);
105 cursor = v_3;
106 // next, line 33
107 if (cursor >= limit)
109 break lab1;
111 cursor++;
112 } while (false);
113 continue replab0;
114 } while (false);
115 cursor = v_2;
116 break replab0;
118 cursor = v_1;
119 // repeat, line 36
120 replab4: while(true)
122 v_4 = cursor;
123 lab5: do {
124 // goto, line 36
125 golab6: while(true)
127 v_5 = cursor;
128 lab7: do {
129 // (, line 36
130 if (!(in_grouping(g_v, 97, 252)))
132 break lab7;
134 // [, line 37
135 bra = cursor;
136 // or, line 37
137 lab8: do {
138 v_6 = cursor;
139 lab9: do {
140 // (, line 37
141 // literal, line 37
142 if (!(eq_s(1, "u")))
144 break lab9;
146 // ], line 37
147 ket = cursor;
148 if (!(in_grouping(g_v, 97, 252)))
150 break lab9;
152 // <-, line 37
153 slice_from("U");
154 break lab8;
155 } while (false);
156 cursor = v_6;
157 // (, line 38
158 // literal, line 38
159 if (!(eq_s(1, "y")))
161 break lab7;
163 // ], line 38
164 ket = cursor;
165 if (!(in_grouping(g_v, 97, 252)))
167 break lab7;
169 // <-, line 38
170 slice_from("Y");
171 } while (false);
172 cursor = v_5;
173 break golab6;
174 } while (false);
175 cursor = v_5;
176 if (cursor >= limit)
178 break lab5;
180 cursor++;
182 continue replab4;
183 } while (false);
184 cursor = v_4;
185 break replab4;
187 return true;
190 private boolean r_mark_regions() {
191 int v_1;
192 // (, line 42
193 I_p1 = limit;
194 I_p2 = limit;
195 // test, line 47
196 v_1 = cursor;
197 // (, line 47
198 // hop, line 47
200 int c = cursor + 3;
201 if (0 > c || c > limit)
203 return false;
205 cursor = c;
207 // setmark x, line 47
208 I_x = cursor;
209 cursor = v_1;
210 // gopast, line 49
211 golab0: while(true)
213 lab1: do {
214 if (!(in_grouping(g_v, 97, 252)))
216 break lab1;
218 break golab0;
219 } while (false);
220 if (cursor >= limit)
222 return false;
224 cursor++;
226 // gopast, line 49
227 golab2: while(true)
229 lab3: do {
230 if (!(out_grouping(g_v, 97, 252)))
232 break lab3;
234 break golab2;
235 } while (false);
236 if (cursor >= limit)
238 return false;
240 cursor++;
242 // setmark p1, line 49
243 I_p1 = cursor;
244 // try, line 50
245 lab4: do {
246 // (, line 50
247 if (!(I_p1 < I_x))
249 break lab4;
251 I_p1 = I_x;
252 } while (false);
253 // gopast, line 51
254 golab5: while(true)
256 lab6: do {
257 if (!(in_grouping(g_v, 97, 252)))
259 break lab6;
261 break golab5;
262 } while (false);
263 if (cursor >= limit)
265 return false;
267 cursor++;
269 // gopast, line 51
270 golab7: while(true)
272 lab8: do {
273 if (!(out_grouping(g_v, 97, 252)))
275 break lab8;
277 break golab7;
278 } while (false);
279 if (cursor >= limit)
281 return false;
283 cursor++;
285 // setmark p2, line 51
286 I_p2 = cursor;
287 return true;
290 private boolean r_postlude() {
291 int among_var;
292 int v_1;
293 // repeat, line 55
294 replab0: while(true)
296 v_1 = cursor;
297 lab1: do {
298 // (, line 55
299 // [, line 57
300 bra = cursor;
301 // substring, line 57
302 among_var = find_among(a_0, 6);
303 if (among_var == 0)
305 break lab1;
307 // ], line 57
308 ket = cursor;
309 switch(among_var) {
310 case 0:
311 break lab1;
312 case 1:
313 // (, line 58
314 // <-, line 58
315 slice_from("y");
316 break;
317 case 2:
318 // (, line 59
319 // <-, line 59
320 slice_from("u");
321 break;
322 case 3:
323 // (, line 60
324 // <-, line 60
325 slice_from("a");
326 break;
327 case 4:
328 // (, line 61
329 // <-, line 61
330 slice_from("o");
331 break;
332 case 5:
333 // (, line 62
334 // <-, line 62
335 slice_from("u");
336 break;
337 case 6:
338 // (, line 63
339 // next, line 63
340 if (cursor >= limit)
342 break lab1;
344 cursor++;
345 break;
347 continue replab0;
348 } while (false);
349 cursor = v_1;
350 break replab0;
352 return true;
355 private boolean r_R1() {
356 if (!(I_p1 <= cursor))
358 return false;
360 return true;
363 private boolean r_R2() {
364 if (!(I_p2 <= cursor))
366 return false;
368 return true;
371 private boolean r_standard_suffix() {
372 int among_var;
373 int v_1;
374 int v_2;
375 int v_3;
376 int v_4;
377 int v_5;
378 int v_6;
379 int v_7;
380 int v_8;
381 int v_9;
382 // (, line 73
383 // do, line 74
384 v_1 = limit - cursor;
385 lab0: do {
386 // (, line 74
387 // [, line 75
388 ket = cursor;
389 // substring, line 75
390 among_var = find_among_b(a_1, 7);
391 if (among_var == 0)
393 break lab0;
395 // ], line 75
396 bra = cursor;
397 // call R1, line 75
398 if (!r_R1())
400 break lab0;
402 switch(among_var) {
403 case 0:
404 break lab0;
405 case 1:
406 // (, line 77
407 // delete, line 77
408 slice_del();
409 break;
410 case 2:
411 // (, line 80
412 if (!(in_grouping_b(g_s_ending, 98, 116)))
414 break lab0;
416 // delete, line 80
417 slice_del();
418 break;
420 } while (false);
421 cursor = limit - v_1;
422 // do, line 84
423 v_2 = limit - cursor;
424 lab1: do {
425 // (, line 84
426 // [, line 85
427 ket = cursor;
428 // substring, line 85
429 among_var = find_among_b(a_2, 4);
430 if (among_var == 0)
432 break lab1;
434 // ], line 85
435 bra = cursor;
436 // call R1, line 85
437 if (!r_R1())
439 break lab1;
441 switch(among_var) {
442 case 0:
443 break lab1;
444 case 1:
445 // (, line 87
446 // delete, line 87
447 slice_del();
448 break;
449 case 2:
450 // (, line 90
451 if (!(in_grouping_b(g_st_ending, 98, 116)))
453 break lab1;
455 // hop, line 90
457 int c = cursor - 3;
458 if (limit_backward > c || c > limit)
460 break lab1;
462 cursor = c;
464 // delete, line 90
465 slice_del();
466 break;
468 } while (false);
469 cursor = limit - v_2;
470 // do, line 94
471 v_3 = limit - cursor;
472 lab2: do {
473 // (, line 94
474 // [, line 95
475 ket = cursor;
476 // substring, line 95
477 among_var = find_among_b(a_4, 8);
478 if (among_var == 0)
480 break lab2;
482 // ], line 95
483 bra = cursor;
484 // call R2, line 95
485 if (!r_R2())
487 break lab2;
489 switch(among_var) {
490 case 0:
491 break lab2;
492 case 1:
493 // (, line 97
494 // delete, line 97
495 slice_del();
496 // try, line 98
497 v_4 = limit - cursor;
498 lab3: do {
499 // (, line 98
500 // [, line 98
501 ket = cursor;
502 // literal, line 98
503 if (!(eq_s_b(2, "ig")))
505 cursor = limit - v_4;
506 break lab3;
508 // ], line 98
509 bra = cursor;
510 // not, line 98
512 v_5 = limit - cursor;
513 lab4: do {
514 // literal, line 98
515 if (!(eq_s_b(1, "e")))
517 break lab4;
519 cursor = limit - v_4;
520 break lab3;
521 } while (false);
522 cursor = limit - v_5;
524 // call R2, line 98
525 if (!r_R2())
527 cursor = limit - v_4;
528 break lab3;
530 // delete, line 98
531 slice_del();
532 } while (false);
533 break;
534 case 2:
535 // (, line 101
536 // not, line 101
538 v_6 = limit - cursor;
539 lab5: do {
540 // literal, line 101
541 if (!(eq_s_b(1, "e")))
543 break lab5;
545 break lab2;
546 } while (false);
547 cursor = limit - v_6;
549 // delete, line 101
550 slice_del();
551 break;
552 case 3:
553 // (, line 104
554 // delete, line 104
555 slice_del();
556 // try, line 105
557 v_7 = limit - cursor;
558 lab6: do {
559 // (, line 105
560 // [, line 106
561 ket = cursor;
562 // or, line 106
563 lab7: do {
564 v_8 = limit - cursor;
565 lab8: do {
566 // literal, line 106
567 if (!(eq_s_b(2, "er")))
569 break lab8;
571 break lab7;
572 } while (false);
573 cursor = limit - v_8;
574 // literal, line 106
575 if (!(eq_s_b(2, "en")))
577 cursor = limit - v_7;
578 break lab6;
580 } while (false);
581 // ], line 106
582 bra = cursor;
583 // call R1, line 106
584 if (!r_R1())
586 cursor = limit - v_7;
587 break lab6;
589 // delete, line 106
590 slice_del();
591 } while (false);
592 break;
593 case 4:
594 // (, line 110
595 // delete, line 110
596 slice_del();
597 // try, line 111
598 v_9 = limit - cursor;
599 lab9: do {
600 // (, line 111
601 // [, line 112
602 ket = cursor;
603 // substring, line 112
604 among_var = find_among_b(a_3, 2);
605 if (among_var == 0)
607 cursor = limit - v_9;
608 break lab9;
610 // ], line 112
611 bra = cursor;
612 // call R2, line 112
613 if (!r_R2())
615 cursor = limit - v_9;
616 break lab9;
618 switch(among_var) {
619 case 0:
620 cursor = limit - v_9;
621 break lab9;
622 case 1:
623 // (, line 114
624 // delete, line 114
625 slice_del();
626 break;
628 } while (false);
629 break;
631 } while (false);
632 cursor = limit - v_3;
633 return true;
636 public boolean stem() {
637 int v_1;
638 int v_2;
639 int v_3;
640 int v_4;
641 // (, line 124
642 // do, line 125
643 v_1 = cursor;
644 lab0: do {
645 // call prelude, line 125
646 if (!r_prelude())
648 break lab0;
650 } while (false);
651 cursor = v_1;
652 // do, line 126
653 v_2 = cursor;
654 lab1: do {
655 // call mark_regions, line 126
656 if (!r_mark_regions())
658 break lab1;
660 } while (false);
661 cursor = v_2;
662 // backwards, line 127
663 limit_backward = cursor; cursor = limit;
664 // do, line 128
665 v_3 = limit - cursor;
666 lab2: do {
667 // call standard_suffix, line 128
668 if (!r_standard_suffix())
670 break lab2;
672 } while (false);
673 cursor = limit - v_3;
674 cursor = limit_backward; // do, line 129
675 v_4 = cursor;
676 lab3: do {
677 // call postlude, line 129
678 if (!r_postlude())
680 break lab3;
682 } while (false);
683 cursor = v_4;
684 return true;