当前位置: 首页>>代码示例>>Java>>正文


Java Arc.isFinal方法代码示例

本文整理汇总了Java中org.apache.lucene.util.fst.FST.Arc.isFinal方法的典型用法代码示例。如果您正苦于以下问题:Java Arc.isFinal方法的具体用法?Java Arc.isFinal怎么用?Java Arc.isFinal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.lucene.util.fst.FST.Arc的用法示例。


在下文中一共展示了Arc.isFinal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: get

import org.apache.lucene.util.fst.FST.Arc; //导入方法依赖的package包/类
/**
 * Returns the value mapped to the given key or <code>null</code> if the key is not in the FST dictionary.
 */
public BytesRef get(char[] buffer, int bufferLen, Arc<BytesRef> scratchArc, BytesReader fstReader) throws IOException {
  BytesRef pendingOutput = fst.outputs.getNoOutput();
  BytesRef matchOutput = null;
  int bufUpto = 0;
  fst.getFirstArc(scratchArc);
  while (bufUpto < bufferLen) {
    final int codePoint = Character.codePointAt(buffer, bufUpto, bufferLen);
    if (fst.findTargetArc(ignoreCase ? Character.toLowerCase(codePoint) : codePoint, scratchArc, scratchArc, fstReader) == null) {
      return null;
    }
    pendingOutput = fst.outputs.add(pendingOutput, scratchArc.output);
    bufUpto += Character.charCount(codePoint);
  }
  if (scratchArc.isFinal()) {
    matchOutput = fst.outputs.add(pendingOutput, scratchArc.nextFinalOutput);
  }
  return matchOutput;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:StemmerOverrideFilter.java

示例2: get

import org.apache.lucene.util.fst.FST.Arc; //导入方法依赖的package包/类
/**
 * Returns the weight associated with an input string,
 * or null if it does not exist.
 */
public Object get(CharSequence key) {
  if (fst == null) {
    return null;
  }
  Arc<Long> arc = new Arc<>();
  Long result = null;
  try {
    result = lookupPrefix(new BytesRef(key), arc);
  } catch (IOException bogus) { throw new RuntimeException(bogus); }
  if (result == null || !arc.isFinal()) {
    return null;
  } else {
    return Integer.valueOf(decodeWeight(result + arc.nextFinalOutput));
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:20,代码来源:WFSTCompletionLookup.java

示例3: get

import org.apache.lucene.util.fst.FST.Arc; //导入方法依赖的package包/类
/**
 * Returns the weight associated with an input string,
 * or null if it does not exist.
 */
public Object get(CharSequence key) {
  if (fst == null) {
    return null;
  }
  Arc<Long> arc = new Arc<Long>();
  Long result = null;
  try {
    result = lookupPrefix(new BytesRef(key), arc);
  } catch (IOException bogus) { throw new RuntimeException(bogus); }
  if (result == null || !arc.isFinal()) {
    return null;
  } else {
    return Integer.valueOf(decodeWeight(result + arc.nextFinalOutput));
  }
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:20,代码来源:WFSTCompletionLookup.java


注:本文中的org.apache.lucene.util.fst.FST.Arc.isFinal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。