Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions SpellChecker/spellchecker.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import enchant
from enchant.checker import SpellChecker
from enchant.tokenize import EmailFilter,URLFilter
dictionary = enchant.request_dict("en_US")
spell=SpellChecker("en-US",filters=[EmailFilter,URLFilter])
filepath=str(input('Enter file location'))
fileopen=open(filepath)
#print(fileopen.read())
content=fileopen.read()
spell.set_text(content)
for err in spell:
print("Misspelled word is: "+err.word+' at position '+ str(err.wordpos))

print("Misspelled word is: "+err.word+' at position '+ str(err.wordpos)+" "
+"suggestions"+str(dictionary.suggest(err.word)))