pytypo
pytypo corrects English spelling mistakes. That feature is based on TYPO CORPUS (http://luululu.com/tweet/) and Wikipedia (https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines)
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. http://aclweb.org/anthology//D/D11/D11-1052.pdf
Contributions are welcome!
Installation
$ pip install pytypo
Usage
Import pytypo
>>> import pytypo
correct sentence
>>> pytypo.correct_sentence('you are coooolll!!!')
you are cool!
correct_sentence(str)
correct word
>>> pytypo.correct('okayyyyy')
okay
correct(str)
Shorten repeated substring until threshould without dictionary
>>> pytypo.cut_repeat('mamisaaaaaan', 1)
mamisan
>>> pytypo.cut_repeat('okayyyyy', 2)
okayy
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.
License
This module is licensed under MIT License.
CHANGES
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.
Metadata
Release files for pytypo 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytypo-0.3.0.tar.gz | 74.2 kB | Without provenance | Details for pytypo-0.3.0.tar.gz |
Release files / pytypo-0.3.0.tar.gz
| Download URL | pytypo-0.3.0.tar.gz |
|---|---|
| Size | 74.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab0467dc93725b4fb1d2c2c15ede93a1825ec27fae63bd1af59d7c8d257913cc
|
|
BLAKE2b-256 checksum How to use checksums |
9f80b0578690bcac288cf9af76abecf2fd30978ea75ebe67da817c018c444abb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pytypo 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.