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

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

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

Operations.totalize介绍

[英]Returns a new automaton accepting the same language with added transitions to a dead state so that from every state and every label there is a transition.
[中]返回一个新的自动机,该自动机接受相同的语言,并添加到死状态的转换,以便从每个状态和每个标签都有一个转换。

代码示例

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

  1. /**
  2. * Returns a (deterministic) automaton that accepts the complement of the
  3. * language of the given automaton.
  4. * <p>
  5. * Complexity: linear in number of states if already deterministic and
  6. * exponential otherwise.
  7. * @param maxDeterminizedStates maximum number of states determinizing the
  8. * automaton can result in. Set higher to allow more complex queries and
  9. * lower to prevent memory exhaustion.
  10. */
  11. static public Automaton complement(Automaton a, int maxDeterminizedStates) {
  12. a = totalize(determinize(a, maxDeterminizedStates));
  13. int numStates = a.getNumStates();
  14. for (int p=0;p<numStates;p++) {
  15. a.setAccept(p, !a.isAccept(p));
  16. }
  17. return removeDeadStates(a);
  18. }

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

  1. a = Operations.totalize(a);

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

  1. /**
  2. * Returns a (deterministic) automaton that accepts the complement of the
  3. * language of the given automaton.
  4. * <p>
  5. * Complexity: linear in number of states if already deterministic and
  6. * exponential otherwise.
  7. * @param maxDeterminizedStates maximum number of states determinizing the
  8. * automaton can result in. Set higher to allow more complex queries and
  9. * lower to prevent memory exhaustion.
  10. */
  11. static public Automaton complement(Automaton a, int maxDeterminizedStates) {
  12. a = totalize(determinize(a, maxDeterminizedStates));
  13. int numStates = a.getNumStates();
  14. for (int p=0;p<numStates;p++) {
  15. a.setAccept(p, !a.isAccept(p));
  16. }
  17. return removeDeadStates(a);
  18. }

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

  1. /**
  2. * Returns a (deterministic) automaton that accepts the complement of the
  3. * language of the given automaton.
  4. * <p>
  5. * Complexity: linear in number of states if already deterministic and
  6. * exponential otherwise.
  7. * @param maxDeterminizedStates maximum number of states determinizing the
  8. * automaton can result in. Set higher to allow more complex queries and
  9. * lower to prevent memory exhaustion.
  10. */
  11. static public Automaton complement(Automaton a, int maxDeterminizedStates) {
  12. a = totalize(determinize(a, maxDeterminizedStates));
  13. int numStates = a.getNumStates();
  14. for (int p=0;p<numStates;p++) {
  15. a.setAccept(p, !a.isAccept(p));
  16. }
  17. return removeDeadStates(a);
  18. }

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

  1. /**
  2. * Returns a (deterministic) automaton that accepts the complement of the
  3. * language of the given automaton.
  4. * <p>
  5. * Complexity: linear in number of states if already deterministic and
  6. * exponential otherwise.
  7. * @param maxDeterminizedStates maximum number of states determinizing the
  8. * automaton can result in. Set higher to allow more complex queries and
  9. * lower to prevent memory exhaustion.
  10. */
  11. static public Automaton complement(Automaton a, int maxDeterminizedStates) {
  12. a = totalize(determinize(a, maxDeterminizedStates));
  13. int numStates = a.getNumStates();
  14. for (int p=0;p<numStates;p++) {
  15. a.setAccept(p, !a.isAccept(p));
  16. }
  17. return removeDeadStates(a);
  18. }

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

  1. a = Operations.totalize(a);

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

  1. a = Operations.totalize(a);

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

  1. a = Operations.totalize(a);

相关文章