Skip to content

Instantly share code, notes, and snippets.

View Veerinderr's full-sized avatar

Veerinderpal Veerinderr

  • Malaysia
View GitHub Profile
@Veerinderr
Veerinderr / autocorrrect.py
Created November 13, 2020 10: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.
"""