本文整理了Java中org.apache.lucene.analysis.Token.reinit()
方法的一些代码示例,展示了Token.reinit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Token.reinit()
方法的具体详情如下:
包路径:org.apache.lucene.analysis.Token
类名称:Token
方法名:reinit
[英]Shorthand for calling #clear, #append(CharSequence), #setOffset, #setType on Token.DEFAULT_TYPE
[中]在令牌上调用#clear、#append(CharSequence)、#setOffset、#setType的简写。默认类型
代码示例来源:origin: gncloud/fastcatsearch
@Override
public void copyTo(AttributeImpl target) {
if (target instanceof Token) {
final Token to = (Token) target;
to.reinit(this);
// reinit shares the payload, so clone it:
if (payload !=null) {
to.payload = payload.clone();
}
} else {
super.copyTo(target);
((OffsetAttribute) target).setOffset(startOffset, endOffset);
((PositionIncrementAttribute) target).setPositionIncrement(positionIncrement);
((PayloadAttribute) target).setPayload((payload == null) ? null : payload.clone());
((FlagsAttribute) target).setFlags(flags);
((TypeAttribute) target).setType(type);
}
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
@Override
public final boolean incrementToken() throws IOException {
if (!prefixExhausted) {
Token nextToken = getNextPrefixInputToken(reusableToken);
if (nextToken == null) {
prefixExhausted = true;
} else {
previousPrefixToken.reinit(nextToken);
// Make it a deep copy
BytesRef p = previousPrefixToken.getPayload();
if (p != null) {
previousPrefixToken.setPayload(p.clone());
}
setCurrentToken(nextToken);
return true;
}
}
Token nextToken = getNextSuffixInputToken(reusableToken);
if (nextToken == null) {
return false;
}
nextToken = updateSuffixToken(nextToken, previousPrefixToken);
setCurrentToken(nextToken);
return true;
}
代码示例来源:origin: org.apache.lucene/lucene-analyzers
@Override
public final boolean incrementToken() throws IOException {
if (!prefixExhausted) {
Token nextToken = getNextPrefixInputToken(reusableToken);
if (nextToken == null) {
prefixExhausted = true;
} else {
previousPrefixToken.reinit(nextToken);
// Make it a deep copy
Payload p = previousPrefixToken.getPayload();
if (p != null) {
previousPrefixToken.setPayload((Payload) p.clone());
}
setCurrentToken(nextToken);
return true;
}
}
Token nextToken = getNextSuffixInputToken(reusableToken);
if (nextToken == null) {
return false;
}
nextToken = updateSuffixToken(nextToken, previousPrefixToken);
setCurrentToken(nextToken);
return true;
}
代码示例来源:origin: org.dspace.dependencies.solr/dspace-solr-core
prev.reinit(token.termBuffer(), 0, token.termLength(), token
.startOffset(), token.endOffset(), token.type());
token.setPositionIncrement(1);
prev.reinit(token.termBuffer(), 0, token.termLength(), token.startOffset(),
token.endOffset(), token.type());
assert token.type() == "word";
代码示例来源:origin: org.apache.lucene/com.springsource.org.apache.lucene
String stringValue = field.stringValue();
final int valueLength = stringValue.length();
Token token = perThread.localToken.reinit(stringValue, 0, valueLength);
boolean success = false;
try {
代码示例来源:origin: org.apache.lucene/lucene-core-jfrog
String stringValue = field.stringValue();
final int valueLength = stringValue.length();
Token token = perThread.localToken.reinit(stringValue, 0, valueLength);
boolean success = false;
try {
内容来源于网络,如有侵权,请联系作者删除!