We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c9914b commit aaced0bCopy full SHA for aaced0b
pythainlp/util/trie.py
@@ -53,15 +53,15 @@ def remove(self, word: str) -> None:
53
self.words.remove(word)
54
# then remove from nodes
55
parent = self.root
56
- threes = [] # track path to leaf
+ data = [] # track path to leaf
57
for ch in word:
58
child = parent.children[ch]
59
- threes.append((parent, child, ch))
+ data.append((parent, child, ch))
60
parent = child
61
# remove the last one
62
child.end = False
63
# prune up the tree
64
- for parent, child, ch in reversed(threes):
+ for parent, child, ch in reversed(data):
65
if child.end or child.children:
66
break
67
del parent.children[ch] # remove from parent dict
0 commit comments