src/main/java/com/hankcs/lucene/PorterStemmer.java
private void step5()
    {
        if (k == k0) return; /* for Bug 1 */
        switch (b[k - 1])
        {
            case 'a':
                if (ends("al")) break;
                return;
            case 'c':
                if (ends("ance")) break;
                if (ends("ence")) break;
                return;
            case 'e':
                if (ends("er")) break;
                return;
            case 'i':
                if (ends("ic")) break;
                return;
            case 'l':
                if (ends("able")) break;
                if (ends("ible")) break;
                return;
            case 'n':
                if (ends("ant")) break;
                if (ends("ement")) break;
                if (ends("ment")) break;
                /* element etc. not stripped before the m */
                if (ends("ent")) break;
                return;
            case 'o':
                if (ends("ion") && j >= 0 && (b[j] == 's' || b[j] == 't')) break;
                /* j >= 0 fixes Bug 2 */
                if (ends("ou")) break;
                return;
            /* takes care of -ous */
            case 's':
                if (ends("ism")) break;
                return;
            case 't':
                if (ends("ate")) break;
                if (ends("iti")) break;
                return;
            case 'u':
                if (ends("ous")) break;
                return;
            case 'v':
                if (ends("ive")) break;
                return;
            case 'z':
                if (ends("ize")) break;
                return;
            default:
                return;
        }
        if (m() > 1) k = j;
    }
private void step5()
    {
        if (k == k0) return; /* for Bug 1 */
        switch (b[k - 1])
        {
            case 'a':
                if (ends("al")) break;
                return;
            case 'c':
                if (ends("ance")) break;
                if (ends("ence")) break;
                return;
            case 'e':
                if (ends("er")) break;
                return;
            case 'i':
                if (ends("ic")) break;
                return;
            case 'l':
                if (ends("able")) break;
                if (ends("ible")) break;
                return;
            case 'n':
                if (ends("ant")) break;
                if (ends("ement")) break;
                if (ends("ment")) break;
                /* element etc. not stripped before the m */
                if (ends("ent")) break;
                return;
            case 'o':
                if (ends("ion") && j >= 0 && (b[j] == 's' || b[j] == 't')) break;
                /* j >= 0 fixes Bug 2 */
                if (ends("ou")) break;
                return;
            /* takes care of -ous */
            case 's':
                if (ends("ism")) break;
                return;
            case 't':
                if (ends("ate")) break;
                if (ends("iti")) break;
                return;
            case 'u':
                if (ends("ous")) break;
                return;
            case 'v':
                if (ends("ive")) break;
                return;
            case 'z':
                if (ends("ize")) break;
                return;
            default:
                return;
        }
        if (m() > 1) k = j;
    }
private void step5 ( ) { if ( k == k0 ) return ; /* for Bug 1 */ switch ( b [ k - 1 ] ) { case ' ' : if ( ends ( "al" ) ) break ; return ; case ' ' : if ( ends ( "ance" ) ) break ; if ( ends ( "ence" ) ) break ; return ; case ' ' : if ( ends ( "er" ) ) break ; return ; case ' ' : if ( ends ( "ic" ) ) break ; return ; case ' ' : if ( ends ( "able" ) ) break ; if ( ends ( "ible" ) ) break ; return ; case ' ' : if ( ends ( "ant" ) ) break ; if ( ends ( "ement" ) ) break ; if ( ends ( "ment" ) ) break ; /* element etc. not stripped before the m */ if ( ends ( "ent" ) ) break ; return ; case ' ' : if ( ends ( "ion" ) && j >= 0 && ( b [ j ] == ' ' || b [ j ] == ' ' ) ) break ; /* j >= 0 fixes Bug 2 */ if ( ends ( "ou" ) ) break ; return ; /* takes care of -ous */ case ' ' : if ( ends ( "ism" ) ) break ; return ; case ' ' : if ( ends ( "ate" ) ) break ; if ( ends ( "iti" ) ) break ; return ; case ' ' : if ( ends ( "ous" ) ) break ; return ; case ' ' : if ( ends ( "ive" ) ) break ; return ; case ' ' : if ( ends ( "ize" ) ) break ; return ; default : return ; } if ( m ( ) > 1 ) k = j ; }
/* step5() takes off -ant, -ence etc., in context <c>vcvc<v>.
/ * step5 () takes off - ant - ence etc . in context <c > vcvc<v > .