You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder if there is a small issue in the file automata.py, function __words_with_wildcard, between lines 128 and 147, when the case letter=='*' is processed.
If the dictionary is made of, for example, "CHIAC" and "CHIC", and the query is "CHI*C", the result will be return in an incorrect alphabetical order : "CHIC" then "CHIAC".
This is because the case words_at_current_level is processed before checking the children.
So, for "CHI*C",
words_at_current_level will first find "CHIC"
then the loop for child in node.children will find "CHIAC", resulting in an incorrect order of answers.
Any idea? Or maybe did I misunderstood the code?
Best,
Lionel
The text was updated successfully, but these errors were encountered:
I was able to fix it by modifying the __words_with_wildcard function.
The key idea is to process the words_at_current_level case in the middle of the "for child in node.children:" loop, at the right timing, and not before or after the loop.
Hi,
I wonder if there is a small issue in the file automata.py, function __words_with_wildcard, between lines 128 and 147, when the case letter=='*' is processed.
If the dictionary is made of, for example, "CHIAC" and "CHIC", and the query is "CHI*C", the result will be return in an incorrect alphabetical order : "CHIC" then "CHIAC".
This is because the case words_at_current_level is processed before checking the children.
So, for "CHI*C",
Any idea? Or maybe did I misunderstood the code?
Best,
Lionel
The text was updated successfully, but these errors were encountered: