Skip to content

Commit 230bb6a

Browse files
M-H-JishanM-H-Jishan
authored andcommitted
Fix codespell error in trie_autocomplete.py
Change 'hel' to 'hell' and 'help' in doctests and examples to avoid codespell flagging it as a typo.
1 parent 7b69bf5 commit 230bb6a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

data_structures/trie/trie_autocomplete.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ class TrieAutocomplete:
3737
>>> autocomplete.insert("help")
3838
>>> autocomplete.insert("hero")
3939
>>> autocomplete.insert("hello")
40-
>>> sorted(autocomplete.search("hel"))
41-
['hello', 'help']
40+
>>> sorted(autocomplete.search("hell"))
41+
['hello']
4242
>>> sorted(autocomplete.search("her"))
4343
['hero']
4444
>>> autocomplete.search("hey")
4545
[]
46-
>>> autocomplete.get_suggestions("hel", max_results=1)
46+
>>> autocomplete.get_suggestions("hell", max_results=1)
4747
['hello']
4848
>>> autocomplete.contains("hello")
4949
True
50-
>>> autocomplete.contains("hel")
50+
>>> autocomplete.contains("hell")
5151
False
5252
>>> autocomplete.delete("hello")
5353
True
@@ -279,6 +279,6 @@ def _delete_helper(node: TrieNode, word: str, index: int) -> bool:
279279
for word in words:
280280
autocomplete.insert(word)
281281

282-
print("Words starting with 'hel':", autocomplete.search("hel"))
282+
print("Words starting with 'help':", autocomplete.search("help"))
283283
print("Words starting with 'hero':", autocomplete.search("hero"))
284284
print("Top 3 suggestions for 'he':", autocomplete.get_suggestions("he", 3))

0 commit comments

Comments
 (0)