From df455170896cc8a382ec866830376f6a092a3469 Mon Sep 17 00:00:00 2001 From: Jay Paliwal Date: Fri, 9 Oct 2020 10:47:41 +0530 Subject: [PATCH 1/3] Added Spelling corrector script --- spelling_corrector/README.md | 0 spelling_corrector/requirements.txt | 0 spelling_corrector/spell_corrector.py | 19 +++++++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 spelling_corrector/README.md create mode 100644 spelling_corrector/requirements.txt create mode 100644 spelling_corrector/spell_corrector.py diff --git a/spelling_corrector/README.md b/spelling_corrector/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/spelling_corrector/requirements.txt b/spelling_corrector/requirements.txt new file mode 100644 index 000000000..e69de29bb diff --git a/spelling_corrector/spell_corrector.py b/spelling_corrector/spell_corrector.py new file mode 100644 index 000000000..2e863699d --- /dev/null +++ b/spelling_corrector/spell_corrector.py @@ -0,0 +1,19 @@ +from textblob import TextBlob +from tkinter import * +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() \ No newline at end of file From 6debbab05e71e82c0ef060a2b3268ddb18f60a7d Mon Sep 17 00:00:00 2001 From: Jay Paliwal Date: Fri, 9 Oct 2020 10:50:29 +0530 Subject: [PATCH 2/3] Added Spelling corrector script --- spelling_corrector/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spelling_corrector/README.md b/spelling_corrector/README.md index e69de29bb..cff3efc52 100644 --- a/spelling_corrector/README.md +++ b/spelling_corrector/README.md @@ -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. \ No newline at end of file From 85349bf82ab2408cf85c3a8e698d11d3d6a9dbc9 Mon Sep 17 00:00:00 2001 From: Jay Paliwal Date: Fri, 9 Oct 2020 10:53:06 +0530 Subject: [PATCH 3/3] Added Spelling corrector script --- spelling_corrector/README.md | 2 +- spelling_corrector/requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spelling_corrector/README.md b/spelling_corrector/README.md index cff3efc52..756b55952 100644 --- a/spelling_corrector/README.md +++ b/spelling_corrector/README.md @@ -1,2 +1,2 @@ -#Spelling Corrector +# Spelling Corrector Just select a text file from the tkinter dialogue box and the spellings will be corrected in the file. \ No newline at end of file diff --git a/spelling_corrector/requirements.txt b/spelling_corrector/requirements.txt index e69de29bb..6cf83efe8 100644 --- a/spelling_corrector/requirements.txt +++ b/spelling_corrector/requirements.txt @@ -0,0 +1 @@ +1. textblob \ No newline at end of file