aosingh / lexpy

Python package for lexicon; Trie and DAWG implementation.
GNU General Public License v3.0
55 stars 7 forks source link

In operator returning true when should be false #6

Closed TomsonBoylett closed 3 years ago

TomsonBoylett commented 3 years ago

The following code prints true.

trie = Trie()
trie.add_all(['ash', 'ashley'])
print('mash lolley' in trie)

Just needs a small change to return false when the letter is not in node.children https://github.com/aosingh/lexpy/blob/8535dcb1ec692dee588d4eff31f8d24cc31d1d95/lexpy/_base/automata.py#L39

TomsonBoylett commented 3 years ago

7

aosingh commented 3 years ago

Thank you @TomsonBoylett for creating a pull request. The changes have been successfully merged into the master branch. I will close this issue for now.