AUTOMATION SCRIPTS YOU NEED TO TRY — PART 5
10 Incredible Automation Scripts You Need To Try
Python’s Second Name is Automation
This is the part -5 of the series Automation scripts you need to try.
1. Correct Spelling 🎃
We all write tons of words every day, from writing articles, project reports, emails, etc. Most of us use some online spelling correction tool like Grammarly, to improve the standards of our writing. This python automation script can replicate the features of these tools by providing a one-way solution for grammar correction in single or multiple documents.
Libraries:-
Textblob - a python library that provides a simple API for text processing and performing different natural language processing tasks.
from textblob import TextBlob
content = " ".join([line.strip() for line in open('content.txt')])
def correct_spelling(doc):
new_doc = TextBlob(doc)
result = new_doc.correct()
return result
data = correct_spelling(content)
with open("cleaned_content.txt",'a',newline='\n') as f:
f.write(str(data))
Script Applications:-
- Building Automated Grammer Correction Tool.