Examples of captureState()


Examples of org.apache.lucene.analysis.TokenStream.captureState()

    TermAttribute termAtt = source.addAttribute(TermAttribute.class);
    PositionIncrementAttribute posincrAtt = source.addAttribute(PositionIncrementAttribute.class);

    try {
      while (source.incrementToken()) {
        list.add(source.captureState());
        if (posincrAtt.getPositionIncrement() == 1)
          positionCount++;
        else
          severalTokensAtSamePosition = true;
      }
View Full Code Here

Examples of org.apache.lucene.analysis.TokenStream.captureState()

    if (sortedStreams.size() == 0)
      return false;

    TokenStream currentTokenStream = sortedStreams.pop();

    restoreState(currentTokenStream.captureState());
   
    OffsetAttribute offsetAttr = (OffsetAttribute)currentTokenStream.getAttribute(OffsetAttribute.class);
    if (offsetAttr.startOffset() == currentOffset)
      posIncAtt.setPositionIncrement(0);
    else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.