protected String nextLatinString ( int c ) throws IOException { isb . clear ( ) ; if ( c > 65280 ) c -= 65248 ; if ( c >= 65 && c <= 90 ) c += 32 ; isb . append ( ( char ) c ) ; int ch ; int _ctype = 0 ; ctrlMask &= ~ ISegment . CHECK_EC_MASK ; while ( ( ch = readNext ( ) ) != - 1 ) { //Covert the full-width char to half-width char. if ( ch > 65280 ) ch -= 65248 ; _ctype = StringUtil . getEnCharType ( ch ) ; //Whitespace check. if ( _ctype == StringUtil . EN_WHITESPACE ) { break ; } //English punctuation check. if ( _ctype == StringUtil . EN_PUNCTUATION ) { if ( ! config . isKeepPunctuation ( ( char ) ch ) ) { pushBack ( ch ) ; break ; } } //Not EN_KNOW, and it could be letter, numeric. if ( _ctype == StringUtil . EN_UNKNOW ) { pushBack ( ch ) ; if ( StringUtil . isCJKChar ( ch ) ) { ctrlMask |= ISegment . CHECK_EC_MASK ; } break ; } //covert the lower case letter to upper case. if ( ch >= 65 && ch <= 90 ) ch += 32 ; isb . append ( ( char ) ch ) ; /* * global English word length limitation */ if ( isb . length ( ) > config . MAX_LATIN_LENGTH ) { break ; } } /* * check and remove the dot punctuation after it */ for ( int j = isb . length ( ) - 1 ; j > 0 ; j -- ) { if ( isb . charAt ( j ) == ' ' ) { isb . deleteCharAt ( j ) ; } } return isb . toString ( ) ; }
the simple version of the next basic Latin fetch logic Just return the next Latin string with the keep punctuation after it