Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
PortugueseStemmer.cs
Go to the documentation of this file.
1 /*
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements. See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership. The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License. You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied. See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20 */
21 
22 /*
23 
24 Copyright (c) 2001, Dr Martin Porter
25 Copyright (c) 2002, Richard Boulton
26 All rights reserved.
27 
28 Redistribution and use in source and binary forms, with or without
29 modification, are permitted provided that the following conditions are met:
30 
31  * Redistributions of source code must retain the above copyright notice,
32  * this list of conditions and the following disclaimer.
33  * Redistributions in binary form must reproduce the above copyright
34  * notice, this list of conditions and the following disclaimer in the
35  * documentation and/or other materials provided with the distribution.
36  * Neither the name of the copyright holders nor the names of its contributors
37  * may be used to endorse or promote products derived from this software
38  * without specific prior written permission.
39 
40 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
41 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
43 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
44 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
46 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
47 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
48 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
49 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50 
51  */
52 
53 
54 using System;
55 using Among = SF.Snowball.Among;
56 using SnowballProgram = SF.Snowball.SnowballProgram;
57 namespace SF.Snowball.Ext
58 {
59 
60  /*
61  * Generated class implementing code defined by a snowball script.
62  */
64  {
66  {
67  Init();
68  }
69 
70  void Init()
71  {
72  a_0 = new Among[] {
73  new Among("", -1, 3, "",null),
74  new Among("\u00E3", 0, 1, "",null),
75  new Among("\u00F5", 0, 2, "",null)
76  };
77 
78  a_1 = new Among[] {
79  new Among("", -1, 3, "", null),
80  new Among("a~", 0, 1, "", null),
81  new Among("o~", 0, 2, "", null)
82  };
83 
84  a_2 = new Among[] {
85  new Among("ic", -1, -1, "", null),
86  new Among("ad", -1, -1, "", null),
87  new Among("os", -1, -1, "", null),
88  new Among("iv", -1, 1, "", null)
89  };
90 
91  a_3 = new Among[] {
92  new Among("ante", -1, 1, "", null),
93  new Among("avel", -1, 1, "", null),
94  new Among("\u00EDvel", -1, 1, "", null)
95  };
96 
97  a_4 = new Among[] {
98  new Among("ic", -1, 1, "", null),
99  new Among("abil", -1, 1, "", null),
100  new Among("iv", -1, 1, "", null)
101  };
102 
103  a_5 = new Among[] {
104  new Among("ica", -1, 1, "", null),
105  new Among("\u00E2ncia", -1, 1, "", null),
106  new Among("\u00EAncia", -1, 4, "", null),
107  new Among("ira", -1, 9, "", null),
108  new Among("adora", -1, 1, "", null),
109  new Among("osa", -1, 1, "", null),
110  new Among("ista", -1, 1, "", null),
111  new Among("iva", -1, 8, "", null),
112  new Among("eza", -1, 1, "", null),
113  new Among("log\u00EDa", -1, 2, "", null),
114  new Among("idade", -1, 7, "", null),
115  new Among("ante", -1, 1, "", null),
116  new Among("mente", -1, 6, "", null),
117  new Among("amente", 12, 5, "", null),
118  new Among("\u00E1vel", -1, 1, "", null),
119  new Among("\u00EDvel", -1, 1, "", null),
120  new Among("uci\u00F3n", -1, 3, "", null),
121  new Among("ico", -1, 1, "", null),
122  new Among("ismo", -1, 1, "", null),
123  new Among("oso", -1, 1, "", null),
124  new Among("amento", -1, 1, "", null),
125  new Among("imento", -1, 1, "", null),
126  new Among("ivo", -1, 8, "", null),
127  new Among("a\u00E7a~o", -1, 1, "", null),
128  new Among("ador", -1, 1, "", null),
129  new Among("icas", -1, 1, "", null),
130  new Among("\u00EAncias", -1, 4, "", null),
131  new Among("iras", -1, 9, "", null),
132  new Among("adoras", -1, 1, "", null),
133  new Among("osas", -1, 1, "", null),
134  new Among("istas", -1, 1, "", null),
135  new Among("ivas", -1, 8, "", null),
136  new Among("ezas", -1, 1, "", null),
137  new Among("log\u00EDas", -1, 2, "", null),
138  new Among("idades", -1, 7, "", null),
139  new Among("uciones", -1, 3, "", null),
140  new Among("adores", -1, 1, "", null),
141  new Among("antes", -1, 1, "", null),
142  new Among("a\u00E7o~es", -1, 1, "", null),
143  new Among("icos", -1, 1, "", null),
144  new Among("ismos", -1, 1, "", null),
145  new Among("osos", -1, 1, "", null),
146  new Among("amentos", -1, 1, "", null),
147  new Among("imentos", -1, 1, "", null),
148  new Among("ivos", -1, 8, "", null)
149  };
150 
151  a_6 = new Among[] {
152  new Among("ada", -1, 1, "", null),
153  new Among("ida", -1, 1, "", null),
154  new Among("ia", -1, 1, "", null),
155  new Among("aria", 2, 1, "", null),
156  new Among("eria", 2, 1, "", null),
157  new Among("iria", 2, 1, "", null),
158  new Among("ara", -1, 1, "", null),
159  new Among("era", -1, 1, "", null),
160  new Among("ira", -1, 1, "", null),
161  new Among("ava", -1, 1, "", null),
162  new Among("asse", -1, 1, "", null),
163  new Among("esse", -1, 1, "", null),
164  new Among("isse", -1, 1, "", null),
165  new Among("aste", -1, 1, "", null),
166  new Among("este", -1, 1, "", null),
167  new Among("iste", -1, 1, "", null),
168  new Among("ei", -1, 1, "", null),
169  new Among("arei", 16, 1, "", null),
170  new Among("erei", 16, 1, "", null),
171  new Among("irei", 16, 1, "", null),
172  new Among("am", -1, 1, "", null),
173  new Among("iam", 20, 1, "", null),
174  new Among("ariam", 21, 1, "", null),
175  new Among("eriam", 21, 1, "", null),
176  new Among("iriam", 21, 1, "", null),
177  new Among("aram", 20, 1, "", null),
178  new Among("eram", 20, 1, "", null),
179  new Among("iram", 20, 1, "", null),
180  new Among("avam", 20, 1, "", null),
181  new Among("em", -1, 1, "", null),
182  new Among("arem", 29, 1, "", null),
183  new Among("erem", 29, 1, "", null),
184  new Among("irem", 29, 1, "", null),
185  new Among("assem", 29, 1, "", null),
186  new Among("essem", 29, 1, "", null),
187  new Among("issem", 29, 1, "", null),
188  new Among("ado", -1, 1, "", null),
189  new Among("ido", -1, 1, "", null),
190  new Among("ando", -1, 1, "", null),
191  new Among("endo", -1, 1, "", null),
192  new Among("indo", -1, 1, "", null),
193  new Among("ara~o", -1, 1, "", null),
194  new Among("era~o", -1, 1, "", null),
195  new Among("ira~o", -1, 1, "", null),
196  new Among("ar", -1, 1, "", null),
197  new Among("er", -1, 1, "", null),
198  new Among("ir", -1, 1, "", null),
199  new Among("as", -1, 1, "", null),
200  new Among("adas", 47, 1, "", null),
201  new Among("idas", 47, 1, "", null),
202  new Among("ias", 47, 1, "", null),
203  new Among("arias", 50, 1, "", null),
204  new Among("erias", 50, 1, "", null),
205  new Among("irias", 50, 1, "", null),
206  new Among("aras", 47, 1, "", null),
207  new Among("eras", 47, 1, "", null),
208  new Among("iras", 47, 1, "", null),
209  new Among("avas", 47, 1, "", null),
210  new Among("es", -1, 1, "", null),
211  new Among("ardes", 58, 1, "", null),
212  new Among("erdes", 58, 1, "", null),
213  new Among("irdes", 58, 1, "", null),
214  new Among("ares", 58, 1, "", null),
215  new Among("eres", 58, 1, "", null),
216  new Among("ires", 58, 1, "", null),
217  new Among("asses", 58, 1, "", null),
218  new Among("esses", 58, 1, "", null),
219  new Among("isses", 58, 1, "", null),
220  new Among("astes", 58, 1, "", null),
221  new Among("estes", 58, 1, "", null),
222  new Among("istes", 58, 1, "", null),
223  new Among("is", -1, 1, "", null),
224  new Among("ais", 71, 1, "", null),
225  new Among("eis", 71, 1, "", null),
226  new Among("areis", 73, 1, "", null),
227  new Among("ereis", 73, 1, "", null),
228  new Among("ireis", 73, 1, "", null),
229  new Among("\u00E1reis", 73, 1, "", null),
230  new Among("\u00E9reis", 73, 1, "", null),
231  new Among("\u00EDreis", 73, 1, "", null),
232  new Among("\u00E1sseis", 73, 1, "", null),
233  new Among("\u00E9sseis", 73, 1, "", null),
234  new Among("\u00EDsseis", 73, 1, "", null),
235  new Among("\u00E1veis", 73, 1, "", null),
236  new Among("\u00EDeis", 73, 1, "", null),
237  new Among("ar\u00EDeis", 84, 1, "", null),
238  new Among("er\u00EDeis", 84, 1, "", null),
239  new Among("ir\u00EDeis", 84, 1, "", null),
240  new Among("ados", -1, 1, "", null),
241  new Among("idos", -1, 1, "", null),
242  new Among("amos", -1, 1, "", null),
243  new Among("\u00E1ramos", 90, 1, "", null),
244  new Among("\u00E9ramos", 90, 1, "", null),
245  new Among("\u00EDramos", 90, 1, "", null),
246  new Among("\u00E1vamos", 90, 1, "", null),
247  new Among("\u00EDamos", 90, 1, "", null),
248  new Among("ar\u00EDamos", 95, 1, "", null),
249  new Among("er\u00EDamos", 95, 1, "", null),
250  new Among("ir\u00EDamos", 95, 1, "", null),
251  new Among("emos", -1, 1, "", null),
252  new Among("aremos", 99, 1, "", null),
253  new Among("eremos", 99, 1, "", null),
254  new Among("iremos", 99, 1, "", null),
255  new Among("\u00E1ssemos", 99, 1, "", null),
256  new Among("\u00EAssemos", 99, 1, "", null),
257  new Among("\u00EDssemos", 99, 1, "", null),
258  new Among("imos", -1, 1, "", null),
259  new Among("armos", -1, 1, "", null),
260  new Among("ermos", -1, 1, "", null),
261  new Among("irmos", -1, 1, "", null),
262  new Among("\u00E1mos", -1, 1, "", null),
263  new Among("ar\u00E1s", -1, 1, "", null),
264  new Among("er\u00E1s", -1, 1, "", null),
265  new Among("ir\u00E1s", -1, 1, "", null),
266  new Among("eu", -1, 1, "", null),
267  new Among("iu", -1, 1, "", null),
268  new Among("ou", -1, 1, "", null),
269  new Among("ar\u00E1", -1, 1, "", null),
270  new Among("er\u00E1", -1, 1, "", null),
271  new Among("ir\u00E1", -1, 1, "", null)
272  };
273 
274  a_7 = new Among[] {
275  new Among("a", -1, 1, "", null),
276  new Among("i", -1, 1, "", null),
277  new Among("o", -1, 1, "", null),
278  new Among("os", -1, 1, "", null),
279  new Among("\u00E1", -1, 1, "", null),
280  new Among("\u00ED", -1, 1, "", null),
281  new Among("\u00F3", -1, 1, "", null)
282  };
283 
284  a_8 = new Among[] {
285  new Among("e", -1, 1, "", null),
286  new Among("\u00E7", -1, 2, "", null),
287  new Among("\u00E9", -1, 1, "", null),
288  new Among("\u00EA", -1, 1, "", null)
289  };
290 
291  }
292 
293  private Among[] a_0;
294  private Among[] a_1;
295  private Among[] a_2;
296  private Among[] a_3;
297  private Among[] a_4;
298  private Among[] a_5;
299  private Among[] a_6;
300  private Among[] a_7;
301  private Among[] a_8;
302  private static char[] g_v = new char[] { (char)17, (char)65, (char)16, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)3, (char)19, (char)12, (char)2 };
303 
304  private int I_p2;
305  private int I_p1;
306  private int I_pV;
307 
308  private void copy_from(PortugueseStemmer other)
309  {
310  I_p2 = other.I_p2;
311  I_p1 = other.I_p1;
312  I_pV = other.I_pV;
313  base.copy_from(other);
314  }
315 
316  private bool r_prelude()
317  {
318  int among_var;
319  int v_1;
320  // repeat, line 36
321  replab0:
322  v_1 = cursor;
323  // (, line 36
324  // [, line 37
325  bra = cursor;
326  // substring, line 37
327  among_var = find_among(a_0, 3);
328  if (among_var == 0)
329  {
330  goto lab1;
331  }
332  // ], line 37
333  ket = cursor;
334  switch (among_var)
335  {
336  case 0:
337  goto lab1;
338  case 1:
339  // (, line 38
340  // <-, line 38
341  slice_from("a~");
342  break;
343  case 2:
344  // (, line 39
345  // <-, line 39
346  slice_from("o~");
347  break;
348  case 3:
349  // (, line 40
350  // next, line 40
351  if (cursor >= limit)
352  {
353  goto lab1;
354  }
355  cursor++;
356  break;
357  }
358  goto replab0;
359  lab1:
360  cursor = v_1;
361  return true;
362  }
363 
364  private bool r_mark_regions()
365  {
366  int v_1;
367  int v_2;
368  int v_3;
369  int v_6;
370  int v_8;
371  // (, line 44
372  I_pV = limit;
373  I_p1 = limit;
374  I_p2 = limit;
375  // do, line 50
376  v_1 = cursor;
377  // (, line 50
378  // or, line 52
379  v_2 = cursor;
380  // (, line 51
381  if (!(in_grouping(g_v, 97, 250)))
382  {
383  goto lab2;
384  }
385  // or, line 51
386  v_3 = cursor;
387  // (, line 51
388  if (!(out_grouping(g_v, 97, 250)))
389  {
390  goto lab4;
391  }
392  // gopast, line 51
393  while (true)
394  {
395  if (!(in_grouping(g_v, 97, 250)))
396  {
397  goto lab6;
398  }
399  goto golab5;
400  lab6:
401  if (cursor >= limit)
402  {
403  goto lab4;
404  }
405  cursor++;
406  }
407  golab5:
408  goto lab3;
409  lab4:
410  cursor = v_3;
411  // (, line 51
412  if (!(in_grouping(g_v, 97, 250)))
413  {
414  goto lab2;
415  }
416  // gopast, line 51
417  while (true)
418  {
419  if (!(out_grouping(g_v, 97, 250)))
420  {
421  goto lab8;
422  }
423  goto golab7;
424  lab8:
425  if (cursor >= limit)
426  {
427  goto lab2;
428  }
429  cursor++;
430  }
431  golab7:
432  lab3:
433  goto lab1;
434  lab2:
435  cursor = v_2;
436  // (, line 53
437  if (!(out_grouping(g_v, 97, 250)))
438  {
439  goto lab0;
440  }
441  // or, line 53
442  v_6 = cursor;
443  // (, line 53
444  if (!(out_grouping(g_v, 97, 250)))
445  {
446  goto lab10;
447  }
448  // gopast, line 53
449  while (true)
450  {
451  if (!(in_grouping(g_v, 97, 250)))
452  {
453  goto lab12;
454  }
455  goto golab11;
456  lab12:
457  if (cursor >= limit)
458  {
459  goto lab10;
460  }
461  cursor++;
462  }
463  golab11:
464  goto lab9;
465  lab10:
466  cursor = v_6;
467  // (, line 53
468  if (!(in_grouping(g_v, 97, 250)))
469  {
470  goto lab0;
471  }
472  // next, line 53
473  if (cursor >= limit)
474  {
475  goto lab0;
476  }
477  cursor++;
478  lab9:
479  lab1:
480  // setmark pV, line 54
481  I_pV = cursor;
482  lab0:
483  cursor = v_1;
484  // do, line 56
485  v_8 = cursor;
486  // (, line 56
487  // gopast, line 57
488  while (true)
489  {
490  if (!(in_grouping(g_v, 97, 250)))
491  {
492  goto lab15;
493  }
494  goto golab14;
495  lab15:
496  if (cursor >= limit)
497  {
498  goto lab13;
499  }
500  cursor++;
501  }
502  golab14:
503  // gopast, line 57
504  while (true)
505  {
506  if (!(out_grouping(g_v, 97, 250)))
507  {
508  goto lab17;
509  }
510  goto golab16;
511  lab17:
512  if (cursor >= limit)
513  {
514  goto lab13;
515  }
516  cursor++;
517  }
518  golab16:
519  // setmark p1, line 57
520  I_p1 = cursor;
521  // gopast, line 58
522  while (true)
523  {
524  if (!(in_grouping(g_v, 97, 250)))
525  {
526  goto lab19;
527  }
528  goto golab18;
529  lab19:
530  if (cursor >= limit)
531  {
532  goto lab13;
533  }
534  cursor++;
535  }
536  golab18:
537  // gopast, line 58
538  while (true)
539  {
540  if (!(out_grouping(g_v, 97, 250)))
541  {
542  goto lab21;
543  }
544  goto golab20;
545  lab21:
546  if (cursor >= limit)
547  {
548  goto lab13;
549  }
550  cursor++;
551  }
552  golab20:
553  // setmark p2, line 58
554  I_p2 = cursor;
555  lab13:
556  cursor = v_8;
557  return true;
558  }
559 
560  private bool r_postlude()
561  {
562  int among_var;
563  int v_1;
564  // repeat, line 62
565  replab0:
566  v_1 = cursor;
567  // (, line 62
568  // [, line 63
569  bra = cursor;
570  // substring, line 63
571  among_var = find_among(a_1, 3);
572  if (among_var == 0)
573  {
574  goto lab1;
575  }
576  // ], line 63
577  ket = cursor;
578  switch (among_var)
579  {
580  case 0:
581  goto lab1;
582  case 1:
583  // (, line 64
584  // <-, line 64
585  slice_from("\u00E3");
586  break;
587  case 2:
588  // (, line 65
589  // <-, line 65
590  slice_from("\u00F5");
591  break;
592  case 3:
593  // (, line 66
594  // next, line 66
595  if (cursor >= limit)
596  {
597  goto lab1;
598  }
599  cursor++;
600  break;
601  }
602  goto replab0;
603  lab1:
604  cursor = v_1;
605  return true;
606  }
607 
608  private bool r_RV()
609  {
610  if (!(I_pV <= cursor))
611  {
612  return false;
613  }
614  return true;
615  }
616 
617  private bool r_R1()
618  {
619  if (!(I_p1 <= cursor))
620  {
621  return false;
622  }
623  return true;
624  }
625 
626  private bool r_R2()
627  {
628  if (!(I_p2 <= cursor))
629  {
630  return false;
631  }
632  return true;
633  }
634 
635  private bool r_standard_suffix()
636  {
637  int among_var;
638  int v_1;
639  int v_2;
640  int v_3;
641  int v_4;
642  // (, line 76
643  // [, line 77
644  ket = cursor;
645  // substring, line 77
646  among_var = find_among_b(a_5, 45);
647  if (among_var == 0)
648  {
649  return false;
650  }
651  // ], line 77
652  bra = cursor;
653  switch (among_var)
654  {
655  case 0:
656  return false;
657  case 1:
658  // (, line 92
659  // call R2, line 93
660  if (!r_R2())
661  {
662  return false;
663  }
664  // delete, line 93
665  slice_del();
666  break;
667  case 2:
668  // (, line 97
669  // call R2, line 98
670  if (!r_R2())
671  {
672  return false;
673  }
674  // <-, line 98
675  slice_from("log");
676  break;
677  case 3:
678  // (, line 101
679  // call R2, line 102
680  if (!r_R2())
681  {
682  return false;
683  }
684  // <-, line 102
685  slice_from("u");
686  break;
687  case 4:
688  // (, line 105
689  // call R2, line 106
690  if (!r_R2())
691  {
692  return false;
693  }
694  // <-, line 106
695  slice_from("ente");
696  break;
697  case 5:
698  // (, line 109
699  // call R1, line 110
700  if (!r_R1())
701  {
702  return false;
703  }
704  // delete, line 110
705  slice_del();
706  // try, line 111
707  v_1 = limit - cursor;
708  // (, line 111
709  // [, line 112
710  ket = cursor;
711  // substring, line 112
712  among_var = find_among_b(a_2, 4);
713  if (among_var == 0)
714  {
715  cursor = limit - v_1;
716  goto lab0;
717  }
718  // ], line 112
719  bra = cursor;
720  // call R2, line 112
721  if (!r_R2())
722  {
723  cursor = limit - v_1;
724  goto lab0;
725  }
726  // delete, line 112
727  slice_del();
728  switch (among_var)
729  {
730  case 0:
731  cursor = limit - v_1;
732  goto lab0;
733  case 1:
734  // (, line 113
735  // [, line 113
736  ket = cursor;
737  // literal, line 113
738  if (!(eq_s_b(2, "at")))
739  {
740  cursor = limit - v_1;
741  goto lab0;
742  }
743  // ], line 113
744  bra = cursor;
745  // call R2, line 113
746  if (!r_R2())
747  {
748  cursor = limit - v_1;
749  goto lab0;
750  }
751  // delete, line 113
752  slice_del();
753  break;
754  }
755  lab0:
756  break;
757  case 6:
758  // (, line 121
759  // call R2, line 122
760  if (!r_R2())
761  {
762  return false;
763  }
764  // delete, line 122
765  slice_del();
766  // try, line 123
767  v_2 = limit - cursor;
768  // (, line 123
769  // [, line 124
770  ket = cursor;
771  // substring, line 124
772  among_var = find_among_b(a_3, 3);
773  if (among_var == 0)
774  {
775  cursor = limit - v_2;
776  goto lab1;
777  }
778  // ], line 124
779  bra = cursor;
780  switch (among_var)
781  {
782  case 0:
783  cursor = limit - v_2;
784  goto lab1;
785  case 1:
786  // (, line 127
787  // call R2, line 127
788  if (!r_R2())
789  {
790  cursor = limit - v_2;
791  goto lab1;
792  }
793  // delete, line 127
794  slice_del();
795  break;
796  }
797  lab1:
798  break;
799  case 7:
800  // (, line 133
801  // call R2, line 134
802  if (!r_R2())
803  {
804  return false;
805  }
806  // delete, line 134
807  slice_del();
808  // try, line 135
809  v_3 = limit - cursor;
810  // (, line 135
811  // [, line 136
812  ket = cursor;
813  // substring, line 136
814  among_var = find_among_b(a_4, 3);
815  if (among_var == 0)
816  {
817  cursor = limit - v_3;
818  goto lab2;
819  }
820  // ], line 136
821  bra = cursor;
822  switch (among_var)
823  {
824  case 0:
825  cursor = limit - v_3;
826  goto lab2;
827  case 1:
828  // (, line 139
829  // call R2, line 139
830  if (!r_R2())
831  {
832  cursor = limit - v_3;
833  goto lab2;
834  }
835  // delete, line 139
836  slice_del();
837  break;
838  }
839  lab2:
840  break;
841  case 8:
842  // (, line 145
843  // call R2, line 146
844  if (!r_R2())
845  {
846  return false;
847  }
848  // delete, line 146
849  slice_del();
850  // try, line 147
851  v_4 = limit - cursor;
852  // (, line 147
853  // [, line 148
854  ket = cursor;
855  // literal, line 148
856  if (!(eq_s_b(2, "at")))
857  {
858  cursor = limit - v_4;
859  goto lab3;
860  }
861  // ], line 148
862  bra = cursor;
863  // call R2, line 148
864  if (!r_R2())
865  {
866  cursor = limit - v_4;
867  goto lab3;
868  }
869  // delete, line 148
870  slice_del();
871  lab3:
872  break;
873  case 9:
874  // (, line 152
875  // call RV, line 153
876  if (!r_RV())
877  {
878  return false;
879  }
880  // literal, line 153
881  if (!(eq_s_b(1, "e")))
882  {
883  return false;
884  }
885  // <-, line 154
886  slice_from("ir");
887  break;
888  }
889  return true;
890  }
891 
892  private bool r_verb_suffix()
893  {
894  int among_var;
895  int v_1;
896  int v_2;
897  // setlimit, line 159
898  v_1 = limit - cursor;
899  // tomark, line 159
900  if (cursor < I_pV)
901  {
902  return false;
903  }
904  cursor = I_pV;
905  v_2 = limit_backward;
906  limit_backward = cursor;
907  cursor = limit - v_1;
908  // (, line 159
909  // [, line 160
910  ket = cursor;
911  // substring, line 160
912  among_var = find_among_b(a_6, 120);
913  if (among_var == 0)
914  {
915  limit_backward = v_2;
916  return false;
917  }
918  // ], line 160
919  bra = cursor;
920  switch (among_var)
921  {
922  case 0:
923  limit_backward = v_2;
924  return false;
925  case 1:
926  // (, line 179
927  // delete, line 179
928  slice_del();
929  break;
930  }
931  limit_backward = v_2;
932  return true;
933  }
934 
935  private bool r_residual_suffix()
936  {
937  int among_var;
938  // (, line 183
939  // [, line 184
940  ket = cursor;
941  // substring, line 184
942  among_var = find_among_b(a_7, 7);
943  if (among_var == 0)
944  {
945  return false;
946  }
947  // ], line 184
948  bra = cursor;
949  switch (among_var)
950  {
951  case 0:
952  return false;
953  case 1:
954  // (, line 187
955  // call RV, line 187
956  if (!r_RV())
957  {
958  return false;
959  }
960  // delete, line 187
961  slice_del();
962  break;
963  }
964  return true;
965  }
966 
967  private bool r_residual_form()
968  {
969  int among_var;
970  int v_1;
971  int v_2;
972  int v_3;
973  // (, line 191
974  // [, line 192
975  ket = cursor;
976  // substring, line 192
977  among_var = find_among_b(a_8, 4);
978  if (among_var == 0)
979  {
980  return false;
981  }
982  // ], line 192
983  bra = cursor;
984  switch (among_var)
985  {
986  case 0:
987  return false;
988  case 1:
989  // (, line 194
990  // call RV, line 194
991  if (!r_RV())
992  {
993  return false;
994  }
995  // delete, line 194
996  slice_del();
997  // [, line 194
998  ket = cursor;
999  // or, line 194
1000  v_1 = limit - cursor;
1001  // (, line 194
1002  // literal, line 194
1003  if (!(eq_s_b(1, "u")))
1004  {
1005  goto lab1;
1006  }
1007  // ], line 194
1008  bra = cursor;
1009  // test, line 194
1010  v_2 = limit - cursor;
1011  // literal, line 194
1012  if (!(eq_s_b(1, "g")))
1013  {
1014  goto lab1;
1015  }
1016  cursor = limit - v_2;
1017  goto lab0;
1018  lab1:
1019  cursor = limit - v_1;
1020  // (, line 195
1021  // literal, line 195
1022  if (!(eq_s_b(1, "i")))
1023  {
1024  return false;
1025  }
1026  // ], line 195
1027  bra = cursor;
1028  // test, line 195
1029  v_3 = limit - cursor;
1030  // literal, line 195
1031  if (!(eq_s_b(1, "c")))
1032  {
1033  return false;
1034  }
1035  cursor = limit - v_3;
1036  lab0:
1037  // call RV, line 195
1038  if (!r_RV())
1039  {
1040  return false;
1041  }
1042  // delete, line 195
1043  slice_del();
1044  break;
1045  case 2:
1046  // (, line 196
1047  // <-, line 196
1048  slice_from("c");
1049  break;
1050  }
1051  return true;
1052  }
1053 
1054  public override bool Stem()
1055  {
1056  int v_1;
1057  int v_2;
1058  int v_3;
1059  int v_4;
1060  int v_5;
1061  int v_6;
1062  int v_7;
1063  int v_8;
1064  int v_9;
1065  int v_10;
1066  // (, line 201
1067  // do, line 202
1068  v_1 = cursor;
1069  // call prelude, line 202
1070  if (!r_prelude())
1071  {
1072  goto lab0;
1073  }
1074  lab0:
1075  cursor = v_1;
1076  // do, line 203
1077  v_2 = cursor;
1078  // call mark_regions, line 203
1079  if (!r_mark_regions())
1080  {
1081  goto lab1;
1082  }
1083  lab1:
1084  cursor = v_2;
1085  // backwards, line 204
1086  limit_backward = cursor; cursor = limit;
1087  // (, line 204
1088  // do, line 205
1089  v_3 = limit - cursor;
1090  // (, line 205
1091  // or, line 209
1092  v_4 = limit - cursor;
1093  // (, line 206
1094  // and, line 207
1095  v_5 = limit - cursor;
1096  // (, line 206
1097  // or, line 206
1098  v_6 = limit - cursor;
1099  // call standard_suffix, line 206
1100  if (!r_standard_suffix())
1101  {
1102  goto lab6;
1103  }
1104  goto lab5;
1105  lab6:
1106  cursor = limit - v_6;
1107  // call verb_suffix, line 206
1108  if (!r_verb_suffix())
1109  {
1110  goto lab4;
1111  }
1112  lab5:
1113  cursor = limit - v_5;
1114  // do, line 207
1115  v_7 = limit - cursor;
1116  // (, line 207
1117  // [, line 207
1118  ket = cursor;
1119  // literal, line 207
1120  if (!(eq_s_b(1, "i")))
1121  {
1122  goto lab7;
1123  }
1124  // ], line 207
1125  bra = cursor;
1126  // test, line 207
1127  v_8 = limit - cursor;
1128  // literal, line 207
1129  if (!(eq_s_b(1, "c")))
1130  {
1131  goto lab7;
1132  }
1133  cursor = limit - v_8;
1134  // call RV, line 207
1135  if (!r_RV())
1136  {
1137  goto lab7;
1138  }
1139  // delete, line 207
1140  slice_del();
1141  lab7:
1142  cursor = limit - v_7;
1143  goto lab3;
1144  lab4:
1145  cursor = limit - v_4;
1146  // call residual_suffix, line 209
1147  if (!r_residual_suffix())
1148  {
1149  goto lab2;
1150  }
1151  lab3:
1152  lab2:
1153  cursor = limit - v_3;
1154  // do, line 211
1155  v_9 = limit - cursor;
1156  // call residual_form, line 211
1157  if (!r_residual_form())
1158  {
1159  goto lab8;
1160  }
1161  lab8:
1162  cursor = limit - v_9;
1163  cursor = limit_backward;
1164  // do, line 213
1165  v_10 = cursor;
1166  // call postlude, line 213
1167  if (!r_postlude())
1168  {
1169  goto lab9;
1170  }
1171  lab9:
1172  cursor = v_10;
1173  return true;
1174  }
1175  }
1176 }