A small library to convert text numbers to digits in a string
Project description
Usage
Python 3 only!
from text2digits import text2digits
t2d = text2digits.Text2Digits()
print(t2d.convert("I was born in nineteen ninety two and am twenty six years old!"))
Output:
"i was born in 1992 and am 26 years old!"
I find this useful if using Alexa/Lex to convert audio to text and have to convert the text to digits.
Improvements/Issues
- Still need to add support for decimal numbers
- Need to add support for negative numbers
Acknowledgements
I have heavily used code from the SO answers from here: https://stackoverflow.com/questions/493174/is-there-a-way-to-convert-number-words-to-integers and improved upon them
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
text2digits-0.0.2.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for text2digits-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b5be5980dda3014be67446004446b25876befe8f69b4bff3d23b02828282069 |
|
MD5 | 49f18b97232beccab789a81e8b4dd8ed |
|
BLAKE2b-256 | 4c573e7156e824e94575a79ce1e7dfac8059a03246040cb51a58abccdb837aa8 |