xref: /Lucene/lucene/analysis/common/src/java/org/tartarus/snowball/ext/KpStemmer.java (revision 0b1d8ccba6cf394f707a09217813a25ec1504e50)
1 // Generated by Snowball 2.0.0 - https://snowballstem.org/
2 
3 package org.tartarus.snowball.ext;
4 
5 import org.tartarus.snowball.Among;
6 
7 /**
8  * This class implements the stemming algorithm defined by a snowball script.
9  *
10  * <p>Generated by Snowball 2.0.0 - https://snowballstem.org/
11  */
12 @SuppressWarnings("unused")
13 public class KpStemmer extends org.tartarus.snowball.SnowballStemmer {
14 
15   private static final long serialVersionUID = 1L;
16   private static final java.lang.invoke.MethodHandles.Lookup methodObject =
17       java.lang.invoke.MethodHandles.lookup();
18 
19   private static final Among a_0[] = {
20     new Among("nde", -1, 7),
21     new Among("en", -1, 6),
22     new Among("s", -1, 2),
23     new Among("'s", 2, 1),
24     new Among("es", 2, 4),
25     new Among("ies", 4, 3),
26     new Among("aus", 2, 5)
27   };
28 
29   private static final Among a_1[] = {
30     new Among("de", -1, 5),
31     new Among("ge", -1, 2),
32     new Among("ische", -1, 4),
33     new Among("je", -1, 1),
34     new Among("lijke", -1, 3),
35     new Among("le", -1, 9),
36     new Among("ene", -1, 10),
37     new Among("re", -1, 8),
38     new Among("se", -1, 7),
39     new Among("te", -1, 6),
40     new Among("ieve", -1, 11)
41   };
42 
43   private static final Among a_2[] = {
44     new Among("heid", -1, 3),
45     new Among("fie", -1, 6),
46     new Among("gie", -1, 7),
47     new Among("atie", -1, 1),
48     new Among("isme", -1, 2),
49     new Among("ing", -1, 2),
50     new Among("arij", -1, 5),
51     new Among("erij", -1, 2),
52     new Among("sel", -1, 3),
53     new Among("rder", -1, 4),
54     new Among("ster", -1, 3),
55     new Among("iteit", -1, 2),
56     new Among("dst", -1, 9),
57     new Among("tst", -1, 8)
58   };
59 
60   private static final Among a_3[] = {
61     new Among("end", -1, 9),
62     new Among("atief", -1, 2),
63     new Among("erig", -1, 9),
64     new Among("achtig", -1, 3),
65     new Among("ioneel", -1, 1),
66     new Among("baar", -1, 3),
67     new Among("laar", -1, 5),
68     new Among("naar", -1, 4),
69     new Among("raar", -1, 6),
70     new Among("eriger", -1, 9),
71     new Among("achtiger", -1, 3),
72     new Among("lijker", -1, 8),
73     new Among("tant", -1, 7),
74     new Among("erigst", -1, 9),
75     new Among("achtigst", -1, 3),
76     new Among("lijkst", -1, 8)
77   };
78 
79   private static final Among a_4[] = {
80     new Among("ig", -1, 1), new Among("iger", -1, 1), new Among("igst", -1, 1)
81   };
82 
83   private static final Among a_5[] = {
84     new Among("ft", -1, 2), new Among("kt", -1, 1), new Among("pt", -1, 3)
85   };
86 
87   private static final Among a_6[] = {
88     new Among("bb", -1, 1),
89     new Among("cc", -1, 2),
90     new Among("dd", -1, 3),
91     new Among("ff", -1, 4),
92     new Among("gg", -1, 5),
93     new Among("hh", -1, 6),
94     new Among("jj", -1, 7),
95     new Among("kk", -1, 8),
96     new Among("ll", -1, 9),
97     new Among("mm", -1, 10),
98     new Among("nn", -1, 11),
99     new Among("pp", -1, 12),
100     new Among("qq", -1, 13),
101     new Among("rr", -1, 14),
102     new Among("ss", -1, 15),
103     new Among("tt", -1, 16),
104     new Among("v", -1, 4),
105     new Among("vv", 16, 17),
106     new Among("ww", -1, 18),
107     new Among("xx", -1, 19),
108     new Among("z", -1, 15),
109     new Among("zz", 20, 20)
110   };
111 
112   private static final Among a_7[] = {new Among("d", -1, 1), new Among("t", -1, 2)};
113 
114   private static final char g_v[] = {17, 65, 16, 1};
115 
116   private static final char g_v_WX[] = {17, 65, 208, 1};
117 
118   private static final char g_AOU[] = {1, 64, 16};
119 
120   private static final char g_AIOU[] = {1, 65, 16};
121 
122   private boolean B_GE_removed;
123   private boolean B_stemmed;
124   private boolean B_Y_found;
125   private int I_p2;
126   private int I_p1;
127   private java.lang.StringBuilder S_ch = new java.lang.StringBuilder();
128 
r_R1()129   private boolean r_R1() {
130     if (!(I_p1 <= cursor)) {
131       return false;
132     }
133     return true;
134   }
135 
r_R2()136   private boolean r_R2() {
137     if (!(I_p2 <= cursor)) {
138       return false;
139     }
140     return true;
141   }
142 
r_V()143   private boolean r_V() {
144     int v_1 = limit - cursor;
145     lab0:
146     {
147       int v_2 = limit - cursor;
148       lab1:
149       {
150         if (!(in_grouping_b(g_v, 97, 121))) {
151           break lab1;
152         }
153         break lab0;
154       }
155       cursor = limit - v_2;
156       if (!(eq_s_b("ij"))) {
157         return false;
158       }
159     }
160     cursor = limit - v_1;
161     return true;
162   }
163 
r_VX()164   private boolean r_VX() {
165     int v_1 = limit - cursor;
166     if (cursor <= limit_backward) {
167       return false;
168     }
169     cursor--;
170     lab0:
171     {
172       int v_2 = limit - cursor;
173       lab1:
174       {
175         if (!(in_grouping_b(g_v, 97, 121))) {
176           break lab1;
177         }
178         break lab0;
179       }
180       cursor = limit - v_2;
181       if (!(eq_s_b("ij"))) {
182         return false;
183       }
184     }
185     cursor = limit - v_1;
186     return true;
187   }
188 
r_C()189   private boolean r_C() {
190     int v_1 = limit - cursor;
191     {
192       int v_2 = limit - cursor;
193       lab0:
194       {
195         if (!(eq_s_b("ij"))) {
196           break lab0;
197         }
198         return false;
199       }
200       cursor = limit - v_2;
201     }
202     if (!(out_grouping_b(g_v, 97, 121))) {
203       return false;
204     }
205     cursor = limit - v_1;
206     return true;
207   }
208 
r_lengthen_V()209   private boolean r_lengthen_V() {
210     int v_1 = limit - cursor;
211     lab0:
212     {
213       if (!(out_grouping_b(g_v_WX, 97, 121))) {
214         break lab0;
215       }
216       ket = cursor;
217       lab1:
218       {
219         int v_2 = limit - cursor;
220         lab2:
221         {
222           if (!(in_grouping_b(g_AOU, 97, 117))) {
223             break lab2;
224           }
225           bra = cursor;
226           int v_3 = limit - cursor;
227           lab3:
228           {
229             int v_4 = limit - cursor;
230             lab4:
231             {
232               if (!(out_grouping_b(g_v, 97, 121))) {
233                 break lab4;
234               }
235               break lab3;
236             }
237             cursor = limit - v_4;
238             if (cursor > limit_backward) {
239               break lab2;
240             }
241           }
242           cursor = limit - v_3;
243           break lab1;
244         }
245         cursor = limit - v_2;
246         if (!(eq_s_b("e"))) {
247           break lab0;
248         }
249         bra = cursor;
250         int v_5 = limit - cursor;
251         lab5:
252         {
253           int v_6 = limit - cursor;
254           lab6:
255           {
256             if (!(out_grouping_b(g_v, 97, 121))) {
257               break lab6;
258             }
259             break lab5;
260           }
261           cursor = limit - v_6;
262           if (cursor > limit_backward) {
263             break lab0;
264           }
265         }
266         {
267           int v_7 = limit - cursor;
268           lab7:
269           {
270             if (!(in_grouping_b(g_AIOU, 97, 117))) {
271               break lab7;
272             }
273             break lab0;
274           }
275           cursor = limit - v_7;
276         }
277         {
278           int v_8 = limit - cursor;
279           lab8:
280           {
281             if (cursor <= limit_backward) {
282               break lab8;
283             }
284             cursor--;
285             if (!(in_grouping_b(g_AIOU, 97, 117))) {
286               break lab8;
287             }
288             if (!(out_grouping_b(g_v, 97, 121))) {
289               break lab8;
290             }
291             break lab0;
292           }
293           cursor = limit - v_8;
294         }
295         cursor = limit - v_5;
296       }
297       slice_to(S_ch);
298       {
299         int c = cursor;
300         insert(cursor, cursor, S_ch);
301         cursor = c;
302       }
303     }
304     cursor = limit - v_1;
305     return true;
306   }
307 
r_Step_1()308   private boolean r_Step_1() {
309     int among_var;
310     ket = cursor;
311     among_var = find_among_b(a_0);
312     if (among_var == 0) {
313       return false;
314     }
315     bra = cursor;
316     switch (among_var) {
317       case 1:
318         slice_del();
319         break;
320       case 2:
321         if (!r_R1()) {
322           return false;
323         }
324         {
325           int v_1 = limit - cursor;
326           lab0:
327           {
328             if (!(eq_s_b("t"))) {
329               break lab0;
330             }
331             if (!r_R1()) {
332               break lab0;
333             }
334             return false;
335           }
336           cursor = limit - v_1;
337         }
338         if (!r_C()) {
339           return false;
340         }
341         slice_del();
342         break;
343       case 3:
344         if (!r_R1()) {
345           return false;
346         }
347         slice_from("ie");
348         break;
349       case 4:
350         lab1:
351         {
352           int v_2 = limit - cursor;
353           lab2:
354           {
355             if (!(eq_s_b("ar"))) {
356               break lab2;
357             }
358             if (!r_R1()) {
359               break lab2;
360             }
361             if (!r_C()) {
362               break lab2;
363             }
364             bra = cursor;
365             slice_del();
366             if (!r_lengthen_V()) {
367               break lab2;
368             }
369             break lab1;
370           }
371           cursor = limit - v_2;
372           lab3:
373           {
374             if (!(eq_s_b("er"))) {
375               break lab3;
376             }
377             if (!r_R1()) {
378               break lab3;
379             }
380             if (!r_C()) {
381               break lab3;
382             }
383             bra = cursor;
384             slice_del();
385             break lab1;
386           }
387           cursor = limit - v_2;
388           if (!r_R1()) {
389             return false;
390           }
391           if (!r_C()) {
392             return false;
393           }
394           slice_from("e");
395         }
396         break;
397       case 5:
398         if (!r_R1()) {
399           return false;
400         }
401         if (!r_V()) {
402           return false;
403         }
404         slice_from("au");
405         break;
406       case 6:
407         lab4:
408         {
409           int v_3 = limit - cursor;
410           lab5:
411           {
412             if (!(eq_s_b("hed"))) {
413               break lab5;
414             }
415             if (!r_R1()) {
416               break lab5;
417             }
418             bra = cursor;
419             slice_from("heid");
420             break lab4;
421           }
422           cursor = limit - v_3;
423           lab6:
424           {
425             if (!(eq_s_b("nd"))) {
426               break lab6;
427             }
428             slice_del();
429             break lab4;
430           }
431           cursor = limit - v_3;
432           lab7:
433           {
434             if (!(eq_s_b("d"))) {
435               break lab7;
436             }
437             if (!r_R1()) {
438               break lab7;
439             }
440             if (!r_C()) {
441               break lab7;
442             }
443             bra = cursor;
444             slice_del();
445             break lab4;
446           }
447           cursor = limit - v_3;
448           lab8:
449           {
450             lab9:
451             {
452               int v_4 = limit - cursor;
453               lab10:
454               {
455                 if (!(eq_s_b("i"))) {
456                   break lab10;
457                 }
458                 break lab9;
459               }
460               cursor = limit - v_4;
461               if (!(eq_s_b("j"))) {
462                 break lab8;
463               }
464             }
465             if (!r_V()) {
466               break lab8;
467             }
468             slice_del();
469             break lab4;
470           }
471           cursor = limit - v_3;
472           if (!r_R1()) {
473             return false;
474           }
475           if (!r_C()) {
476             return false;
477           }
478           slice_del();
479           if (!r_lengthen_V()) {
480             return false;
481           }
482         }
483         break;
484       case 7:
485         slice_from("nd");
486         break;
487     }
488     return true;
489   }
490 
r_Step_2()491   private boolean r_Step_2() {
492     int among_var;
493     ket = cursor;
494     among_var = find_among_b(a_1);
495     if (among_var == 0) {
496       return false;
497     }
498     bra = cursor;
499     switch (among_var) {
500       case 1:
501         lab0:
502         {
503           int v_1 = limit - cursor;
504           lab1:
505           {
506             if (!(eq_s_b("'t"))) {
507               break lab1;
508             }
509             bra = cursor;
510             slice_del();
511             break lab0;
512           }
513           cursor = limit - v_1;
514           lab2:
515           {
516             if (!(eq_s_b("et"))) {
517               break lab2;
518             }
519             bra = cursor;
520             if (!r_R1()) {
521               break lab2;
522             }
523             if (!r_C()) {
524               break lab2;
525             }
526             slice_del();
527             break lab0;
528           }
529           cursor = limit - v_1;
530           lab3:
531           {
532             if (!(eq_s_b("rnt"))) {
533               break lab3;
534             }
535             bra = cursor;
536             slice_from("rn");
537             break lab0;
538           }
539           cursor = limit - v_1;
540           lab4:
541           {
542             if (!(eq_s_b("t"))) {
543               break lab4;
544             }
545             bra = cursor;
546             if (!r_R1()) {
547               break lab4;
548             }
549             if (!r_VX()) {
550               break lab4;
551             }
552             slice_del();
553             break lab0;
554           }
555           cursor = limit - v_1;
556           lab5:
557           {
558             if (!(eq_s_b("ink"))) {
559               break lab5;
560             }
561             bra = cursor;
562             slice_from("ing");
563             break lab0;
564           }
565           cursor = limit - v_1;
566           lab6:
567           {
568             if (!(eq_s_b("mp"))) {
569               break lab6;
570             }
571             bra = cursor;
572             slice_from("m");
573             break lab0;
574           }
575           cursor = limit - v_1;
576           lab7:
577           {
578             if (!(eq_s_b("'"))) {
579               break lab7;
580             }
581             bra = cursor;
582             if (!r_R1()) {
583               break lab7;
584             }
585             slice_del();
586             break lab0;
587           }
588           cursor = limit - v_1;
589           bra = cursor;
590           if (!r_R1()) {
591             return false;
592           }
593           if (!r_C()) {
594             return false;
595           }
596           slice_del();
597         }
598         break;
599       case 2:
600         if (!r_R1()) {
601           return false;
602         }
603         slice_from("g");
604         break;
605       case 3:
606         if (!r_R1()) {
607           return false;
608         }
609         slice_from("lijk");
610         break;
611       case 4:
612         if (!r_R1()) {
613           return false;
614         }
615         slice_from("isch");
616         break;
617       case 5:
618         if (!r_R1()) {
619           return false;
620         }
621         if (!r_C()) {
622           return false;
623         }
624         slice_del();
625         break;
626       case 6:
627         if (!r_R1()) {
628           return false;
629         }
630         slice_from("t");
631         break;
632       case 7:
633         if (!r_R1()) {
634           return false;
635         }
636         slice_from("s");
637         break;
638       case 8:
639         if (!r_R1()) {
640           return false;
641         }
642         slice_from("r");
643         break;
644       case 9:
645         if (!r_R1()) {
646           return false;
647         }
648         slice_del();
649         insert(cursor, cursor, "l");
650         if (!r_lengthen_V()) {
651           return false;
652         }
653         break;
654       case 10:
655         if (!r_R1()) {
656           return false;
657         }
658         if (!r_C()) {
659           return false;
660         }
661         slice_del();
662         insert(cursor, cursor, "en");
663         if (!r_lengthen_V()) {
664           return false;
665         }
666         break;
667       case 11:
668         if (!r_R1()) {
669           return false;
670         }
671         if (!r_C()) {
672           return false;
673         }
674         slice_from("ief");
675         break;
676     }
677     return true;
678   }
679 
r_Step_3()680   private boolean r_Step_3() {
681     int among_var;
682     ket = cursor;
683     among_var = find_among_b(a_2);
684     if (among_var == 0) {
685       return false;
686     }
687     bra = cursor;
688     switch (among_var) {
689       case 1:
690         if (!r_R1()) {
691           return false;
692         }
693         slice_from("eer");
694         break;
695       case 2:
696         if (!r_R1()) {
697           return false;
698         }
699         slice_del();
700         if (!r_lengthen_V()) {
701           return false;
702         }
703         break;
704       case 3:
705         if (!r_R1()) {
706           return false;
707         }
708         slice_del();
709         break;
710       case 4:
711         slice_from("r");
712         break;
713       case 5:
714         if (!r_R1()) {
715           return false;
716         }
717         if (!r_C()) {
718           return false;
719         }
720         slice_from("aar");
721         break;
722       case 6:
723         if (!r_R2()) {
724           return false;
725         }
726         slice_del();
727         insert(cursor, cursor, "f");
728         if (!r_lengthen_V()) {
729           return false;
730         }
731         break;
732       case 7:
733         if (!r_R2()) {
734           return false;
735         }
736         slice_del();
737         insert(cursor, cursor, "g");
738         if (!r_lengthen_V()) {
739           return false;
740         }
741         break;
742       case 8:
743         if (!r_R1()) {
744           return false;
745         }
746         if (!r_C()) {
747           return false;
748         }
749         slice_from("t");
750         break;
751       case 9:
752         if (!r_R1()) {
753           return false;
754         }
755         if (!r_C()) {
756           return false;
757         }
758         slice_from("d");
759         break;
760     }
761     return true;
762   }
763 
r_Step_4()764   private boolean r_Step_4() {
765     int among_var;
766     lab0:
767     {
768       int v_1 = limit - cursor;
769       lab1:
770       {
771         ket = cursor;
772         among_var = find_among_b(a_3);
773         if (among_var == 0) {
774           break lab1;
775         }
776         bra = cursor;
777         switch (among_var) {
778           case 1:
779             if (!r_R1()) {
780               break lab1;
781             }
782             slice_from("ie");
783             break;
784           case 2:
785             if (!r_R1()) {
786               break lab1;
787             }
788             slice_from("eer");
789             break;
790           case 3:
791             if (!r_R1()) {
792               break lab1;
793             }
794             slice_del();
795             break;
796           case 4:
797             if (!r_R1()) {
798               break lab1;
799             }
800             if (!r_V()) {
801               break lab1;
802             }
803             slice_from("n");
804             break;
805           case 5:
806             if (!r_R1()) {
807               break lab1;
808             }
809             if (!r_V()) {
810               break lab1;
811             }
812             slice_from("l");
813             break;
814           case 6:
815             if (!r_R1()) {
816               break lab1;
817             }
818             if (!r_V()) {
819               break lab1;
820             }
821             slice_from("r");
822             break;
823           case 7:
824             if (!r_R1()) {
825               break lab1;
826             }
827             slice_from("teer");
828             break;
829           case 8:
830             if (!r_R1()) {
831               break lab1;
832             }
833             slice_from("lijk");
834             break;
835           case 9:
836             if (!r_R1()) {
837               break lab1;
838             }
839             if (!r_C()) {
840               break lab1;
841             }
842             slice_del();
843             if (!r_lengthen_V()) {
844               break lab1;
845             }
846             break;
847         }
848         break lab0;
849       }
850       cursor = limit - v_1;
851       ket = cursor;
852       if (find_among_b(a_4) == 0) {
853         return false;
854       }
855       bra = cursor;
856       if (!r_R1()) {
857         return false;
858       }
859       if (!r_C()) {
860         return false;
861       }
862       slice_del();
863       if (!r_lengthen_V()) {
864         return false;
865       }
866     }
867     return true;
868   }
869 
r_Step_7()870   private boolean r_Step_7() {
871     int among_var;
872     ket = cursor;
873     among_var = find_among_b(a_5);
874     if (among_var == 0) {
875       return false;
876     }
877     bra = cursor;
878     switch (among_var) {
879       case 1:
880         slice_from("k");
881         break;
882       case 2:
883         slice_from("f");
884         break;
885       case 3:
886         slice_from("p");
887         break;
888     }
889     return true;
890   }
891 
r_Step_6()892   private boolean r_Step_6() {
893     int among_var;
894     ket = cursor;
895     among_var = find_among_b(a_6);
896     if (among_var == 0) {
897       return false;
898     }
899     bra = cursor;
900     switch (among_var) {
901       case 1:
902         slice_from("b");
903         break;
904       case 2:
905         slice_from("c");
906         break;
907       case 3:
908         slice_from("d");
909         break;
910       case 4:
911         slice_from("f");
912         break;
913       case 5:
914         slice_from("g");
915         break;
916       case 6:
917         slice_from("h");
918         break;
919       case 7:
920         slice_from("j");
921         break;
922       case 8:
923         slice_from("k");
924         break;
925       case 9:
926         slice_from("l");
927         break;
928       case 10:
929         slice_from("m");
930         break;
931       case 11:
932         slice_from("n");
933         break;
934       case 12:
935         slice_from("p");
936         break;
937       case 13:
938         slice_from("q");
939         break;
940       case 14:
941         slice_from("r");
942         break;
943       case 15:
944         slice_from("s");
945         break;
946       case 16:
947         slice_from("t");
948         break;
949       case 17:
950         slice_from("v");
951         break;
952       case 18:
953         slice_from("w");
954         break;
955       case 19:
956         slice_from("x");
957         break;
958       case 20:
959         slice_from("z");
960         break;
961     }
962     return true;
963   }
964 
r_Step_1c()965   private boolean r_Step_1c() {
966     int among_var;
967     ket = cursor;
968     among_var = find_among_b(a_7);
969     if (among_var == 0) {
970       return false;
971     }
972     bra = cursor;
973     if (!r_R1()) {
974       return false;
975     }
976     if (!r_C()) {
977       return false;
978     }
979     switch (among_var) {
980       case 1:
981         {
982           int v_1 = limit - cursor;
983           lab0:
984           {
985             if (!(eq_s_b("n"))) {
986               break lab0;
987             }
988             if (!r_R1()) {
989               break lab0;
990             }
991             return false;
992           }
993           cursor = limit - v_1;
994         }
995         slice_del();
996         break;
997       case 2:
998         {
999           int v_2 = limit - cursor;
1000           lab1:
1001           {
1002             if (!(eq_s_b("h"))) {
1003               break lab1;
1004             }
1005             if (!r_R1()) {
1006               break lab1;
1007             }
1008             return false;
1009           }
1010           cursor = limit - v_2;
1011         }
1012         slice_del();
1013         break;
1014     }
1015     return true;
1016   }
1017 
r_Lose_prefix()1018   private boolean r_Lose_prefix() {
1019     bra = cursor;
1020     if (!(eq_s("ge"))) {
1021       return false;
1022     }
1023     ket = cursor;
1024     int v_1 = cursor;
1025     {
1026       int c = cursor + 3;
1027       if (0 > c || c > limit) {
1028         return false;
1029       }
1030       cursor = c;
1031     }
1032     cursor = v_1;
1033     golab0:
1034     while (true) {
1035       int v_2 = cursor;
1036       lab1:
1037       {
1038         if (!(in_grouping(g_v, 97, 121))) {
1039           break lab1;
1040         }
1041         cursor = v_2;
1042         break golab0;
1043       }
1044       cursor = v_2;
1045       if (cursor >= limit) {
1046         return false;
1047       }
1048       cursor++;
1049     }
1050     golab2:
1051     while (true) {
1052       int v_3 = cursor;
1053       lab3:
1054       {
1055         if (!(out_grouping(g_v, 97, 121))) {
1056           break lab3;
1057         }
1058         cursor = v_3;
1059         break golab2;
1060       }
1061       cursor = v_3;
1062       if (cursor >= limit) {
1063         return false;
1064       }
1065       cursor++;
1066     }
1067     B_GE_removed = true;
1068     slice_del();
1069     return true;
1070   }
1071 
r_Lose_infix()1072   private boolean r_Lose_infix() {
1073     if (cursor >= limit) {
1074       return false;
1075     }
1076     cursor++;
1077     golab0:
1078     while (true) {
1079       lab1:
1080       {
1081         bra = cursor;
1082         if (!(eq_s("ge"))) {
1083           break lab1;
1084         }
1085         ket = cursor;
1086         break golab0;
1087       }
1088       if (cursor >= limit) {
1089         return false;
1090       }
1091       cursor++;
1092     }
1093     int v_2 = cursor;
1094     {
1095       int c = cursor + 3;
1096       if (0 > c || c > limit) {
1097         return false;
1098       }
1099       cursor = c;
1100     }
1101     cursor = v_2;
1102     golab2:
1103     while (true) {
1104       int v_3 = cursor;
1105       lab3:
1106       {
1107         if (!(in_grouping(g_v, 97, 121))) {
1108           break lab3;
1109         }
1110         cursor = v_3;
1111         break golab2;
1112       }
1113       cursor = v_3;
1114       if (cursor >= limit) {
1115         return false;
1116       }
1117       cursor++;
1118     }
1119     golab4:
1120     while (true) {
1121       int v_4 = cursor;
1122       lab5:
1123       {
1124         if (!(out_grouping(g_v, 97, 121))) {
1125           break lab5;
1126         }
1127         cursor = v_4;
1128         break golab4;
1129       }
1130       cursor = v_4;
1131       if (cursor >= limit) {
1132         return false;
1133       }
1134       cursor++;
1135     }
1136     B_GE_removed = true;
1137     slice_del();
1138     return true;
1139   }
1140 
r_measure()1141   private boolean r_measure() {
1142     I_p1 = limit;
1143     I_p2 = limit;
1144     int v_1 = cursor;
1145     lab0:
1146     {
1147       while (true) {
1148         lab1:
1149         {
1150           if (!(out_grouping(g_v, 97, 121))) {
1151             break lab1;
1152           }
1153           continue;
1154         }
1155         break;
1156       }
1157       {
1158         int v_3 = 1;
1159         while (true) {
1160           int v_4 = cursor;
1161           lab2:
1162           {
1163             lab3:
1164             {
1165               int v_5 = cursor;
1166               lab4:
1167               {
1168                 if (!(eq_s("ij"))) {
1169                   break lab4;
1170                 }
1171                 break lab3;
1172               }
1173               cursor = v_5;
1174               if (!(in_grouping(g_v, 97, 121))) {
1175                 break lab2;
1176               }
1177             }
1178             v_3--;
1179             continue;
1180           }
1181           cursor = v_4;
1182           break;
1183         }
1184         if (v_3 > 0) {
1185           break lab0;
1186         }
1187       }
1188       if (!(out_grouping(g_v, 97, 121))) {
1189         break lab0;
1190       }
1191       I_p1 = cursor;
1192       while (true) {
1193         lab5:
1194         {
1195           if (!(out_grouping(g_v, 97, 121))) {
1196             break lab5;
1197           }
1198           continue;
1199         }
1200         break;
1201       }
1202       {
1203         int v_7 = 1;
1204         while (true) {
1205           int v_8 = cursor;
1206           lab6:
1207           {
1208             lab7:
1209             {
1210               int v_9 = cursor;
1211               lab8:
1212               {
1213                 if (!(eq_s("ij"))) {
1214                   break lab8;
1215                 }
1216                 break lab7;
1217               }
1218               cursor = v_9;
1219               if (!(in_grouping(g_v, 97, 121))) {
1220                 break lab6;
1221               }
1222             }
1223             v_7--;
1224             continue;
1225           }
1226           cursor = v_8;
1227           break;
1228         }
1229         if (v_7 > 0) {
1230           break lab0;
1231         }
1232       }
1233       if (!(out_grouping(g_v, 97, 121))) {
1234         break lab0;
1235       }
1236       I_p2 = cursor;
1237     }
1238     cursor = v_1;
1239     return true;
1240   }
1241 
1242   @Override
stem()1243   public boolean stem() {
1244     B_Y_found = false;
1245     B_stemmed = false;
1246     int v_1 = cursor;
1247     lab0:
1248     {
1249       bra = cursor;
1250       if (!(eq_s("y"))) {
1251         break lab0;
1252       }
1253       ket = cursor;
1254       slice_from("Y");
1255       B_Y_found = true;
1256     }
1257     cursor = v_1;
1258     int v_2 = cursor;
1259     lab1:
1260     {
1261       while (true) {
1262         int v_3 = cursor;
1263         lab2:
1264         {
1265           golab3:
1266           while (true) {
1267             int v_4 = cursor;
1268             lab4:
1269             {
1270               if (!(in_grouping(g_v, 97, 121))) {
1271                 break lab4;
1272               }
1273               bra = cursor;
1274               if (!(eq_s("y"))) {
1275                 break lab4;
1276               }
1277               ket = cursor;
1278               cursor = v_4;
1279               break golab3;
1280             }
1281             cursor = v_4;
1282             if (cursor >= limit) {
1283               break lab2;
1284             }
1285             cursor++;
1286           }
1287           slice_from("Y");
1288           B_Y_found = true;
1289           continue;
1290         }
1291         cursor = v_3;
1292         break;
1293       }
1294     }
1295     cursor = v_2;
1296     if (!r_measure()) {
1297       return false;
1298     }
1299     limit_backward = cursor;
1300     cursor = limit;
1301     int v_5 = limit - cursor;
1302     lab5:
1303     {
1304       if (!r_Step_1()) {
1305         break lab5;
1306       }
1307       B_stemmed = true;
1308     }
1309     cursor = limit - v_5;
1310     int v_6 = limit - cursor;
1311     lab6:
1312     {
1313       if (!r_Step_2()) {
1314         break lab6;
1315       }
1316       B_stemmed = true;
1317     }
1318     cursor = limit - v_6;
1319     int v_7 = limit - cursor;
1320     lab7:
1321     {
1322       if (!r_Step_3()) {
1323         break lab7;
1324       }
1325       B_stemmed = true;
1326     }
1327     cursor = limit - v_7;
1328     int v_8 = limit - cursor;
1329     lab8:
1330     {
1331       if (!r_Step_4()) {
1332         break lab8;
1333       }
1334       B_stemmed = true;
1335     }
1336     cursor = limit - v_8;
1337     cursor = limit_backward;
1338     B_GE_removed = false;
1339     int v_9 = cursor;
1340     lab9:
1341     {
1342       int v_10 = cursor;
1343       if (!r_Lose_prefix()) {
1344         break lab9;
1345       }
1346       cursor = v_10;
1347       if (!r_measure()) {
1348         break lab9;
1349       }
1350     }
1351     cursor = v_9;
1352     limit_backward = cursor;
1353     cursor = limit;
1354     int v_11 = limit - cursor;
1355     lab10:
1356     {
1357       if (!(B_GE_removed)) {
1358         break lab10;
1359       }
1360       if (!r_Step_1c()) {
1361         break lab10;
1362       }
1363     }
1364     cursor = limit - v_11;
1365     cursor = limit_backward;
1366     B_GE_removed = false;
1367     int v_12 = cursor;
1368     lab11:
1369     {
1370       int v_13 = cursor;
1371       if (!r_Lose_infix()) {
1372         break lab11;
1373       }
1374       cursor = v_13;
1375       if (!r_measure()) {
1376         break lab11;
1377       }
1378     }
1379     cursor = v_12;
1380     limit_backward = cursor;
1381     cursor = limit;
1382     int v_14 = limit - cursor;
1383     lab12:
1384     {
1385       if (!(B_GE_removed)) {
1386         break lab12;
1387       }
1388       if (!r_Step_1c()) {
1389         break lab12;
1390       }
1391     }
1392     cursor = limit - v_14;
1393     cursor = limit_backward;
1394     limit_backward = cursor;
1395     cursor = limit;
1396     int v_15 = limit - cursor;
1397     lab13:
1398     {
1399       if (!r_Step_7()) {
1400         break lab13;
1401       }
1402       B_stemmed = true;
1403     }
1404     cursor = limit - v_15;
1405     int v_16 = limit - cursor;
1406     lab14:
1407     {
1408       lab15:
1409       {
1410         lab16:
1411         {
1412           if (!(B_stemmed)) {
1413             break lab16;
1414           }
1415           break lab15;
1416         }
1417         if (!(B_GE_removed)) {
1418           break lab14;
1419         }
1420       }
1421       if (!r_Step_6()) {
1422         break lab14;
1423       }
1424     }
1425     cursor = limit - v_16;
1426     cursor = limit_backward;
1427     int v_18 = cursor;
1428     lab17:
1429     {
1430       if (!(B_Y_found)) {
1431         break lab17;
1432       }
1433       while (true) {
1434         int v_19 = cursor;
1435         lab18:
1436         {
1437           golab19:
1438           while (true) {
1439             int v_20 = cursor;
1440             lab20:
1441             {
1442               bra = cursor;
1443               if (!(eq_s("Y"))) {
1444                 break lab20;
1445               }
1446               ket = cursor;
1447               cursor = v_20;
1448               break golab19;
1449             }
1450             cursor = v_20;
1451             if (cursor >= limit) {
1452               break lab18;
1453             }
1454             cursor++;
1455           }
1456           slice_from("y");
1457           continue;
1458         }
1459         cursor = v_19;
1460         break;
1461       }
1462     }
1463     cursor = v_18;
1464     return true;
1465   }
1466 
1467   @Override
equals(Object o)1468   public boolean equals(Object o) {
1469     return o instanceof KpStemmer;
1470   }
1471 
1472   @Override
hashCode()1473   public int hashCode() {
1474     return KpStemmer.class.getName().hashCode();
1475   }
1476 }
1477