protected String getPairPunctuationText( int c ) throws IOException 
    {
        //StringBuilder isb = new StringBuilder();
        isb.clear();
        char echar = StringUtil.getPunctuationPair( (char) c);
        boolean matched = false;
        int j, ch;
        
        //replaced with IntArrayList at 2013-09-08
        //ArrayList<Integer> chArr = new ArrayList<Integer>(config.PPT_MAX_LENGTH);
        ialist.clear();
        
        for ( j = 0; j < config.PPT_MAX_LENGTH; j++ ) {
            ch = readNext();
            if ( ch == -1 ) break;
            if ( ch == echar ) {
                matched = true;
                pushBack(ch);        //push the pair punc back.
                break;
            }
            
            isb.append( (char) ch );
            ialist.add(ch);
        }
        
        if ( matched == false ) {
            for ( int i = j - 1; i >= 0; i-- ) 
                pushBack( ialist.get(i) );
            return null;
        }
        
        return isb.toString();
    }
    
    /**
     * an abstract method to gain a CJK word from the 
     * current position. simpleSeg and ComplexSeg is different to deal this, 
     * so make it a abstract method here
     * 
     * @param  chars
     * @param  index
     * @return IChunk
     * @throws IOException
     */
    protected abstract IChunk getBestCJKChunk(char chars[], int index) throws IOException;
    
}
protected String getPairPunctuationText ( int c ) throws IOException { isb . clear ( ) ; char echar = StringUtil . getPunctuationPair ( ( char ) c ) ; boolean matched = false ; int j , ch ; ialist . clear ( ) ; for ( j = 0 ; j < config . PPT_MAX_LENGTH ; j ++ ) { ch = readNext ( ) ; if ( ch == - 1 ) break ; if ( ch == echar ) { matched = true ; pushBack ( ch ) ; break ; } isb . append ( ( char ) ch ) ; ialist . add ( ch ) ; } if ( matched == false ) { for ( int i = j - 1 ; i >= 0 ; i -- ) pushBack ( ialist . get ( i ) ) ; return null ; } return isb . toString ( ) ; } protected abstract IChunk getBestCJKChunk ( char chars [ ] , int index ) throws IOException ; }
find pair punctuation of the given punctuation char
the purpose is to get the text between them

@param c
@throws IOException