skip to navigation
skip to content

pytypo 0.3.0

corrects English spelling mistakes and normalize. (e.g., "cooooooooooooooollllllllllllll" to "cool")


pytypo corrects English spelling mistakes. That feature is based on TYPO CORPUS ( and Wikipedia (

And this module normalizes also lengthened English expression having repeating letters. (e.g., this module converts “cooooooooooooooollllllllllllll” to “cool”)

That feature is based on the following paper: Samuel Brody and Nicholas Diakopoulos. Cooooooooooooooollllllllllllll!!!!!!!!!!!!!! using word lengthening to detect sentiment in microblogs. In EMNLP2011, pp. 562-570, 2011.

Contributions are welcome!


$ pip install pytypo


Import pytypo

>>> import pytypo

correct sentence

>>> pytypo.correct_sentence('you are coooolll!!!')
you are cool!
  • correct_sentence(str)

correct word

>>> pytypo.correct('okayyyyy')
  • correct(str)

Shorten repeated substring until threshould without dictionary

>>> pytypo.cut_repeat('mamisaaaaaan', 1)
>>> pytypo.cut_repeat('okayyyyy', 2)
  • cut_repeat(str, threshould)
    • Note that this method don’t use a lengthened expression normalize table (e.g., cooll -> cool). If you want to normalize such expression, use correct() or correct_sentence() method.


  • This module is licensed under MIT License.


0.3 (2017-10-18)

Add many cases from Wikipedia

0.2 (2016-04-15)

Add many cases

0.1 (2016-04-14)

First release.

File Type Py Version Uploaded on Size
pytypo-0.3.0.tar.gz (md5) Source 2017-10-18 72KB