FileDocCategorySizeDatePackage
NorwegianStemmer.javaAPI DocApache Lucene 1.99722Mon Feb 20 09:17:48 GMT 2006net.sf.snowball.ext

NorwegianStemmer

public class NorwegianStemmer extends net.sf.snowball.SnowballProgram
Generated class implementing code defined by a snowball script.

Fields Summary
private net.sf.snowball.Among[]
a_0
private net.sf.snowball.Among[]
a_1
private net.sf.snowball.Among[]
a_2
private static final char[]
g_v
private static final char[]
g_s_ending
private int
I_p1
Constructors Summary
Methods Summary
private voidcopy_from(net.sf.snowball.ext.NorwegianStemmer other)


            
            I_p1 = other.I_p1;
            super.copy_from(other);
        
private booleanr_consonant_pair()

            int v_1;
            int v_2;
            int v_3;
            // (, line 51
            // test, line 52
            v_1 = limit - cursor;
            // (, line 52
            // setlimit, line 53
            v_2 = limit - cursor;
            // tomark, line 53
            if (cursor < I_p1)
            {
                return false;
            }
            cursor = I_p1;
            v_3 = limit_backward;
            limit_backward = cursor;
            cursor = limit - v_2;
            // (, line 53
            // [, line 53
            ket = cursor;
            // substring, line 53
            if (find_among_b(a_1, 2) == 0)
            {
                limit_backward = v_3;
                return false;
            }
            // ], line 53
            bra = cursor;
            limit_backward = v_3;
            cursor = limit - v_1;
            // next, line 58
            if (cursor <= limit_backward)
            {
                return false;
            }
            cursor--;
            // ], line 58
            bra = cursor;
            // delete, line 58
            slice_del();
            return true;
        
private booleanr_main_suffix()

            int among_var;
            int v_1;
            int v_2;
            // (, line 36
            // setlimit, line 37
            v_1 = limit - cursor;
            // tomark, line 37
            if (cursor < I_p1)
            {
                return false;
            }
            cursor = I_p1;
            v_2 = limit_backward;
            limit_backward = cursor;
            cursor = limit - v_1;
            // (, line 37
            // [, line 37
            ket = cursor;
            // substring, line 37
            among_var = find_among_b(a_0, 29);
            if (among_var == 0)
            {
                limit_backward = v_2;
                return false;
            }
            // ], line 37
            bra = cursor;
            limit_backward = v_2;
            switch(among_var) {
                case 0:
                    return false;
                case 1:
                    // (, line 43
                    // delete, line 43
                    slice_del();
                    break;
                case 2:
                    // (, line 45
                    if (!(in_grouping_b(g_s_ending, 98, 122)))
                    {
                        return false;
                    }
                    // delete, line 45
                    slice_del();
                    break;
                case 3:
                    // (, line 47
                    // <-, line 47
                    slice_from("er");
                    break;
            }
            return true;
        
private booleanr_mark_regions()

            int v_1;
            // (, line 26
            I_p1 = limit;
            // goto, line 30
            golab0: while(true)
            {
                v_1 = cursor;
                lab1: do {
                    if (!(in_grouping(g_v, 97, 248)))
                    {
                        break lab1;
                    }
                    cursor = v_1;
                    break golab0;
                } while (false);
                cursor = v_1;
                if (cursor >= limit)
                {
                    return false;
                }
                cursor++;
            }
            // gopast, line 30
            golab2: while(true)
            {
                lab3: do {
                    if (!(out_grouping(g_v, 97, 248)))
                    {
                        break lab3;
                    }
                    break golab2;
                } while (false);
                if (cursor >= limit)
                {
                    return false;
                }
                cursor++;
            }
            // setmark p1, line 30
            I_p1 = cursor;
            // try, line 31
            lab4: do {
                // (, line 31
                if (!(I_p1 < 3))
                {
                    break lab4;
                }
                I_p1 = 3;
            } while (false);
            return true;
        
private booleanr_other_suffix()

            int among_var;
            int v_1;
            int v_2;
            // (, line 61
            // setlimit, line 62
            v_1 = limit - cursor;
            // tomark, line 62
            if (cursor < I_p1)
            {
                return false;
            }
            cursor = I_p1;
            v_2 = limit_backward;
            limit_backward = cursor;
            cursor = limit - v_1;
            // (, line 62
            // [, line 62
            ket = cursor;
            // substring, line 62
            among_var = find_among_b(a_2, 11);
            if (among_var == 0)
            {
                limit_backward = v_2;
                return false;
            }
            // ], line 62
            bra = cursor;
            limit_backward = v_2;
            switch(among_var) {
                case 0:
                    return false;
                case 1:
                    // (, line 66
                    // delete, line 66
                    slice_del();
                    break;
            }
            return true;
        
public booleanstem()

            int v_1;
            int v_2;
            int v_3;
            int v_4;
            // (, line 71
            // do, line 73
            v_1 = cursor;
            lab0: do {
                // call mark_regions, line 73
                if (!r_mark_regions())
                {
                    break lab0;
                }
            } while (false);
            cursor = v_1;
            // backwards, line 74
            limit_backward = cursor; cursor = limit;
            // (, line 74
            // do, line 75
            v_2 = limit - cursor;
            lab1: do {
                // call main_suffix, line 75
                if (!r_main_suffix())
                {
                    break lab1;
                }
            } while (false);
            cursor = limit - v_2;
            // do, line 76
            v_3 = limit - cursor;
            lab2: do {
                // call consonant_pair, line 76
                if (!r_consonant_pair())
                {
                    break lab2;
                }
            } while (false);
            cursor = limit - v_3;
            // do, line 77
            v_4 = limit - cursor;
            lab3: do {
                // call other_suffix, line 77
                if (!r_other_suffix())
                {
                    break lab3;
                }
            } while (false);
            cursor = limit - v_4;
            cursor = limit_backward;            return true;