Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

text2digits-careless25-0.0.2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

text2digits_careless25-0.0.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file text2digits-careless25-0.0.2.tar.gz.

File metadata

  • Download URL: text2digits-careless25-0.0.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4

File hashes

Hashes for text2digits-careless25-0.0.2.tar.gz
Algorithm Hash digest
SHA256 dfbd87cc3e8d2b4accd436948cc870189732fc65e1fcadbfaf3ff3ddc0890ff3
MD5 2a87df935dd88cf1df83d740a2ea2c98
BLAKE2b-256 eadadba35e458ff9d3dbd7daabf99cf117078bd14019fe7b7e99513f978a867a

See more details on using hashes here.

File details

Details for the file text2digits_careless25-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: text2digits_careless25-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4

File hashes

Hashes for text2digits_careless25-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7357688531dc992af1909a4aaaf859f1f2e9dc37625188f3e430779b49b1c798
MD5 91b8fb5091e3765f12e16e641c8197a3
BLAKE2b-256 bfc2e42c5e6b0e38386a77420ba4567b309e5339a3f064fa798915461c72e964

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page