本文整理了Java中org.apache.lucene.analysis.Token.clear()
方法的一些代码示例,展示了Token.clear()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Token.clear()
方法的具体详情如下:
包路径:org.apache.lucene.analysis.Token
类名称:Token
方法名:clear
[英]Resets the term text, payload, flags, and positionIncrement, startOffset, endOffset and token type to default.
[中]
代码示例来源:origin: gncloud/fastcatsearch
/** Shorthand for calling {@link #clear},
* {@link #append(CharSequence)},
* {@link #setOffset},
* {@link #setType} on Token.DEFAULT_TYPE
* @return this Token instance */
public Token reinit(String newTerm, int newStartOffset, int newEndOffset) {
checkOffsets(newStartOffset, newEndOffset);
clear();
append(newTerm);
startOffset = newStartOffset;
endOffset = newEndOffset;
type = DEFAULT_TYPE;
return this;
}
代码示例来源:origin: gncloud/fastcatsearch
/** Shorthand for calling {@link #clear},
* {@link #append(CharSequence, int, int)},
* {@link #setOffset},
* {@link #setType} on Token.DEFAULT_TYPE
* @return this Token instance */
public Token reinit(String newTerm, int newTermOffset, int newTermLength, int newStartOffset, int newEndOffset) {
checkOffsets(newStartOffset, newEndOffset);
clear();
append(newTerm, newTermOffset, newTermOffset + newTermLength);
startOffset = newStartOffset;
endOffset = newEndOffset;
type = DEFAULT_TYPE;
return this;
}
代码示例来源:origin: gncloud/fastcatsearch
/** Shorthand for calling {@link #clear},
* {@link #append(CharSequence)},
* {@link #setOffset},
* {@link #setType}
* @return this Token instance */
public Token reinit(String newTerm, int newStartOffset, int newEndOffset, String newType) {
checkOffsets(newStartOffset, newEndOffset);
clear();
append(newTerm);
startOffset = newStartOffset;
endOffset = newEndOffset;
type = newType;
return this;
}
代码示例来源:origin: gncloud/fastcatsearch
/** Shorthand for calling {@link #clear},
* {@link #append(CharSequence, int, int)},
* {@link #setOffset},
* {@link #setType}
* @return this Token instance */
public Token reinit(String newTerm, int newTermOffset, int newTermLength, int newStartOffset, int newEndOffset, String newType) {
checkOffsets(newStartOffset, newEndOffset);
clear();
append(newTerm, newTermOffset, newTermOffset + newTermLength);
startOffset = newStartOffset;
endOffset = newEndOffset;
type = newType;
return this;
}
代码示例来源:origin: org.apache.lucene/com.springsource.org.apache.lucene
public Token next(final Token reusableToken) throws IOException {
assert reusableToken != null;
if (!done) {
done = true;
int upto = 0;
reusableToken.clear();
char[] buffer = reusableToken.termBuffer();
while (true) {
final int length = input.read(buffer, upto, buffer.length-upto);
if (length == -1) break;
upto += length;
if (upto == buffer.length)
buffer = reusableToken.resizeTermBuffer(1+buffer.length);
}
reusableToken.setTermLength(upto);
return reusableToken;
}
return null;
}
代码示例来源:origin: org.apache.lucene/lucene-core-jfrog
public Token next(final Token reusableToken) throws IOException {
assert reusableToken != null;
if (!done) {
done = true;
int upto = 0;
reusableToken.clear();
char[] buffer = reusableToken.termBuffer();
while (true) {
final int length = input.read(buffer, upto, buffer.length-upto);
if (length == -1) break;
upto += length;
if (upto == buffer.length)
buffer = reusableToken.resizeTermBuffer(1+buffer.length);
}
reusableToken.setTermLength(upto);
return reusableToken;
}
return null;
}
代码示例来源:origin: org.apache.lucene/com.springsource.org.apache.lucene
public final Token next(final Token reusableToken) throws IOException {
assert reusableToken != null;
reusableToken.clear();
int length = 0;
int start = bufferIndex;
代码示例来源:origin: org.apache.lucene/lucene-core-jfrog
public final Token next(final Token reusableToken) throws IOException {
assert reusableToken != null;
reusableToken.clear();
int length = 0;
int start = bufferIndex;
代码示例来源:origin: org.apache.lucene/com.springsource.org.apache.lucene
reusableToken.clear();
reusableToken.setPositionIncrement(posIncr);
scanner.getText(reusableToken);
代码示例来源:origin: org.apache.lucene/lucene-core-jfrog
reusableToken.clear();
reusableToken.setPositionIncrement(posIncr);
scanner.getText(reusableToken);
内容来源于网络,如有侵权,请联系作者删除!