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

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

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

Token.resizeTermBuffer介绍

[英]Grows the termBuffer to at least size newSize, preserving the existing content. Note: If the next operation is to change the contents of the term buffer use #setTermBuffer(char[],int,int), #setTermBuffer(String), or #setTermBuffer(String,int,int)to optimally combine the resize with the setting of the termBuffer.
[中]将termBuffer的大小至少增加到新闻大小,从而保留现有内容。注意:如果下一个操作是更改术语缓冲区的内容,请使用#setterbuffer(char[],int,int)、#setterbuffer(String)或#setterbuffer(String,int,int)将调整大小与术语缓冲区的设置最佳地结合起来。

代码示例

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

start = offset + bufferIndex - 1;
else if (length == buffer.length)
 buffer = reusableToken.resizeTermBuffer(1+length);

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

start = offset + bufferIndex - 1;
else if (length == buffer.length)
 buffer = reusableToken.resizeTermBuffer(1+length);

相关文章