A small library to convert text numbers to digits in a string
Project description
Usage
Python 3 only!
from t2d import Text2Digits
Text2Digits().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
Built Distribution
Close
Hashes for text2digits-careless25-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3c3b3b526cea975ca02c311dd42352e8b8de4febaa91f8a69f1ea085e3abe41 |
|
MD5 | 34564927c931a18c231ee3eec19831e9 |
|
BLAKE2b-256 | e5b3531c9974037c37511f978c23379dfcb692ef1e7f8661fc904ed15e92a5ee |
Close
Hashes for text2digits_careless25-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64b86aee60dc99dac3a148aa12857bb28ab79e77558600a62e69e34a170d9bd4 |
|
MD5 | ed44d91764ac9a4895e3038d6fea0776 |
|
BLAKE2b-256 | 877129e1178dc833efa837fc73e9b5765e2fa70bbf8baaea5bc57a9c043d3f0f |