001: // This file was generated automatically by the Snowball to Java compiler
002:
003: package net.sf.snowball.ext;
004:
005: import net.sf.snowball.SnowballProgram;
006: import net.sf.snowball.Among;
007:
008: /**
009: * Generated class implementing code defined by a snowball script.
010: */
011: public class GermanStemmer extends SnowballProgram {
012:
013: private Among a_0[] = { new Among("", -1, 6, "", this ),
014: new Among("U", 0, 2, "", this ),
015: new Among("Y", 0, 1, "", this ),
016: new Among("\u00E4", 0, 3, "", this ),
017: new Among("\u00F6", 0, 4, "", this ),
018: new Among("\u00FC", 0, 5, "", this ) };
019:
020: private Among a_1[] = { new Among("e", -1, 1, "", this ),
021: new Among("em", -1, 1, "", this ),
022: new Among("en", -1, 1, "", this ),
023: new Among("ern", -1, 1, "", this ),
024: new Among("er", -1, 1, "", this ),
025: new Among("s", -1, 2, "", this ),
026: new Among("es", 5, 1, "", this ) };
027:
028: private Among a_2[] = { new Among("en", -1, 1, "", this ),
029: new Among("er", -1, 1, "", this ),
030: new Among("st", -1, 2, "", this ),
031: new Among("est", 2, 1, "", this ) };
032:
033: private Among a_3[] = { new Among("ig", -1, 1, "", this ),
034: new Among("lich", -1, 1, "", this ) };
035:
036: private Among a_4[] = { new Among("end", -1, 1, "", this ),
037: new Among("ig", -1, 2, "", this ),
038: new Among("ung", -1, 1, "", this ),
039: new Among("lich", -1, 3, "", this ),
040: new Among("isch", -1, 2, "", this ),
041: new Among("ik", -1, 2, "", this ),
042: new Among("heit", -1, 3, "", this ),
043: new Among("keit", -1, 4, "", this ) };
044:
045: private static final char g_v[] = { 17, 65, 16, 1, 0, 0, 0, 0, 0,
046: 0, 0, 0, 0, 0, 0, 0, 8, 0, 32, 8 };
047:
048: private static final char g_s_ending[] = { 117, 30, 5 };
049:
050: private static final char g_st_ending[] = { 117, 30, 4 };
051:
052: private int I_p2;
053: private int I_p1;
054:
055: private void copy_from(GermanStemmer other) {
056: I_p2 = other.I_p2;
057: I_p1 = other.I_p1;
058: super .copy_from(other);
059: }
060:
061: private boolean r_prelude() {
062: int v_1;
063: int v_2;
064: int v_3;
065: int v_4;
066: int v_5;
067: int v_6;
068: // (, line 28
069: // test, line 30
070: v_1 = cursor;
071: // repeat, line 30
072: replab0: while (true) {
073: v_2 = cursor;
074: lab1: do {
075: // (, line 30
076: // or, line 33
077: lab2: do {
078: v_3 = cursor;
079: lab3: do {
080: // (, line 31
081: // [, line 32
082: bra = cursor;
083: // literal, line 32
084: if (!(eq_s(1, "\u00DF"))) {
085: break lab3;
086: }
087: // ], line 32
088: ket = cursor;
089: // <-, line 32
090: slice_from("ss");
091: break lab2;
092: } while (false);
093: cursor = v_3;
094: // next, line 33
095: if (cursor >= limit) {
096: break lab1;
097: }
098: cursor++;
099: } while (false);
100: continue replab0;
101: } while (false);
102: cursor = v_2;
103: break replab0;
104: }
105: cursor = v_1;
106: // repeat, line 36
107: replab4: while (true) {
108: v_4 = cursor;
109: lab5: do {
110: // goto, line 36
111: golab6: while (true) {
112: v_5 = cursor;
113: lab7: do {
114: // (, line 36
115: if (!(in_grouping(g_v, 97, 252))) {
116: break lab7;
117: }
118: // [, line 37
119: bra = cursor;
120: // or, line 37
121: lab8: do {
122: v_6 = cursor;
123: lab9: do {
124: // (, line 37
125: // literal, line 37
126: if (!(eq_s(1, "u"))) {
127: break lab9;
128: }
129: // ], line 37
130: ket = cursor;
131: if (!(in_grouping(g_v, 97, 252))) {
132: break lab9;
133: }
134: // <-, line 37
135: slice_from("U");
136: break lab8;
137: } while (false);
138: cursor = v_6;
139: // (, line 38
140: // literal, line 38
141: if (!(eq_s(1, "y"))) {
142: break lab7;
143: }
144: // ], line 38
145: ket = cursor;
146: if (!(in_grouping(g_v, 97, 252))) {
147: break lab7;
148: }
149: // <-, line 38
150: slice_from("Y");
151: } while (false);
152: cursor = v_5;
153: break golab6;
154: } while (false);
155: cursor = v_5;
156: if (cursor >= limit) {
157: break lab5;
158: }
159: cursor++;
160: }
161: continue replab4;
162: } while (false);
163: cursor = v_4;
164: break replab4;
165: }
166: return true;
167: }
168:
169: private boolean r_mark_regions() {
170: // (, line 42
171: I_p1 = limit;
172: I_p2 = limit;
173: // gopast, line 47
174: golab0: while (true) {
175: lab1: do {
176: if (!(in_grouping(g_v, 97, 252))) {
177: break lab1;
178: }
179: break golab0;
180: } while (false);
181: if (cursor >= limit) {
182: return false;
183: }
184: cursor++;
185: }
186: // gopast, line 47
187: golab2: while (true) {
188: lab3: do {
189: if (!(out_grouping(g_v, 97, 252))) {
190: break lab3;
191: }
192: break golab2;
193: } while (false);
194: if (cursor >= limit) {
195: return false;
196: }
197: cursor++;
198: }
199: // setmark p1, line 47
200: I_p1 = cursor;
201: // try, line 48
202: lab4: do {
203: // (, line 48
204: if (!(I_p1 < 3)) {
205: break lab4;
206: }
207: I_p1 = 3;
208: } while (false);
209: // gopast, line 49
210: golab5: while (true) {
211: lab6: do {
212: if (!(in_grouping(g_v, 97, 252))) {
213: break lab6;
214: }
215: break golab5;
216: } while (false);
217: if (cursor >= limit) {
218: return false;
219: }
220: cursor++;
221: }
222: // gopast, line 49
223: golab7: while (true) {
224: lab8: do {
225: if (!(out_grouping(g_v, 97, 252))) {
226: break lab8;
227: }
228: break golab7;
229: } while (false);
230: if (cursor >= limit) {
231: return false;
232: }
233: cursor++;
234: }
235: // setmark p2, line 49
236: I_p2 = cursor;
237: return true;
238: }
239:
240: private boolean r_postlude() {
241: int among_var;
242: int v_1;
243: // repeat, line 53
244: replab0: while (true) {
245: v_1 = cursor;
246: lab1: do {
247: // (, line 53
248: // [, line 55
249: bra = cursor;
250: // substring, line 55
251: among_var = find_among(a_0, 6);
252: if (among_var == 0) {
253: break lab1;
254: }
255: // ], line 55
256: ket = cursor;
257: switch (among_var) {
258: case 0:
259: break lab1;
260: case 1:
261: // (, line 56
262: // <-, line 56
263: slice_from("y");
264: break;
265: case 2:
266: // (, line 57
267: // <-, line 57
268: slice_from("u");
269: break;
270: case 3:
271: // (, line 58
272: // <-, line 58
273: slice_from("a");
274: break;
275: case 4:
276: // (, line 59
277: // <-, line 59
278: slice_from("o");
279: break;
280: case 5:
281: // (, line 60
282: // <-, line 60
283: slice_from("u");
284: break;
285: case 6:
286: // (, line 61
287: // next, line 61
288: if (cursor >= limit) {
289: break lab1;
290: }
291: cursor++;
292: break;
293: }
294: continue replab0;
295: } while (false);
296: cursor = v_1;
297: break replab0;
298: }
299: return true;
300: }
301:
302: private boolean r_R1() {
303: if (!(I_p1 <= cursor)) {
304: return false;
305: }
306: return true;
307: }
308:
309: private boolean r_R2() {
310: if (!(I_p2 <= cursor)) {
311: return false;
312: }
313: return true;
314: }
315:
316: private boolean r_standard_suffix() {
317: int among_var;
318: int v_1;
319: int v_2;
320: int v_3;
321: int v_4;
322: int v_5;
323: int v_6;
324: int v_7;
325: int v_8;
326: int v_9;
327: // (, line 71
328: // do, line 72
329: v_1 = limit - cursor;
330: lab0: do {
331: // (, line 72
332: // [, line 73
333: ket = cursor;
334: // substring, line 73
335: among_var = find_among_b(a_1, 7);
336: if (among_var == 0) {
337: break lab0;
338: }
339: // ], line 73
340: bra = cursor;
341: // call R1, line 73
342: if (!r_R1()) {
343: break lab0;
344: }
345: switch (among_var) {
346: case 0:
347: break lab0;
348: case 1:
349: // (, line 75
350: // delete, line 75
351: slice_del();
352: break;
353: case 2:
354: // (, line 78
355: if (!(in_grouping_b(g_s_ending, 98, 116))) {
356: break lab0;
357: }
358: // delete, line 78
359: slice_del();
360: break;
361: }
362: } while (false);
363: cursor = limit - v_1;
364: // do, line 82
365: v_2 = limit - cursor;
366: lab1: do {
367: // (, line 82
368: // [, line 83
369: ket = cursor;
370: // substring, line 83
371: among_var = find_among_b(a_2, 4);
372: if (among_var == 0) {
373: break lab1;
374: }
375: // ], line 83
376: bra = cursor;
377: // call R1, line 83
378: if (!r_R1()) {
379: break lab1;
380: }
381: switch (among_var) {
382: case 0:
383: break lab1;
384: case 1:
385: // (, line 85
386: // delete, line 85
387: slice_del();
388: break;
389: case 2:
390: // (, line 88
391: if (!(in_grouping_b(g_st_ending, 98, 116))) {
392: break lab1;
393: }
394: // hop, line 88
395: {
396: int c = cursor - 3;
397: if (limit_backward > c || c > limit) {
398: break lab1;
399: }
400: cursor = c;
401: }
402: // delete, line 88
403: slice_del();
404: break;
405: }
406: } while (false);
407: cursor = limit - v_2;
408: // do, line 92
409: v_3 = limit - cursor;
410: lab2: do {
411: // (, line 92
412: // [, line 93
413: ket = cursor;
414: // substring, line 93
415: among_var = find_among_b(a_4, 8);
416: if (among_var == 0) {
417: break lab2;
418: }
419: // ], line 93
420: bra = cursor;
421: // call R2, line 93
422: if (!r_R2()) {
423: break lab2;
424: }
425: switch (among_var) {
426: case 0:
427: break lab2;
428: case 1:
429: // (, line 95
430: // delete, line 95
431: slice_del();
432: // try, line 96
433: v_4 = limit - cursor;
434: lab3: do {
435: // (, line 96
436: // [, line 96
437: ket = cursor;
438: // literal, line 96
439: if (!(eq_s_b(2, "ig"))) {
440: cursor = limit - v_4;
441: break lab3;
442: }
443: // ], line 96
444: bra = cursor;
445: // not, line 96
446: {
447: v_5 = limit - cursor;
448: lab4: do {
449: // literal, line 96
450: if (!(eq_s_b(1, "e"))) {
451: break lab4;
452: }
453: cursor = limit - v_4;
454: break lab3;
455: } while (false);
456: cursor = limit - v_5;
457: }
458: // call R2, line 96
459: if (!r_R2()) {
460: cursor = limit - v_4;
461: break lab3;
462: }
463: // delete, line 96
464: slice_del();
465: } while (false);
466: break;
467: case 2:
468: // (, line 99
469: // not, line 99
470: {
471: v_6 = limit - cursor;
472: lab5: do {
473: // literal, line 99
474: if (!(eq_s_b(1, "e"))) {
475: break lab5;
476: }
477: break lab2;
478: } while (false);
479: cursor = limit - v_6;
480: }
481: // delete, line 99
482: slice_del();
483: break;
484: case 3:
485: // (, line 102
486: // delete, line 102
487: slice_del();
488: // try, line 103
489: v_7 = limit - cursor;
490: lab6: do {
491: // (, line 103
492: // [, line 104
493: ket = cursor;
494: // or, line 104
495: lab7: do {
496: v_8 = limit - cursor;
497: lab8: do {
498: // literal, line 104
499: if (!(eq_s_b(2, "er"))) {
500: break lab8;
501: }
502: break lab7;
503: } while (false);
504: cursor = limit - v_8;
505: // literal, line 104
506: if (!(eq_s_b(2, "en"))) {
507: cursor = limit - v_7;
508: break lab6;
509: }
510: } while (false);
511: // ], line 104
512: bra = cursor;
513: // call R1, line 104
514: if (!r_R1()) {
515: cursor = limit - v_7;
516: break lab6;
517: }
518: // delete, line 104
519: slice_del();
520: } while (false);
521: break;
522: case 4:
523: // (, line 108
524: // delete, line 108
525: slice_del();
526: // try, line 109
527: v_9 = limit - cursor;
528: lab9: do {
529: // (, line 109
530: // [, line 110
531: ket = cursor;
532: // substring, line 110
533: among_var = find_among_b(a_3, 2);
534: if (among_var == 0) {
535: cursor = limit - v_9;
536: break lab9;
537: }
538: // ], line 110
539: bra = cursor;
540: // call R2, line 110
541: if (!r_R2()) {
542: cursor = limit - v_9;
543: break lab9;
544: }
545: switch (among_var) {
546: case 0:
547: cursor = limit - v_9;
548: break lab9;
549: case 1:
550: // (, line 112
551: // delete, line 112
552: slice_del();
553: break;
554: }
555: } while (false);
556: break;
557: }
558: } while (false);
559: cursor = limit - v_3;
560: return true;
561: }
562:
563: public boolean stem() {
564: int v_1;
565: int v_2;
566: int v_3;
567: int v_4;
568: // (, line 122
569: // do, line 123
570: v_1 = cursor;
571: lab0: do {
572: // call prelude, line 123
573: if (!r_prelude()) {
574: break lab0;
575: }
576: } while (false);
577: cursor = v_1;
578: // do, line 124
579: v_2 = cursor;
580: lab1: do {
581: // call mark_regions, line 124
582: if (!r_mark_regions()) {
583: break lab1;
584: }
585: } while (false);
586: cursor = v_2;
587: // backwards, line 125
588: limit_backward = cursor;
589: cursor = limit;
590: // do, line 126
591: v_3 = limit - cursor;
592: lab2: do {
593: // call standard_suffix, line 126
594: if (!r_standard_suffix()) {
595: break lab2;
596: }
597: } while (false);
598: cursor = limit - v_3;
599: cursor = limit_backward; // do, line 127
600: v_4 = cursor;
601: lab3: do {
602: // call postlude, line 127
603: if (!r_postlude()) {
604: break lab3;
605: }
606: } while (false);
607: cursor = v_4;
608: return true;
609: }
610:
611: }
|