Skip to content

Instantly share code, notes, and snippets.

View HaneenDweik's full-sized avatar
🏠
Working from home

Haneen Dweik HaneenDweik

🏠
Working from home
View GitHub Profile
@HaneenDweik
HaneenDweik / autocorrrect.py
Created October 29, 2020 11:30 — 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.
"""