jpountz commented on a change in pull request #1976:
URL: https://github.com/apache/lucene-solr/pull/1976#discussion_r505814863



##########
File path: lucene/core/src/java/org/apache/lucene/util/automaton/Automata.java
##########
@@ -85,7 +85,22 @@ public static Automaton makeAnyBinary() {
     a.finishState();
     return a;
   }
-  
+
+  /**
+   * Returns a new (deterministic) automaton that accepts all binary terms 
except
+   * the empty string.
+   */
+  public static Automaton makeAnyBinaryExceptEmpty() {

Review comment:
       Maybe call `makeNonEmptyBinary`?

##########
File path: lucene/core/src/java/org/apache/lucene/util/automaton/Automata.java
##########
@@ -85,7 +85,22 @@ public static Automaton makeAnyBinary() {
     a.finishState();
     return a;
   }
-  
+
+  /**
+   * Returns a new (deterministic) automaton that accepts all binary terms 
except
+   * the empty string.
+   */
+  public static Automaton makeAnyBinaryExceptEmpty() {
+    Automaton a = new Automaton();
+    int s1 = a.createState();
+    int s2 = a.createState();
+    a.setAccept(s2, true);

Review comment:
       Do we need to call setAccept on s1 too? Or is it done implicitly 
elsewhere (I'm not completely familiar with the Automaton code)




----------------------------------------------------------------
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.

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



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

Reply via email to