Ejemplo n.º 1
0
 @Override
 public void reset() throws IOException {
   super.reset();
   startTerm = 0;
   nextStartOffset = 0;
   snippet = null;
   snippetBuffer.setLength(0);
   charBufferIndex = BUFFER_SIZE;
   charBufferLen = 0;
   ch = 0;
 }
  /** Writes the joined unhyphenated term */
  private void unhyphenate() {
    int endOffset = offsetAttribute.endOffset();

    restoreState(savedState);
    savedState = null;

    char term[] = termAttribute.buffer();
    int length = hyphenated.length();
    if (length > termAttribute.length()) {
      term = termAttribute.resizeBuffer(length);
    }

    hyphenated.getChars(0, length, term, 0);
    termAttribute.setLength(length);
    offsetAttribute.setOffset(offsetAttribute.startOffset(), endOffset);
    hyphenated.setLength(0);
  }
 /** {@inheritDoc} */
 @Override
 public void reset() throws IOException {
   super.reset();
   hyphenated.setLength(0);
   savedState = null;
 }