Compare commits
2 commits
fbe470a5ec
...
61bf2009ee
| Author | SHA1 | Date | |
|---|---|---|---|
| 61bf2009ee | |||
| a3747b4f64 |
1 changed files with 2 additions and 2 deletions
|
|
@ -161,11 +161,11 @@ def get_fuzzy(self, key: str, max_distance: int = 0) -> Iterator[FuzzyResult[T]]
|
|||
yield from helper(current_word + c, child, current_row)
|
||||
|
||||
# Build the first row -- the edit distance from the empty string
|
||||
row = list(range(len(key) + 1))
|
||||
row = list(range(len(word) + 1))
|
||||
|
||||
# Base case for the empty string
|
||||
if (distance := row[-1]) <= max_distance and node._value != None:
|
||||
yield FuzzyResult(distance, "", node._value)
|
||||
for c, child in self._children.items():
|
||||
yield from helper(c, child, row)
|
||||
yield from helper(c, node, row)
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue