Skip to content

A Python-based spell checker using the Wagner-Fischer distance algorithm πŸ“

Notifications You must be signed in to change notification settings

ImPavloh/wagner-fischer-spellcheck

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š WAGNER-FISCHER πŸ–‹οΈ

πŸ” Spell checker based on the Wagner-FischerΒΉ distance πŸ“

Python

ΒΉ A measure of the minimum number of operations required to transform one word into another.

🎯 Features

  • load_dictionary(file_path: str) -> Generator[str, None, None]: Load a dictionary of words from a file
  • wagner_fischer(word1: str, word2: str, threshold: int) -> float: Calculate the Wagner-Fischer distance between two words
  • spell_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 distance
  • print_help(): Print the help menu
  • print_settings(): Print the settings menu
  • user_interface() -> None: User interface to interact with the spell checker

πŸš€ Usage

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.

πŸ“œ Commands

  • check <word>: Check the spelling of a word
  • settings: Display the settings menu
  • help: Display the help menu
  • bye: Exit the program

βš™οΈ Command settings

  • dictionary <file_path>: Load a different dictionary file
  • threshold <value>: Set the maximum Wagner-Fischer distance for suggestions
  • top <number>: Set the number of suggestions to display

Credits

This project is a fork of the original work by b001, inspired by his video "The Algorithm Behind Spell Checkers" πŸŽ₯

About

A Python-based spell checker using the Wagner-Fischer distance algorithm πŸ“

Topics

Resources

Stars

Watchers

Forks

Languages

  • Python 100.0%