vsop-479 commented on code in PR #13072: URL: https://github.com/apache/lucene/pull/13072#discussion_r1544202746
########## lucene/core/src/java/org/apache/lucene/util/automaton/RunAutomaton.java: ########## @@ -96,6 +101,35 @@ protected RunAutomaton(Automaton a, int alphabetSize) { } } + /** Returns true if this state can accept everything(all remaining suffixes). */ + private boolean canMatchAllSuffix(int state) { + assert automaton.isAccept(state); + int numTransitions = automaton.getNumTransitions(state); + // Apply to PrefixQuery, TermRangeQuery. + if (numTransitions == 1) { Review Comment: > These queries' (including AutomatonQuery)Automaton like this: 3 -> 3: [0, 127]; 3 -> 4: [194, 194]; 4 -> 3: [128, 191]. assume 3 is an accept state. @mikemccand I can track an accept state's other transitions, to check wether these transitions can finally ended on an accept (typically transited by [128, 191]). But i am not sure wether it is enough to judge an state can match all suffix, even not sure wether it is necessary, since maybe it is equivalent to just check the [0, 127] transition's dest is an accept state. -- 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-unsubscr...@lucene.apache.org 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