org.apache.lucene.analysis.Token.getFlags()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中org.apache.lucene.analysis.Token.getFlags()方法的一些代码示例,展示了Token.getFlags()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Token.getFlags()方法的具体详情如下:
包路径:org.apache.lucene.analysis.Token
类名称:Token
方法名:getFlags

Token.getFlags介绍

暂无

代码示例

代码示例来源:origin: org.apache.lucene/lucene-analyzers

/**
 * @param token
 * @return the token flags int value as TokenPosition
 * @throws IOException
 */
@Override
public TokenPositioner getTokenPositioner(Token token) throws IOException {
 switch (token.getFlags()) {
  case 0:
   return TokenPositioner.newColumn;
  case 1:
   return TokenPositioner.newRow;
  case 2:
   return TokenPositioner.sameRow;
 }
 throw new IOException("Unknown matrix positioning of token " + token);
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

private void setCurrentToken(Token token) {
 if (token == null) return;
 clearAttributes();
 termAtt.copyBuffer(token.buffer(), 0, token.length());
 posIncrAtt.setPositionIncrement(token.getPositionIncrement());
 flagsAtt.setFlags(token.getFlags());
 offsetAtt.setOffset(token.startOffset(), token.endOffset());
 typeAtt.setType(token.type());
 payloadAtt.setPayload(token.getPayload());
}

代码示例来源:origin: org.apache.lucene/lucene-analyzers

private void setCurrentToken(Token token) {
 if (token == null) return;
 clearAttributes();
 termAtt.copyBuffer(token.buffer(), 0, token.length());
 posIncrAtt.setPositionIncrement(token.getPositionIncrement());
 flagsAtt.setFlags(token.getFlags());
 offsetAtt.setOffset(token.startOffset(), token.endOffset());
 typeAtt.setType(token.type());
 payloadAtt.setPayload(token.getPayload());
}

代码示例来源:origin: org.apache.lucene/lucene-analyzers

@Override
public final boolean incrementToken() throws IOException {
 if (matrix == null) {
  matrix = new Matrix();
  // fill matrix with maximumShingleSize columns
  while (matrix.columns.size() < maximumShingleSize && readColumn()) {
   // this loop looks ugly
  }
 }
 // this loop exists in order to avoid recursive calls to the next method
 // as the complexity of a large matrix
 // then would require a multi gigabyte sized stack.
 Token token;
 do {
  token = produceNextToken(reusableToken);
 } while (token == request_next_token);
 if (token == null) return false;
 clearAttributes();
 termAtt.copyBuffer(token.buffer(), 0, token.length());
 posIncrAtt.setPositionIncrement(token.getPositionIncrement());
 flagsAtt.setFlags(token.getFlags());
 offsetAtt.setOffset(token.startOffset(), token.endOffset());
 typeAtt.setType(token.type());
 payloadAtt.setPayload(token.getPayload());
 return true;
}

相关文章