Python compatibility wrapper for computing string edit distances and similarities using fast Levenshtein algorithms.
88
Build a spell checking utility that finds the closest matching words from a dictionary for potentially misspelled input words.
@generates
def find_closest_match(word: str, dictionary: list[str]) -> tuple[str, int]:
"""
Finds the closest matching word from a dictionary.
Args:
word: The potentially misspelled word to check
dictionary: List of valid words to compare against
Returns:
A tuple containing (closest_word, distance) where closest_word
is the best match from the dictionary and distance is the
minimum edit distance found
"""
passProvides string edit distance calculation support.
Install with Tessl CLI
npx tessl i tessl/pypi-python-levenshteindocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10