You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/09/24 14:02:49 UTC

[GitHub] [lucene] mikemccand commented on a diff in pull request #11813: Remove Operations.isFinite

mikemccand commented on code in PR #11813:
URL: https://github.com/apache/lucene/pull/11813#discussion_r979249444


##########
lucene/core/src/java/org/apache/lucene/util/automaton/CompiledAutomaton.java:
##########
@@ -139,21 +136,21 @@ private static int findSinkState(Automaton automaton) {
   }
 
   /**
-   * Create this. If finite is null, we use {@link Operations#isFinite} to determine whether it is
-   * finite. If simplify is true, we run possibly expensive operations to determine if the automaton
-   * is one the cases in {@link CompiledAutomaton.AUTOMATON_TYPE}.
+   * Create this. If simplify is true, we run possibly expensive operations to determine if the
+   * automaton is one the cases in {@link CompiledAutomaton.AUTOMATON_TYPE}. Set finite to true if
+   * the automaton is finite, otherwise set to false if infinite or you don't know.

Review Comment:
   If a user accidentally claims the automaton was finite but it is not, what happens?



##########
lucene/core/src/java/org/apache/lucene/analysis/AutomatonToTokenStream.java:
##########
@@ -46,10 +45,6 @@ private AutomatonToTokenStream() {}
    * @return TokenStream representation of automaton.
    */
   public static TokenStream toTokenStream(Automaton automaton) {
-    if (Operations.isFinite(automaton) == false) {

Review Comment:
   Maybe we should add a warning that this may run forever on an infinite automaton?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org