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