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

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

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

Token.append介绍

暂无

代码示例

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

/** Constructs a Token with the given term text, start
 *  and end offsets.  The type defaults to "word."
 *  <b>NOTE:</b> for better indexing speed you should
 *  instead use the char[] termBuffer methods to set the
 *  term text.
 *  @param text term text
 *  @param start start offset in the source text
 *  @param end end offset in the source text
 */
public Token(CharSequence text, int start, int end) {
 append(text);
 setOffset(start, end);
}

代码示例来源:origin: gncloud/fastcatsearch

/** Constructs a Token with the given text, start and end
 *  offsets, & type.  <b>NOTE:</b> for better indexing
 *  speed you should instead use the char[] termBuffer
 *  methods to set the term text.
 *  @param text term text
 *  @param start start offset in the source text
 *  @param end end offset in the source text
 *  @param typ token type
 */
public Token(String text, int start, int end, String typ) {
 checkOffsets(start, end);
 append(text);
 startOffset = start;
 endOffset = end;
 type = typ;
}

代码示例来源:origin: gncloud/fastcatsearch

/** Constructs a Token with the given term text, and start
 *  & end offsets.  The type defaults to "word."
 *  <b>NOTE:</b> for better indexing speed you should
 *  instead use the char[] termBuffer methods to set the
 *  term text.
 *  @param text term text
 *  @param start start offset in the source text
 *  @param end end offset in the source text
 */
public Token(String text, int start, int end) {
 checkOffsets(start, end);
 append(text);
 startOffset = start;
 endOffset = end;
}

代码示例来源:origin: gncloud/fastcatsearch

/**
 *  Constructs a Token with the given text, start and end
 *  offsets, & type.  <b>NOTE:</b> for better indexing
 *  speed you should instead use the char[] termBuffer
 *  methods to set the term text.
 * @param text term text
 * @param start start offset in the source text
 * @param end end offset in the source text
 * @param flags token type bits
 */
public Token(String text, int start, int end, int flags) {
 checkOffsets(start, end);
 append(text);
 startOffset = start;
 endOffset = end;
 this.flags = flags;
}

代码示例来源: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;
}

相关文章