Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Made small corrections
  • Loading branch information
SaiSrichandra committed Oct 9, 2020
commit b974b3e2922bc9032821748a11d05008a79e5734
7 changes: 0 additions & 7 deletions spellingcorrector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,3 @@ Then you can run the script!
## Instructions to run the script

`python SpellCorrector.py text_input`

Example:
`python SpellCorrector.py Hello, Thank yu for using ths scrpt`

Output for above code is:

`Hello, Thank you for using the script`
12 changes: 5 additions & 7 deletions spellingcorrector/SpellCorrector.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,24 @@
from textblob import TextBlob
import sys



# Fuction for correcting spelling erors
# Function for correcting spelling errors

def spell_correct(text):
spell = TextBlob(text)

spell = TextBlob(text)
# Using TextBlob.correct() method to correct spelling errors

after_correction = spell.correct()
return after_correction

# Takes text input from user and call the spell_correct() function


def main():
after_correction = ""
for text in map(spell_correct, sys.argv[1:]):
after_correction += str(text) + ' '
print(after_correction)

# Running the main() function

if __name__ == '__main__':
main()
main()