Skip to main content

To convert numbers in word form to digits

Project description

WordToDigits Package

Author: Abhishek Rawat

This package is used to convert the numbers present in word form in an input passage to the traditional numeric (digits) form. The word representation of numbers could be anywhere in the passage. It works from zero to nine hundred and ninety nine million nine hundred and ninety nine thousand and nine hundred and ninety nine. It also takes care of the decimal part, if present.

An example on how to use the package is shown below:-

import wordtodigits

text1 = 'A car accelerates for five point two one seconds for a distance of one hundred and ten meters.'
print(wordtodigits.convert(text1))
#A car accelerates for 5.21 seconds for a distance of 110 meters.

text2 = 'three thousand and fifty three point five is the final score'
print(wordtodigits.convert(text2))
#3053.5 is the final score

If you find any bugs, or have any suggestions for improvement, contact me at abhishek18.official@gmail.com

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

wordtodigits-1.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

wordtodigits-1.0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file wordtodigits-1.0.1.tar.gz.

File metadata

  • Download URL: wordtodigits-1.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for wordtodigits-1.0.1.tar.gz
Algorithm Hash digest
SHA256 136a08c00f7857219813a228332688dd3660a4b432bd25aa575e25de93e8958c
MD5 20c52814cc12b7163aefcbeb162f0970
BLAKE2b-256 c819cef670fa12e32e5a1035283743b3f5f43667f4c885492af81bc470473ee9

See more details on using hashes here.

File details

Details for the file wordtodigits-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: wordtodigits-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for wordtodigits-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a22366e66171c4be8c0df4354e72cbf24b80a40a3e7b9f196216426832af4f94
MD5 6dbfd0c98b8ff66152818628126964eb
BLAKE2b-256 113a77a2a891cbf6b77f5ce07e85fedc4022a5bf997bfccc166ae2c30d30bae3

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