pyspellchecker

0.9.0 · active · verified Sun Apr 12

pyspellchecker is a pure Python spell checker based on Peter Norvig's blog post, utilizing a Levenshtein Distance algorithm to find permutations and compare them to a word frequency list. It supports multiple languages including English, Spanish, German, French, Portuguese, Arabic, and Basque. The current version is 0.9.0, and it is actively maintained with updates to support newer Python versions.

Warnings

Install

Imports

Quickstart

Initialize SpellChecker, identify unknown words, and get corrections or candidate spellings.

from spellchecker import SpellChecker

spell = SpellChecker()

mispelled_words = spell.unknown(['something', 'is', 'hapenning', 'here'])

for word in mispelled_words:
    print(f"Correction for '{word}': {spell.correction(word)}")
    print(f"Candidates for '{word}': {spell.candidates(word)}")

view raw JSON →