org.apache.lucene.util.automaton.Automata.makeEmptyString()方法的使用及代码示例

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

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

Automata.makeEmptyString介绍

[英]Returns a new (deterministic) automaton that accepts only the empty string.
[中]返回仅接受空字符串的新(确定性)自动机。

代码示例

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

b = Automata.makeEmptyString();
} else if (min == 1) {
 b = new Automaton();

代码示例来源:origin: org.codelibs/elasticsearch-querybuilders

/**
     * Create a automaton for a given context query this automaton will be used
     * to find the matching paths with the fst
     *
     * @param preserveSep set an additional char (<code>XAnalyzingSuggester.SEP_LABEL</code>) between each context query
     * @param queries list of {ContextQuery} defining the lookup context
     *
     * @return Automaton matching the given Query
     */
    public static Automaton toAutomaton(boolean preserveSep, Iterable<ContextQuery> queries) {
      Automaton a = Automata.makeEmptyString();

      Automaton gap = Automata.makeChar(ContextMapping.SEPARATOR);
      if (preserveSep) {
        // if separators are preserved the fst contains a SEP_LABEL
        // behind each gap. To have a matching automaton, we need to
        // include the SEP_LABEL in the query as well
//                gap = Operations.concatenate(gap, Automata.makeChar(XAnalyzingSuggester.SEP_LABEL));
      }

      for (ContextQuery query : queries) {
        a = Operations.concatenate(Arrays.asList(query.toAutomaton(), gap, a));
      }

      // TODO: should we limit this?  Do any of our ContextQuery impls really create exponential regexps?
      // GeoQuery looks safe (union of strings).
      return Operations.determinize(a, Integer.MAX_VALUE);
    }

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

/**
 * Create a automaton for a given context query this automaton will be used
 * to find the matching paths with the fst
 *
 * @param preserveSep set an additional char (<code>XAnalyzingSuggester.SEP_LABEL</code>) between each context query
 * @param queries list of {@link ContextQuery} defining the lookup context
 *
 * @return Automaton matching the given Query
 */
public static Automaton toAutomaton(boolean preserveSep, Iterable<ContextQuery> queries) {
  Automaton a = Automata.makeEmptyString();
  Automaton gap = Automata.makeChar(ContextMapping.SEPARATOR);
  if (preserveSep) {
    // if separators are preserved the fst contains a SEP_LABEL
    // behind each gap. To have a matching automaton, we need to
    // include the SEP_LABEL in the query as well
    gap = Operations.concatenate(gap, Automata.makeChar(XAnalyzingSuggester.SEP_LABEL));
  }
  for (ContextQuery query : queries) {
    a = Operations.concatenate(Arrays.asList(query.toAutomaton(), gap, a));
  }
  // TODO: should we limit this?  Do any of our ContextQuery impls really create exponential regexps?
  // GeoQuery looks safe (union of strings).
  return Operations.determinize(a, Integer.MAX_VALUE);
}

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

/**
 * Create a automaton for a given context query this automaton will be used
 * to find the matching paths with the fst
 *
 * @param preserveSep set an additional char (<code>XAnalyzingSuggester.SEP_LABEL</code>) between each context query
 * @param queries list of {@link ContextQuery} defining the lookup context
 *
 * @return Automaton matching the given Query
 */
public static Automaton toAutomaton(boolean preserveSep, Iterable<ContextQuery> queries) {
  Automaton a = Automata.makeEmptyString();
  Automaton gap = Automata.makeChar(ContextMapping.SEPARATOR);
  if (preserveSep) {
    // if separators are preserved the fst contains a SEP_LABEL
    // behind each gap. To have a matching automaton, we need to
    // include the SEP_LABEL in the query as well
    gap = Operations.concatenate(gap, Automata.makeChar(XAnalyzingSuggester.SEP_LABEL));
  }
  for (ContextQuery query : queries) {
    a = Operations.concatenate(Arrays.asList(query.toAutomaton(), gap, a));
  }
  // TODO: should we limit this?  Do any of our ContextQuery impls really create exponential regexps?  GeoQuery looks safe (union
  // of strings).
  return Operations.determinize(a, Integer.MAX_VALUE);
}

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

b = Automata.makeEmptyString();
} else if (min == 1) {
 b = new Automaton();

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

b = Automata.makeEmptyString();
} else if (min == 1) {
 b = new Automaton();

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

b = Automata.makeEmptyString();
} else if (min == 1) {
 b = new Automaton();

相关文章