private void flushBigram(){
  clearAttributes();
  char termBuffer[]=termAtt.resizeBuffer(4);
  int len1=Character.toChars(buffer[index],termBuffer,0);
  int len2=len1 + Character.toChars(buffer[index + 1],termBuffer,len1);
  termAtt.setLength(len2);
  offsetAtt.setOffset(startOffset[index],endOffset[index + 1]);
  typeAtt.setType(DOUBLE_TYPE);
  if (outputUnigrams) {
    posIncAtt.setPositionIncrement(0);
    posLengthAtt.setPositionLength(2);
  }
  index++;
}

private void flushBigram ( ) { clearAttributes ( ) ; char termBuffer [ ] = termAtt . resizeBuffer ( 4 ) ; int len1 = Character . toChars ( buffer [ index ] , termBuffer , 0 ) ; int len2 = len1 + Character . toChars ( buffer [ index + 1 ] , termBuffer , len1 ) ; termAtt . setLength ( len2 ) ; offsetAtt . setOffset ( startOffset [ index ] , endOffset [ index + 1 ] ) ; typeAtt . setType ( DOUBLE_TYPE ) ; if ( outputUnigrams ) { posIncAtt . setPositionIncrement ( 0 ) ; posLengthAtt . setPositionLength ( 2 ) ; } index ++ ; }
flushes a bigram token to output from our buffer this is the normal case , e . g . abc - & gt ; ab bc
