org.apache.lucene.util.fst.Builder.getNodeCount()方法的使用及代码示例

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

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

Builder.getNodeCount介绍

暂无

代码示例

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

/** Returns final FST.  NOTE: this will return null if
 *  nothing is accepted by the FST. */
public FST<T> finish() throws IOException {
 final UnCompiledNode<T> root = frontier[0];
 // minimize nodes in the last word's suffix
 freezeTail(0);
 if (root.inputCount < minSuffixCount1 || root.inputCount < minSuffixCount2 || root.numArcs == 0) {
  if (fst.emptyOutput == null) {
   return null;
  } else if (minSuffixCount1 > 0 || minSuffixCount2 > 0) {
   // empty string got pruned
   return null;
  }
 } else {
  if (minSuffixCount2 != 0) {
   compileAllTargets(root, lastInput.length());
  }
 }
 //if (DEBUG) System.out.println("  builder.finish root.isFinal=" + root.isFinal + " root.output=" + root.output);
 fst.finish(compileNode(root, lastInput.length()).node);
 if (doPackFST) {
  return fst.pack(this, 3, Math.max(10, (int) (getNodeCount()/4)), acceptableOverheadRatio);
 } else {
  return fst;
 }
}

代码示例来源:origin: harbby/presto-connectors

/** Returns final FST.  NOTE: this will return null if
 *  nothing is accepted by the FST. */
public FST<T> finish() throws IOException {
 final UnCompiledNode<T> root = frontier[0];
 // minimize nodes in the last word's suffix
 freezeTail(0);
 if (root.inputCount < minSuffixCount1 || root.inputCount < minSuffixCount2 || root.numArcs == 0) {
  if (fst.emptyOutput == null) {
   return null;
  } else if (minSuffixCount1 > 0 || minSuffixCount2 > 0) {
   // empty string got pruned
   return null;
  }
 } else {
  if (minSuffixCount2 != 0) {
   compileAllTargets(root, lastInput.length());
  }
 }
 //if (DEBUG) System.out.println("  builder.finish root.isFinal=" + root.isFinal + " root.output=" + root.output);
 fst.finish(compileNode(root, lastInput.length()).node);
 if (doPackFST) {
  return fst.pack(this, 3, Math.max(10, (int) (getNodeCount()/4)), acceptableOverheadRatio);
 } else {
  return fst;
 }
}

相关文章