kaivalnp commented on PR #15689:
URL: https://github.com/apache/lucene/pull/15689#issuecomment-3879954877

   > The patch doesn't explain why this is needed. What does it improve or how 
does it help?
   
   @dweiss I was thinking of a case where users want to match strings against a 
predefined regex, using automata classes from Lucene. Something like:
   
   ```java
   // build-time
   String regex = ".*something.*";
   Automaton automaton = new RegExp(regex).toAutomaton();
   NFARunAutomaton runAutomaton = new NFARunAutomaton(automaton);
   
   // run-time
   String keyword = "this line contains something";
   
   // create a runner for character sequences?
   boolean match = runAutomaton.run(keyword.codePoints().toArray());
   ```
   
   > I don't think RunAutomaton is needed for Characters at all anymore.
   
   @rmuir sorry I didn't get this -- do you mean Lucene should not support 
running characters against automata, or that there's an easier / more 
recommended way of doing so? (perhaps converting the automaton to accept UTF-8 
byte sequences instead)


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to