Skip to content

Instantly share code, notes, and snippets.

View hunar4321's full-sized avatar

Hunar Ahmad hunar4321

View GitHub Profile
@hunar4321
hunar4321 / autocorrrect.py
Created May 7, 2021 19:39 — forked from bgreenlee/autocorrrect.py
Simple ngram autocorrect #python #algorithms
import os.path
import collections
from operator import itemgetter
WORDFILE = '/usr/share/dict/words'
class Autocorrect(object):
"""
Very simplistic implementation of autocorrect using ngrams.
"""