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

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

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

Operations.complement介绍

[英]Returns a (deterministic) automaton that accepts the complement of the language of the given automaton.

Complexity: linear in number of states if already deterministic and exponential otherwise.
[中]返回接受给定自动机语言补码的(确定性)自动机。
复杂性:如果已经确定,则状态数为线性,否则为指数。

代码示例

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

  1. /**
  2. * Returns a (deterministic) automaton that accepts the intersection of the
  3. * language of <code>a1</code> and the complement of the language of
  4. * <code>a2</code>. As a side-effect, the automata may be determinized, if not
  5. * already deterministic.
  6. * <p>
  7. * Complexity: quadratic in number of states if a2 already deterministic and
  8. * exponential in number of a2's states otherwise.
  9. */
  10. static public Automaton minus(Automaton a1, Automaton a2, int maxDeterminizedStates) {
  11. if (Operations.isEmpty(a1) || a1 == a2) {
  12. return Automata.makeEmpty();
  13. }
  14. if (Operations.isEmpty(a2)) {
  15. return a1;
  16. }
  17. return intersection(a1, complement(a2, maxDeterminizedStates));
  18. }

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

  1. break;
  2. case REGEXP_COMPLEMENT:
  3. a = Operations.complement(
  4. exp1.toAutomatonInternal(automata, automaton_provider,
  5. maxDeterminizedStates),

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

  1. /**
  2. * Returns a (deterministic) automaton that accepts the intersection of the
  3. * language of <code>a1</code> and the complement of the language of
  4. * <code>a2</code>. As a side-effect, the automata may be determinized, if not
  5. * already deterministic.
  6. * <p>
  7. * Complexity: quadratic in number of states if a2 already deterministic and
  8. * exponential in number of a2's states otherwise.
  9. */
  10. static public Automaton minus(Automaton a1, Automaton a2, int maxDeterminizedStates) {
  11. if (Operations.isEmpty(a1) || a1 == a2) {
  12. return Automata.makeEmpty();
  13. }
  14. if (Operations.isEmpty(a2)) {
  15. return a1;
  16. }
  17. return intersection(a1, complement(a2, maxDeterminizedStates));
  18. }

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

  1. /**
  2. * Returns a (deterministic) automaton that accepts the intersection of the
  3. * language of <code>a1</code> and the complement of the language of
  4. * <code>a2</code>. As a side-effect, the automata may be determinized, if not
  5. * already deterministic.
  6. * <p>
  7. * Complexity: quadratic in number of states if a2 already deterministic and
  8. * exponential in number of a2's states otherwise.
  9. */
  10. static public Automaton minus(Automaton a1, Automaton a2, int maxDeterminizedStates) {
  11. if (Operations.isEmpty(a1) || a1 == a2) {
  12. return Automata.makeEmpty();
  13. }
  14. if (Operations.isEmpty(a2)) {
  15. return a1;
  16. }
  17. return intersection(a1, complement(a2, maxDeterminizedStates));
  18. }

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

  1. /**
  2. * Returns a (deterministic) automaton that accepts the intersection of the
  3. * language of <code>a1</code> and the complement of the language of
  4. * <code>a2</code>. As a side-effect, the automata may be determinized, if not
  5. * already deterministic.
  6. * <p>
  7. * Complexity: quadratic in number of states if a2 already deterministic and
  8. * exponential in number of a2's states otherwise.
  9. */
  10. static public Automaton minus(Automaton a1, Automaton a2, int maxDeterminizedStates) {
  11. if (Operations.isEmpty(a1) || a1 == a2) {
  12. return Automata.makeEmpty();
  13. }
  14. if (Operations.isEmpty(a2)) {
  15. return a1;
  16. }
  17. return intersection(a1, complement(a2, maxDeterminizedStates));
  18. }

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

  1. break;
  2. case REGEXP_COMPLEMENT:
  3. a = Operations.complement(
  4. exp1.toAutomatonInternal(automata, automaton_provider,
  5. maxDeterminizedStates),

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

  1. break;
  2. case REGEXP_COMPLEMENT:
  3. a = Operations.complement(
  4. exp1.toAutomatonInternal(automata, automaton_provider,
  5. maxDeterminizedStates),

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

  1. break;
  2. case REGEXP_COMPLEMENT:
  3. a = Operations.complement(
  4. exp1.toAutomatonInternal(automata, automaton_provider,
  5. maxDeterminizedStates),

相关文章