Coverage Report - org.tartarus.snowball.ext.norwegianStemmer
 
Classes in this File Line Coverage Branch Coverage Complexity
norwegianStemmer
0%
0/121
0%
0/50
7.375
 
 1  
 // This file was generated automatically by the Snowball to Java compiler
 2  
 
 3  
 package org.tartarus.snowball.ext;
 4  
 
 5  
 import org.tartarus.snowball.Among;
 6  
 
 7  
  /**
 8  
   * This class was automatically generated by a Snowball to Java compiler 
 9  
   * It implements the stemming algorithm defined by a snowball script.
 10  
   */
 11  
 
 12  0
 public class norwegianStemmer extends org.tartarus.snowball.SnowballStemmer {
 13  
 
 14  
 private static final long serialVersionUID = 1L;
 15  
 
 16  0
         private final static norwegianStemmer methodObject = new norwegianStemmer ();
 17  
 
 18  0
                 private final static Among a_0[] = {
 19  
                     new Among ( "a", -1, 1, "", methodObject ),
 20  
                     new Among ( "e", -1, 1, "", methodObject ),
 21  
                     new Among ( "ede", 1, 1, "", methodObject ),
 22  
                     new Among ( "ande", 1, 1, "", methodObject ),
 23  
                     new Among ( "ende", 1, 1, "", methodObject ),
 24  
                     new Among ( "ane", 1, 1, "", methodObject ),
 25  
                     new Among ( "ene", 1, 1, "", methodObject ),
 26  
                     new Among ( "hetene", 6, 1, "", methodObject ),
 27  
                     new Among ( "erte", 1, 3, "", methodObject ),
 28  
                     new Among ( "en", -1, 1, "", methodObject ),
 29  
                     new Among ( "heten", 9, 1, "", methodObject ),
 30  
                     new Among ( "ar", -1, 1, "", methodObject ),
 31  
                     new Among ( "er", -1, 1, "", methodObject ),
 32  
                     new Among ( "heter", 12, 1, "", methodObject ),
 33  
                     new Among ( "s", -1, 2, "", methodObject ),
 34  
                     new Among ( "as", 14, 1, "", methodObject ),
 35  
                     new Among ( "es", 14, 1, "", methodObject ),
 36  
                     new Among ( "edes", 16, 1, "", methodObject ),
 37  
                     new Among ( "endes", 16, 1, "", methodObject ),
 38  
                     new Among ( "enes", 16, 1, "", methodObject ),
 39  
                     new Among ( "hetenes", 19, 1, "", methodObject ),
 40  
                     new Among ( "ens", 14, 1, "", methodObject ),
 41  
                     new Among ( "hetens", 21, 1, "", methodObject ),
 42  
                     new Among ( "ers", 14, 1, "", methodObject ),
 43  
                     new Among ( "ets", 14, 1, "", methodObject ),
 44  
                     new Among ( "et", -1, 1, "", methodObject ),
 45  
                     new Among ( "het", 25, 1, "", methodObject ),
 46  
                     new Among ( "ert", -1, 3, "", methodObject ),
 47  
                     new Among ( "ast", -1, 1, "", methodObject )
 48  
                 };
 49  
 
 50  0
                 private final static Among a_1[] = {
 51  
                     new Among ( "dt", -1, -1, "", methodObject ),
 52  
                     new Among ( "vt", -1, -1, "", methodObject )
 53  
                 };
 54  
 
 55  0
                 private final static Among a_2[] = {
 56  
                     new Among ( "leg", -1, 1, "", methodObject ),
 57  
                     new Among ( "eleg", 0, 1, "", methodObject ),
 58  
                     new Among ( "ig", -1, 1, "", methodObject ),
 59  
                     new Among ( "eig", 2, 1, "", methodObject ),
 60  
                     new Among ( "lig", 2, 1, "", methodObject ),
 61  
                     new Among ( "elig", 4, 1, "", methodObject ),
 62  
                     new Among ( "els", -1, 1, "", methodObject ),
 63  
                     new Among ( "lov", -1, 1, "", methodObject ),
 64  
                     new Among ( "elov", 7, 1, "", methodObject ),
 65  
                     new Among ( "slov", 7, 1, "", methodObject ),
 66  
                     new Among ( "hetslov", 9, 1, "", methodObject )
 67  
                 };
 68  
 
 69  0
                 private static final char g_v[] = {17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128 };
 70  
 
 71  0
                 private static final char g_s_ending[] = {119, 125, 149, 1 };
 72  
 
 73  
         private int I_x;
 74  
         private int I_p1;
 75  
 
 76  
                 private void copy_from(norwegianStemmer other) {
 77  0
                     I_x = other.I_x;
 78  0
                     I_p1 = other.I_p1;
 79  0
                     super.copy_from(other);
 80  0
                 }
 81  
 
 82  
                 private boolean r_mark_regions() {
 83  
             int v_1;
 84  
             int v_2;
 85  
                     // (, line 26
 86  0
                     I_p1 = limit;
 87  
                     // test, line 30
 88  0
                     v_1 = cursor;
 89  
                     // (, line 30
 90  
                     // hop, line 30
 91  
                     {
 92  0
                         int c = cursor + 3;
 93  0
                         if (0 > c || c > limit)
 94  
                         {
 95  0
                             return false;
 96  
                         }
 97  0
                         cursor = c;
 98  
                     }
 99  
                     // setmark x, line 30
 100  0
                     I_x = cursor;
 101  0
                     cursor = v_1;
 102  
                     // goto, line 31
 103  
                     golab0: while(true)
 104  
                     {
 105  0
                         v_2 = cursor;
 106  
                         lab1: do {
 107  0
                             if (!(in_grouping(g_v, 97, 248)))
 108  
                             {
 109  0
                                 break lab1;
 110  
                             }
 111  0
                             cursor = v_2;
 112  0
                             break golab0;
 113  
                         } while (false);
 114  0
                         cursor = v_2;
 115  0
                         if (cursor >= limit)
 116  
                         {
 117  0
                             return false;
 118  
                         }
 119  0
                         cursor++;
 120  
                     }
 121  
                     // gopast, line 31
 122  
                     golab2: while(true)
 123  
                     {
 124  
                         lab3: do {
 125  0
                             if (!(out_grouping(g_v, 97, 248)))
 126  
                             {
 127  
                                 break lab3;
 128  
                             }
 129  
                             break golab2;
 130  
                         } while (false);
 131  0
                         if (cursor >= limit)
 132  
                         {
 133  0
                             return false;
 134  
                         }
 135  0
                         cursor++;
 136  
                     }
 137  
                     // setmark p1, line 31
 138  0
                     I_p1 = cursor;
 139  
                     // try, line 32
 140  
                     lab4: do {
 141  
                         // (, line 32
 142  0
                         if (!(I_p1 < I_x))
 143  
                         {
 144  0
                             break lab4;
 145  
                         }
 146  0
                         I_p1 = I_x;
 147  
                     } while (false);
 148  0
                     return true;
 149  
                 }
 150  
 
 151  
                 private boolean r_main_suffix() {
 152  
             int among_var;
 153  
             int v_1;
 154  
             int v_2;
 155  
             int v_3;
 156  
                     // (, line 37
 157  
                     // setlimit, line 38
 158  0
                     v_1 = limit - cursor;
 159  
                     // tomark, line 38
 160  0
                     if (cursor < I_p1)
 161  
                     {
 162  0
                         return false;
 163  
                     }
 164  0
                     cursor = I_p1;
 165  0
                     v_2 = limit_backward;
 166  0
                     limit_backward = cursor;
 167  0
                     cursor = limit - v_1;
 168  
                     // (, line 38
 169  
                     // [, line 38
 170  0
                     ket = cursor;
 171  
                     // substring, line 38
 172  0
                     among_var = find_among_b(a_0, 29);
 173  0
                     if (among_var == 0)
 174  
                     {
 175  0
                         limit_backward = v_2;
 176  0
                         return false;
 177  
                     }
 178  
                     // ], line 38
 179  0
                     bra = cursor;
 180  0
                     limit_backward = v_2;
 181  0
                     switch(among_var) {
 182  
                         case 0:
 183  0
                             return false;
 184  
                         case 1:
 185  
                             // (, line 44
 186  
                             // delete, line 44
 187  0
                             slice_del();
 188  0
                             break;
 189  
                         case 2:
 190  
                             // (, line 46
 191  
                             // or, line 46
 192  
                             lab0: do {
 193  0
                                 v_3 = limit - cursor;
 194  
                                 lab1: do {
 195  0
                                     if (!(in_grouping_b(g_s_ending, 98, 122)))
 196  
                                     {
 197  
                                         break lab1;
 198  
                                     }
 199  
                                     break lab0;
 200  
                                 } while (false);
 201  0
                                 cursor = limit - v_3;
 202  
                                 // (, line 46
 203  
                                 // literal, line 46
 204  0
                                 if (!(eq_s_b(1, "k")))
 205  
                                 {
 206  0
                                     return false;
 207  
                                 }
 208  0
                                 if (!(out_grouping_b(g_v, 97, 248)))
 209  
                                 {
 210  0
                                     return false;
 211  
                                 }
 212  
                             } while (false);
 213  
                             // delete, line 46
 214  0
                             slice_del();
 215  0
                             break;
 216  
                         case 3:
 217  
                             // (, line 48
 218  
                             // <-, line 48
 219  0
                             slice_from("er");
 220  
                             break;
 221  
                     }
 222  0
                     return true;
 223  
                 }
 224  
 
 225  
                 private boolean r_consonant_pair() {
 226  
             int v_1;
 227  
             int v_2;
 228  
             int v_3;
 229  
                     // (, line 52
 230  
                     // test, line 53
 231  0
                     v_1 = limit - cursor;
 232  
                     // (, line 53
 233  
                     // setlimit, line 54
 234  0
                     v_2 = limit - cursor;
 235  
                     // tomark, line 54
 236  0
                     if (cursor < I_p1)
 237  
                     {
 238  0
                         return false;
 239  
                     }
 240  0
                     cursor = I_p1;
 241  0
                     v_3 = limit_backward;
 242  0
                     limit_backward = cursor;
 243  0
                     cursor = limit - v_2;
 244  
                     // (, line 54
 245  
                     // [, line 54
 246  0
                     ket = cursor;
 247  
                     // substring, line 54
 248  0
                     if (find_among_b(a_1, 2) == 0)
 249  
                     {
 250  0
                         limit_backward = v_3;
 251  0
                         return false;
 252  
                     }
 253  
                     // ], line 54
 254  0
                     bra = cursor;
 255  0
                     limit_backward = v_3;
 256  0
                     cursor = limit - v_1;
 257  
                     // next, line 59
 258  0
                     if (cursor <= limit_backward)
 259  
                     {
 260  0
                         return false;
 261  
                     }
 262  0
                     cursor--;
 263  
                     // ], line 59
 264  0
                     bra = cursor;
 265  
                     // delete, line 59
 266  0
                     slice_del();
 267  0
                     return true;
 268  
                 }
 269  
 
 270  
                 private boolean r_other_suffix() {
 271  
             int among_var;
 272  
             int v_1;
 273  
             int v_2;
 274  
                     // (, line 62
 275  
                     // setlimit, line 63
 276  0
                     v_1 = limit - cursor;
 277  
                     // tomark, line 63
 278  0
                     if (cursor < I_p1)
 279  
                     {
 280  0
                         return false;
 281  
                     }
 282  0
                     cursor = I_p1;
 283  0
                     v_2 = limit_backward;
 284  0
                     limit_backward = cursor;
 285  0
                     cursor = limit - v_1;
 286  
                     // (, line 63
 287  
                     // [, line 63
 288  0
                     ket = cursor;
 289  
                     // substring, line 63
 290  0
                     among_var = find_among_b(a_2, 11);
 291  0
                     if (among_var == 0)
 292  
                     {
 293  0
                         limit_backward = v_2;
 294  0
                         return false;
 295  
                     }
 296  
                     // ], line 63
 297  0
                     bra = cursor;
 298  0
                     limit_backward = v_2;
 299  0
                     switch(among_var) {
 300  
                         case 0:
 301  0
                             return false;
 302  
                         case 1:
 303  
                             // (, line 67
 304  
                             // delete, line 67
 305  0
                             slice_del();
 306  
                             break;
 307  
                     }
 308  0
                     return true;
 309  
                 }
 310  
 
 311  
                 public boolean stem() {
 312  
             int v_1;
 313  
             int v_2;
 314  
             int v_3;
 315  
             int v_4;
 316  
                     // (, line 72
 317  
                     // do, line 74
 318  0
                     v_1 = cursor;
 319  
                     lab0: do {
 320  
                         // call mark_regions, line 74
 321  0
                         if (!r_mark_regions())
 322  
                         {
 323  
                             break lab0;
 324  
                         }
 325  
                     } while (false);
 326  0
                     cursor = v_1;
 327  
                     // backwards, line 75
 328  0
                     limit_backward = cursor; cursor = limit;
 329  
                     // (, line 75
 330  
                     // do, line 76
 331  0
                     v_2 = limit - cursor;
 332  
                     lab1: do {
 333  
                         // call main_suffix, line 76
 334  0
                         if (!r_main_suffix())
 335  
                         {
 336  
                             break lab1;
 337  
                         }
 338  
                     } while (false);
 339  0
                     cursor = limit - v_2;
 340  
                     // do, line 77
 341  0
                     v_3 = limit - cursor;
 342  
                     lab2: do {
 343  
                         // call consonant_pair, line 77
 344  0
                         if (!r_consonant_pair())
 345  
                         {
 346  
                             break lab2;
 347  
                         }
 348  
                     } while (false);
 349  0
                     cursor = limit - v_3;
 350  
                     // do, line 78
 351  0
                     v_4 = limit - cursor;
 352  
                     lab3: do {
 353  
                         // call other_suffix, line 78
 354  0
                         if (!r_other_suffix())
 355  
                         {
 356  
                             break lab3;
 357  
                         }
 358  
                     } while (false);
 359  0
                     cursor = limit - v_4;
 360  0
                     cursor = limit_backward;                    return true;
 361  
                 }
 362  
 
 363  
         public boolean equals( Object o ) {
 364  0
             return o instanceof norwegianStemmer;
 365  
         }
 366  
 
 367  
         public int hashCode() {
 368  0
             return norwegianStemmer.class.getName().hashCode();
 369  
         }
 370  
 
 371  
 
 372  
 
 373  
 }
 374