Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions spell_corrector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Spelling Corrector
Just select a text file from the tkinter dialogue box and the spellings will be corrected in the file.
1 change: 1 addition & 0 deletions spell_corrector/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1. textblob
23 changes: 23 additions & 0 deletions spell_corrector/spell_corrector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from textblob import TextBlob
from tkinter import Tk
from tkinter import filedialog

gui = Tk()
gui.filename = filedialog.askopenfilename(initialdir="/",
title="Select file",
filetypes=(("txt files",
".txt"),
("all files", ".*")))
f = open(gui.filename, 'r')
s = []
for i in f:
s.append(i)
f.close()
for i in range(len(s)):
s[i] = TextBlob(s[i])
s[i] = s[i].correct()
f = open(gui.filename, 'w')
for i in range(len(s)):
s[i] = str(s[i])
f.write(s[i])
f.close()