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

x33g5p2x  于2022-01-26 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(125)

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

Operations.union介绍

[英]Returns an automaton that accepts the union of the languages of the given automata.

Complexity: linear in number of states.
[中]

代码示例

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

/**
 * Returns an automaton that accepts the union of the languages of the given
 * automata.
 * <p>
 * Complexity: linear in number of states.
 */
public static Automaton union(Automaton a1, Automaton a2) {
 return union(Arrays.asList(a1, a2));
}

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

/**
 * Return an Automaton that matches the union of the provided patterns.
 */
public static Automaton simpleMatchToAutomaton(String... patterns) {
  if (patterns.length < 1) {
    throw new IllegalArgumentException("There must be at least one pattern, zero given");
  }
  List<Automaton> automata = new ArrayList<>();
  for (String pattern : patterns) {
    automata.add(simpleMatchToAutomaton(pattern));
  }
  return Operations.union(automata);
}

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

findLeaves(exp2, Kind.REGEXP_UNION, list, automata, automaton_provider,
 maxDeterminizedStates);
a = Operations.union(list);
a = MinimizationOperations.minimize(a, maxDeterminizedStates);
break;

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

/** Make matches on objects also match dots in field names.
 *  For instance, if the original simple regex is `foo`, this will translate
 *  it into `foo` OR `foo.*`. */
private static Automaton makeMatchDotsInFieldNames(Automaton automaton) {
  return Operations.union(
      automaton,
      Operations.concatenate(Arrays.asList(automaton, Automata.makeChar('.'), Automata.makeAnyString())));
}

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

Automaton a = Operations.union(subs);

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

/**
 * Returns an automaton that accepts the union of the languages of the given
 * automata.
 * <p>
 * Complexity: linear in number of states.
 */
public static Automaton union(Automaton a1, Automaton a2) {
 return union(Arrays.asList(a1, a2));
}

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

/**
 * Returns an automaton that accepts the union of the languages of the given
 * automata.
 * <p>
 * Complexity: linear in number of states.
 */
public static Automaton union(Automaton a1, Automaton a2) {
 return union(Arrays.asList(a1, a2));
}

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

/**
 * Returns an automaton that accepts the union of the languages of the given
 * automata.
 * <p>
 * Complexity: linear in number of states.
 */
public static Automaton union(Automaton a1, Automaton a2) {
 return union(Arrays.asList(a1, a2));
}

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

@Override
public Automaton toAutomaton() {
  List<Automaton> automatons = new ArrayList<>();
  for (CharSequence value : values) {
    automatons.add(Automata.makeString(value.toString()));
  }
  return Operations.union(automatons);
}

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

@Override
public Automaton toAutomaton() {
  List<Automaton> automatons = new ArrayList<>();
  for (CharSequence value : values) {
    automatons.add(Automata.makeString(value.toString()));
  }
  return Operations.union(automatons);
}

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

@Override
public Automaton toAutomaton() {
  List<Automaton> automatons = new ArrayList<>();
  for (CharSequence value : values) {
    automatons.add(Automata.makeString(value.toString()));
  }
  return Operations.union(automatons);
}

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

/**
 * Return an Automaton that matches the union of the provided patterns.
 */
public static Automaton simpleMatchToAutomaton(String... patterns) {
  if (patterns.length < 1) {
    throw new IllegalArgumentException("There must be at least one pattern, zero given");
  }
  List<Automaton> automata = new ArrayList<>();
  for (String pattern : patterns) {
    automata.add(simpleMatchToAutomaton(pattern));
  }
  return Operations.union(automata);
}

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

/**
 * Return an Automaton that matches the union of the provided patterns.
 */
public static Automaton simpleMatchToAutomaton(String... patterns) {
  if (patterns.length < 1) {
    throw new IllegalArgumentException("There must be at least one pattern, zero given");
  }
  List<Automaton> automata = new ArrayList<>();
  for (String pattern : patterns) {
    automata.add(simpleMatchToAutomaton(pattern));
  }
  return Operations.union(automata);
}

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

/**
 * Return an Automaton that matches the union of the provided patterns.
 */
public static Automaton simpleMatchToAutomaton(String... patterns) {
  if (patterns.length < 1) {
    throw new IllegalArgumentException("There must be at least one pattern, zero given");
  }
  List<Automaton> automata = new ArrayList<>();
  for (String pattern : patterns) {
    automata.add(simpleMatchToAutomaton(pattern));
  }
  return Operations.union(automata);
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Return an Automaton that matches the union of the provided patterns.
 */
public static Automaton simpleMatchToAutomaton(String... patterns) {
  if (patterns.length < 1) {
    throw new IllegalArgumentException("There must be at least one pattern, zero given");
  }
  List<Automaton> automata = new ArrayList<>();
  for (String pattern : patterns) {
    automata.add(simpleMatchToAutomaton(pattern));
  }
  return Operations.union(automata);
}

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

@Override
public Automaton toAutomaton() {
  Automaton automaton;
  if(precisions == null || precisions.length == 0) {
     automaton = Automata.makeString(location);
  } else {
    automaton = Automata.makeString(location.substring(0, Math.max(1, Math.min(location.length(), precisions[0]))));
    for (int i = 1; i < precisions.length; i++) {
      final String cell = location.substring(0, Math.max(1, Math.min(location.length(), precisions[i])));
      automaton = Operations.union(automaton, Automata.makeString(cell));
    }
  }
  return automaton;
}

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

/** Make matches on objects also match dots in field names.
 *  For instance, if the original simple regex is `foo`, this will translate
 *  it into `foo` OR `foo.*`. */
private static Automaton makeMatchDotsInFieldNames(Automaton automaton) {
  return Operations.union(
      automaton,
      Operations.concatenate(Arrays.asList(automaton, Automata.makeChar('.'), Automata.makeAnyString())));
}

代码示例来源:origin: apache/servicemix-bundles

/** Make matches on objects also match dots in field names.
 *  For instance, if the original simple regex is `foo`, this will translate
 *  it into `foo` OR `foo.*`. */
private static Automaton makeMatchDotsInFieldNames(Automaton automaton) {
  return Operations.union(
      automaton,
      Operations.concatenate(Arrays.asList(automaton, Automata.makeChar('.'), Automata.makeAnyString())));
}

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

/** Make matches on objects also match dots in field names.
 *  For instance, if the original simple regex is `foo`, this will translate
 *  it into `foo` OR `foo.*`. */
private static Automaton makeMatchDotsInFieldNames(Automaton automaton) {
  return Operations.union(
      automaton,
      Operations.concatenate(Arrays.asList(automaton, Automata.makeChar('.'), Automata.makeAnyString())));
}

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

/** Make matches on objects also match dots in field names.
 *  For instance, if the original simple regex is `foo`, this will translate
 *  it into `foo` OR `foo.*`. */
private static Automaton makeMatchDotsInFieldNames(Automaton automaton) {
  return Operations.union(
      automaton,
      Operations.concatenate(Arrays.asList(automaton, Automata.makeChar('.'), Automata.makeAnyString())));
}

相关文章