protected String nextCNNumeric ( char [ ] chars , int index ) throws IOException { //StringBuilder isb = new StringBuilder(); isb . clear ( ) ; isb . append ( chars [ index ] ) ; ctrlMask &= ~ ISegment . CHECK_CF_MASK ; //reset the fraction check mask. for ( int j = index + 1 ; j < chars . length ; j ++ ) { /* * check and deal with '分之' if the * current char is not a Chinese numeric. * (try to recognize a Chinese fraction) * * @added 2013-12-14 */ if ( NumericUtil . isCNNumeric ( chars [ j ] ) == - 1 ) { if ( j + 2 < chars . length && chars [ j ] == ' && chars [ j + 1 ] == ' /* check and make sure chars[j+2] is a chinese numeric. * or error will happen on situation like '四六分之' . * @added 2013-12-14 */ && NumericUtil . isCNNumeric ( chars [ j + 2 ] ) != - 1 ) { isb . append ( chars [ j ++ ] ) ; isb . append ( chars [ j ++ ] ) ; isb . append ( chars [ j ] ) ; //set the chinese fraction check mask. ctrlMask |= ISegment . CHECK_CF_MASK ; continue ; } else { break ; } } //append the buffer. isb . append ( chars [ j ] ) ; } return isb . toString ( ) ; }
find the Chinese number from the current position count until the char in the specified position is not a other number or whitespace