Last Updated : 09 Dec, 2022
With the help of TextBlob.correct() method, we can get the corrected words if any sentence have spelling mistakes by using TextBlob.correct() method.
Syntax : TextBlob.correct()
Return : Return the correct sentence without spelling mistakes.
Example #1 :
In this example, we can say that by using TextBlob.correct() method, we are able to get the correct sentence without any spelling mistakes.
# import TextBlob
from textblob import TextBlob
gfg = TextBlob("GFG is a good compny and alays value ttheir employees.")
# using TextBlob.correct() method
gfg = gfg.correct()
print(gfg)
Output:
GFG is a good company and always value their employees.
Example #2:
Python3
# import TextBlob
from textblob import TextBlob
gfg = TextBlob("I amm goodd at spelling mstake.")
# using TextBlob.correct() method
gfg = gfg.correct()
print(gfg)
Output :
I am good at spelling mistake.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4