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

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

本文整理了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

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

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

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

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

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

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

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

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

  1. Automaton a = Operations.union(subs);

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

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

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

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

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

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

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

  1. @Override
  2. public Automaton toAutomaton() {
  3. List<Automaton> automatons = new ArrayList<>();
  4. for (CharSequence value : values) {
  5. automatons.add(Automata.makeString(value.toString()));
  6. }
  7. return Operations.union(automatons);
  8. }

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

  1. @Override
  2. public Automaton toAutomaton() {
  3. List<Automaton> automatons = new ArrayList<>();
  4. for (CharSequence value : values) {
  5. automatons.add(Automata.makeString(value.toString()));
  6. }
  7. return Operations.union(automatons);
  8. }

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

  1. @Override
  2. public Automaton toAutomaton() {
  3. List<Automaton> automatons = new ArrayList<>();
  4. for (CharSequence value : values) {
  5. automatons.add(Automata.makeString(value.toString()));
  6. }
  7. return Operations.union(automatons);
  8. }

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

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

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

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

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

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

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

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

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

  1. @Override
  2. public Automaton toAutomaton() {
  3. Automaton automaton;
  4. if(precisions == null || precisions.length == 0) {
  5. automaton = Automata.makeString(location);
  6. } else {
  7. automaton = Automata.makeString(location.substring(0, Math.max(1, Math.min(location.length(), precisions[0]))));
  8. for (int i = 1; i < precisions.length; i++) {
  9. final String cell = location.substring(0, Math.max(1, Math.min(location.length(), precisions[i])));
  10. automaton = Operations.union(automaton, Automata.makeString(cell));
  11. }
  12. }
  13. return automaton;
  14. }

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

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

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

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

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

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

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

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

相关文章