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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfbd87cc3e8d2b4accd436948cc870189732fc65e1fcadbfaf3ff3ddc0890ff3 |
|
MD5 | 2a87df935dd88cf1df83d740a2ea2c98 |
|
BLAKE2b-256 | eadadba35e458ff9d3dbd7daabf99cf117078bd14019fe7b7e99513f978a867a |
Close
Hashes for text2digits_careless25-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7357688531dc992af1909a4aaaf859f1f2e9dc37625188f3e430779b49b1c798 |
|
MD5 | 91b8fb5091e3765f12e16e641c8197a3 |
|
BLAKE2b-256 | bfc2e42c5e6b0e38386a77420ba4567b309e5339a3f064fa798915461c72e964 |