Python | TextBlob.correct() method

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.



filter_none

edit
close

play_arrow

link
brightness_4
code

# 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)

chevron_right


Output :

GFG is a good company and always value their employed.

Example #2 :

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output :

I am good at spelling mistake.



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.