private String stem ( int del , String add , String affix ) { int stem_length = yylength ( ) - del ; int i = 0 ; String result = yytext ( ) . substring ( 0 , stem_length ) ; if ( option ( change_case ) ) { result = result . toLowerCase ( ) ; } if ( ! ( add . length ( ) == 0 ) ) result += add ; if ( option ( print_affixes ) ) { result += ( "+" + affix ) ; } return result ; }
Delete del letters from end of token and append string add to give stem . Return affix as the affix of the word .