Skip to content
Related Articles

Related Articles

Improve Article

Python | TextBlob.correct() method

  • Last Updated : 19 Jul, 2021
Geek Week

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.

Python3




# import TextBlob
from textblob import TextBlob
 
gfg = TextBlob("GFG is a good compny and alays valule ttheir employes.")
 
# using TextBlob.correct() method
gfg = gfg.correct()
 
print(gfg)

Output:

GFG is a good company and always value their employed. 
 

Example #2:



Python3




# import TextBlob
from textblob import TextBlob
 
gfg = TextBlob("I amm goodd at speling mstake.")
 
# using TextBlob.correct() method
gfg = gfg.correct()
 
print(gfg)

Output :

I am good at spelling mistake. 
 

 

 

 

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :