Coverage Report - org.tartarus.snowball.ext.danishStemmer
 
Classes in this File Line Coverage Branch Coverage Complexity
danishStemmer
0%
0/151
0%
0/60
7.556
 
 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 danishStemmer extends org.tartarus.snowball.SnowballStemmer {
 13  
 
 14  
 private static final long serialVersionUID = 1L;
 15  
 
 16  0
         private final static danishStemmer methodObject = new danishStemmer ();
 17  
 
 18  0
                 private final static Among a_0[] = {
 19  
                     new Among ( "hed", -1, 1, "", methodObject ),
 20  
                     new Among ( "ethed", 0, 1, "", methodObject ),
 21  
                     new Among ( "ered", -1, 1, "", methodObject ),
 22  
                     new Among ( "e", -1, 1, "", methodObject ),
 23  
                     new Among ( "erede", 3, 1, "", methodObject ),
 24  
                     new Among ( "ende", 3, 1, "", methodObject ),
 25  
                     new Among ( "erende", 5, 1, "", methodObject ),
 26  
                     new Among ( "ene", 3, 1, "", methodObject ),
 27  
                     new Among ( "erne", 3, 1, "", methodObject ),
 28  
                     new Among ( "ere", 3, 1, "", methodObject ),
 29  
                     new Among ( "en", -1, 1, "", methodObject ),
 30  
                     new Among ( "heden", 10, 1, "", methodObject ),
 31  
                     new Among ( "eren", 10, 1, "", methodObject ),
 32  
                     new Among ( "er", -1, 1, "", methodObject ),
 33  
                     new Among ( "heder", 13, 1, "", methodObject ),
 34  
                     new Among ( "erer", 13, 1, "", methodObject ),
 35  
                     new Among ( "s", -1, 2, "", methodObject ),
 36  
                     new Among ( "heds", 16, 1, "", methodObject ),
 37  
                     new Among ( "es", 16, 1, "", methodObject ),
 38  
                     new Among ( "endes", 18, 1, "", methodObject ),
 39  
                     new Among ( "erendes", 19, 1, "", methodObject ),
 40  
                     new Among ( "enes", 18, 1, "", methodObject ),
 41  
                     new Among ( "ernes", 18, 1, "", methodObject ),
 42  
                     new Among ( "eres", 18, 1, "", methodObject ),
 43  
                     new Among ( "ens", 16, 1, "", methodObject ),
 44  
                     new Among ( "hedens", 24, 1, "", methodObject ),
 45  
                     new Among ( "erens", 24, 1, "", methodObject ),
 46  
                     new Among ( "ers", 16, 1, "", methodObject ),
 47  
                     new Among ( "ets", 16, 1, "", methodObject ),
 48  
                     new Among ( "erets", 28, 1, "", methodObject ),
 49  
                     new Among ( "et", -1, 1, "", methodObject ),
 50  
                     new Among ( "eret", 30, 1, "", methodObject )
 51  
                 };
 52  
 
 53  0
                 private final static Among a_1[] = {
 54  
                     new Among ( "gd", -1, -1, "", methodObject ),
 55  
                     new Among ( "dt", -1, -1, "", methodObject ),
 56  
                     new Among ( "gt", -1, -1, "", methodObject ),
 57  
                     new Among ( "kt", -1, -1, "", methodObject )
 58  
                 };
 59  
 
 60  0
                 private final static Among a_2[] = {
 61  
                     new Among ( "ig", -1, 1, "", methodObject ),
 62  
                     new Among ( "lig", 0, 1, "", methodObject ),
 63  
                     new Among ( "elig", 1, 1, "", methodObject ),
 64  
                     new Among ( "els", -1, 1, "", methodObject ),
 65  
                     new Among ( "l\u00F8st", -1, 2, "", methodObject )
 66  
                 };
 67  
 
 68  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 };
 69  
 
 70  0
                 private static final char g_s_ending[] = {239, 254, 42, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 };
 71  
 
 72  
         private int I_x;
 73  
         private int I_p1;
 74  0
         private java.lang.StringBuilder S_ch = new java.lang.StringBuilder();
 75  
 
 76  
                 private void copy_from(danishStemmer other) {
 77  0
                     I_x = other.I_x;
 78  0
                     I_p1 = other.I_p1;
 79  0
                     S_ch = other.S_ch;
 80  0
                     super.copy_from(other);
 81  0
                 }
 82  
 
 83  
                 private boolean r_mark_regions() {
 84  
             int v_1;
 85  
             int v_2;
 86  
                     // (, line 29
 87  0
                     I_p1 = limit;
 88  
                     // test, line 33
 89  0
                     v_1 = cursor;
 90  
                     // (, line 33
 91  
                     // hop, line 33
 92  
                     {
 93  0
                         int c = cursor + 3;
 94  0
                         if (0 > c || c > limit)
 95  
                         {
 96  0
                             return false;
 97  
                         }
 98  0
                         cursor = c;
 99  
                     }
 100  
                     // setmark x, line 33
 101  0
                     I_x = cursor;
 102  0
                     cursor = v_1;
 103  
                     // goto, line 34
 104  
                     golab0: while(true)
 105  
                     {
 106  0
                         v_2 = cursor;
 107  
                         lab1: do {
 108  0
                             if (!(in_grouping(g_v, 97, 248)))
 109  
                             {
 110  0
                                 break lab1;
 111  
                             }
 112  0
                             cursor = v_2;
 113  0
                             break golab0;
 114  
                         } while (false);
 115  0
                         cursor = v_2;
 116  0
                         if (cursor >= limit)
 117  
                         {
 118  0
                             return false;
 119  
                         }
 120  0
                         cursor++;
 121  
                     }
 122  
                     // gopast, line 34
 123  
                     golab2: while(true)
 124  
                     {
 125  
                         lab3: do {
 126  0
                             if (!(out_grouping(g_v, 97, 248)))
 127  
                             {
 128  
                                 break lab3;
 129  
                             }
 130  
                             break golab2;
 131  
                         } while (false);
 132  0
                         if (cursor >= limit)
 133  
                         {
 134  0
                             return false;
 135  
                         }
 136  0
                         cursor++;
 137  
                     }
 138  
                     // setmark p1, line 34
 139  0
                     I_p1 = cursor;
 140  
                     // try, line 35
 141  
                     lab4: do {
 142  
                         // (, line 35
 143  0
                         if (!(I_p1 < I_x))
 144  
                         {
 145  0
                             break lab4;
 146  
                         }
 147  0
                         I_p1 = I_x;
 148  
                     } while (false);
 149  0
                     return true;
 150  
                 }
 151  
 
 152  
                 private boolean r_main_suffix() {
 153  
             int among_var;
 154  
             int v_1;
 155  
             int v_2;
 156  
                     // (, line 40
 157  
                     // setlimit, line 41
 158  0
                     v_1 = limit - cursor;
 159  
                     // tomark, line 41
 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 41
 169  
                     // [, line 41
 170  0
                     ket = cursor;
 171  
                     // substring, line 41
 172  0
                     among_var = find_among_b(a_0, 32);
 173  0
                     if (among_var == 0)
 174  
                     {
 175  0
                         limit_backward = v_2;
 176  0
                         return false;
 177  
                     }
 178  
                     // ], line 41
 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 48
 186  
                             // delete, line 48
 187  0
                             slice_del();
 188  0
                             break;
 189  
                         case 2:
 190  
                             // (, line 50
 191  0
                             if (!(in_grouping_b(g_s_ending, 97, 229)))
 192  
                             {
 193  0
                                 return false;
 194  
                             }
 195  
                             // delete, line 50
 196  0
                             slice_del();
 197  
                             break;
 198  
                     }
 199  0
                     return true;
 200  
                 }
 201  
 
 202  
                 private boolean r_consonant_pair() {
 203  
             int v_1;
 204  
             int v_2;
 205  
             int v_3;
 206  
                     // (, line 54
 207  
                     // test, line 55
 208  0
                     v_1 = limit - cursor;
 209  
                     // (, line 55
 210  
                     // setlimit, line 56
 211  0
                     v_2 = limit - cursor;
 212  
                     // tomark, line 56
 213  0
                     if (cursor < I_p1)
 214  
                     {
 215  0
                         return false;
 216  
                     }
 217  0
                     cursor = I_p1;
 218  0
                     v_3 = limit_backward;
 219  0
                     limit_backward = cursor;
 220  0
                     cursor = limit - v_2;
 221  
                     // (, line 56
 222  
                     // [, line 56
 223  0
                     ket = cursor;
 224  
                     // substring, line 56
 225  0
                     if (find_among_b(a_1, 4) == 0)
 226  
                     {
 227  0
                         limit_backward = v_3;
 228  0
                         return false;
 229  
                     }
 230  
                     // ], line 56
 231  0
                     bra = cursor;
 232  0
                     limit_backward = v_3;
 233  0
                     cursor = limit - v_1;
 234  
                     // next, line 62
 235  0
                     if (cursor <= limit_backward)
 236  
                     {
 237  0
                         return false;
 238  
                     }
 239  0
                     cursor--;
 240  
                     // ], line 62
 241  0
                     bra = cursor;
 242  
                     // delete, line 62
 243  0
                     slice_del();
 244  0
                     return true;
 245  
                 }
 246  
 
 247  
                 private boolean r_other_suffix() {
 248  
             int among_var;
 249  
             int v_1;
 250  
             int v_2;
 251  
             int v_3;
 252  
             int v_4;
 253  
                     // (, line 65
 254  
                     // do, line 66
 255  0
                     v_1 = limit - cursor;
 256  
                     lab0: do {
 257  
                         // (, line 66
 258  
                         // [, line 66
 259  0
                         ket = cursor;
 260  
                         // literal, line 66
 261  0
                         if (!(eq_s_b(2, "st")))
 262  
                         {
 263  0
                             break lab0;
 264  
                         }
 265  
                         // ], line 66
 266  0
                         bra = cursor;
 267  
                         // literal, line 66
 268  0
                         if (!(eq_s_b(2, "ig")))
 269  
                         {
 270  0
                             break lab0;
 271  
                         }
 272  
                         // delete, line 66
 273  0
                         slice_del();
 274  
                     } while (false);
 275  0
                     cursor = limit - v_1;
 276  
                     // setlimit, line 67
 277  0
                     v_2 = limit - cursor;
 278  
                     // tomark, line 67
 279  0
                     if (cursor < I_p1)
 280  
                     {
 281  0
                         return false;
 282  
                     }
 283  0
                     cursor = I_p1;
 284  0
                     v_3 = limit_backward;
 285  0
                     limit_backward = cursor;
 286  0
                     cursor = limit - v_2;
 287  
                     // (, line 67
 288  
                     // [, line 67
 289  0
                     ket = cursor;
 290  
                     // substring, line 67
 291  0
                     among_var = find_among_b(a_2, 5);
 292  0
                     if (among_var == 0)
 293  
                     {
 294  0
                         limit_backward = v_3;
 295  0
                         return false;
 296  
                     }
 297  
                     // ], line 67
 298  0
                     bra = cursor;
 299  0
                     limit_backward = v_3;
 300  0
                     switch(among_var) {
 301  
                         case 0:
 302  0
                             return false;
 303  
                         case 1:
 304  
                             // (, line 70
 305  
                             // delete, line 70
 306  0
                             slice_del();
 307  
                             // do, line 70
 308  0
                             v_4 = limit - cursor;
 309  
                             lab1: do {
 310  
                                 // call consonant_pair, line 70
 311  0
                                 if (!r_consonant_pair())
 312  
                                 {
 313  
                                     break lab1;
 314  
                                 }
 315  
                             } while (false);
 316  0
                             cursor = limit - v_4;
 317  0
                             break;
 318  
                         case 2:
 319  
                             // (, line 72
 320  
                             // <-, line 72
 321  0
                             slice_from("l\u00F8s");
 322  
                             break;
 323  
                     }
 324  0
                     return true;
 325  
                 }
 326  
 
 327  
                 private boolean r_undouble() {
 328  
             int v_1;
 329  
             int v_2;
 330  
                     // (, line 75
 331  
                     // setlimit, line 76
 332  0
                     v_1 = limit - cursor;
 333  
                     // tomark, line 76
 334  0
                     if (cursor < I_p1)
 335  
                     {
 336  0
                         return false;
 337  
                     }
 338  0
                     cursor = I_p1;
 339  0
                     v_2 = limit_backward;
 340  0
                     limit_backward = cursor;
 341  0
                     cursor = limit - v_1;
 342  
                     // (, line 76
 343  
                     // [, line 76
 344  0
                     ket = cursor;
 345  0
                     if (!(out_grouping_b(g_v, 97, 248)))
 346  
                     {
 347  0
                         limit_backward = v_2;
 348  0
                         return false;
 349  
                     }
 350  
                     // ], line 76
 351  0
                     bra = cursor;
 352  
                     // -> ch, line 76
 353  0
                     S_ch = slice_to(S_ch);
 354  0
                     limit_backward = v_2;
 355  
                     // name ch, line 77
 356  0
                     if (!(eq_v_b(S_ch)))
 357  
                     {
 358  0
                         return false;
 359  
                     }
 360  
                     // delete, line 78
 361  0
                     slice_del();
 362  0
                     return true;
 363  
                 }
 364  
 
 365  
                 public boolean stem() {
 366  
             int v_1;
 367  
             int v_2;
 368  
             int v_3;
 369  
             int v_4;
 370  
             int v_5;
 371  
                     // (, line 82
 372  
                     // do, line 84
 373  0
                     v_1 = cursor;
 374  
                     lab0: do {
 375  
                         // call mark_regions, line 84
 376  0
                         if (!r_mark_regions())
 377  
                         {
 378  
                             break lab0;
 379  
                         }
 380  
                     } while (false);
 381  0
                     cursor = v_1;
 382  
                     // backwards, line 85
 383  0
                     limit_backward = cursor; cursor = limit;
 384  
                     // (, line 85
 385  
                     // do, line 86
 386  0
                     v_2 = limit - cursor;
 387  
                     lab1: do {
 388  
                         // call main_suffix, line 86
 389  0
                         if (!r_main_suffix())
 390  
                         {
 391  
                             break lab1;
 392  
                         }
 393  
                     } while (false);
 394  0
                     cursor = limit - v_2;
 395  
                     // do, line 87
 396  0
                     v_3 = limit - cursor;
 397  
                     lab2: do {
 398  
                         // call consonant_pair, line 87
 399  0
                         if (!r_consonant_pair())
 400  
                         {
 401  
                             break lab2;
 402  
                         }
 403  
                     } while (false);
 404  0
                     cursor = limit - v_3;
 405  
                     // do, line 88
 406  0
                     v_4 = limit - cursor;
 407  
                     lab3: do {
 408  
                         // call other_suffix, line 88
 409  0
                         if (!r_other_suffix())
 410  
                         {
 411  
                             break lab3;
 412  
                         }
 413  
                     } while (false);
 414  0
                     cursor = limit - v_4;
 415  
                     // do, line 89
 416  0
                     v_5 = limit - cursor;
 417  
                     lab4: do {
 418  
                         // call undouble, line 89
 419  0
                         if (!r_undouble())
 420  
                         {
 421  
                             break lab4;
 422  
                         }
 423  
                     } while (false);
 424  0
                     cursor = limit - v_5;
 425  0
                     cursor = limit_backward;                    return true;
 426  
                 }
 427  
 
 428  
         public boolean equals( Object o ) {
 429  0
             return o instanceof danishStemmer;
 430  
         }
 431  
 
 432  
         public int hashCode() {
 433  0
             return danishStemmer.class.getName().hashCode();
 434  
         }
 435  
 
 436  
 
 437  
 
 438  
 }
 439