π Spell checker based on the Wagner-FischerΒΉ distance π
load_dictionary(file_path: str) -> Generator[str, None, None]
: Load a dictionary of words from a filewagner_fischer(word1: str, word2: str, threshold: int) -> float
: Calculate the Wagner-Fischer distance between two wordsspell_check(word: str, dictionary: Generator[str, None, None], top: int, threshold: float) -> List[Tuple[str, float]]
: Check the spelling of a word and return the top suggestions based on the Wagner-Fischer distanceprint_help()
: Print the help menuprint_settings()
: Print the settings menuuser_interface() -> None
: User interface to interact with the spell checker
To use the spell checker, simply run the Python script and follow the instructions in the console. You can check the spelling of a word, change the settings and load a different dictionary.
check <word>
: Check the spelling of a wordsettings
: Display the settings menuhelp
: Display the help menubye
: Exit the program
dictionary <file_path>
: Load a different dictionary filethreshold <value>
: Set the maximum Wagner-Fischer distance for suggestionstop <number>
: Set the number of suggestions to display
This project is a fork of the original work by b001, inspired by his video "The Algorithm Behind Spell Checkers" π₯