-
Notifications
You must be signed in to change notification settings - Fork 0
/
TXT.GRAMMER.CORRECTION.py
33 lines (33 loc) · 1.86 KB
/
TXT.GRAMMER.CORRECTION.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#--
#-- ************************************************************************************************************:
#-- ******************************************** GRAMMER CORRECTION ********************************************:
#-- ************************************************************************************************************:
#-- Author: JBALLARD (JEB) :
#-- Date: 2023.3.07 :
#-- Script: TXT-GRAMMER.CORRECTION.py :
#-- Purpose: A python script that Proofreads a text file & fixes spelling errors. :
#-- Version: 1.0 :
#-- ************************************************************************************************************:
#-- ************************************************************************************************************:
#--
#-- *************************************************:
#-- DEFINE PARAMS, CONFIG PATHS, IMPORT CLASSES :
#-- *************************************************:
# PIP INSTALL TEXTBLOB
from textblob import *
# FIX PARAGRAPH SPELLING:
def fix_paragraph_words(paragraph):
sentence = TextBlob(paragraph)
correction = sentence.correct()
print(correction)
# FIX SPELLING MISTAKES:
def fix_word_spell(word):
word = Word(word)
correction = word.correct()
print(correction)
fix_paragraph_words("NOTE - SAMPLE TEXT:")
fix_word_spell("maangoo")
#--
#-- ************************************************:
#-- END OF SCRIPT :
#-- ************************************************: