numerizer
A Python module to convert natural language numerics into ints and floats. This is a port of the Ruby gem [numerizer](https://github.com/jduff/numerizer.git)
Installation
The NLG library can be installed from PyPI as follows:
$ pip install numerizer
or from source as follows:
$ git clone https://github.com/jaidevd/numerizer.git
$ cd numerizer
$ pip install -e .
Usage
>>> from numerizer import numerize
>>> numerize('forty two')
'42'
>>> numerize('forty-two')
'42'
>>> numerize('four hundred and sixty two')
'462'
>>> numerize('one fifty')
'150'
>>> numerize('twelve hundred')
'1200'
>>> numerize('twenty one thousand four hundred and seventy three')
'21473'
>>> numerize('one million two hundred and fifty thousand and seven')
'1250007'
>>> numerize('one billion and one')
'1000000001'
>>> numerize('nine and three quarters')
'9.75'
>>> numerize('platform nine and three quarters')
'platform 9.75'
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
numerizer-0.1.3.tar.gz
(3.9 kB
view details)
File details
Details for the file numerizer-0.1.3.tar.gz.
File metadata
- Download URL: numerizer-0.1.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37a136043c1b467d263a6fc611568106eb0c3d4a33f4a8b9a5857bf5ea6ef09c
|
|
| MD5 |
4be1f61b332e519eb91dd5d6cfed67b1
|
|
| BLAKE2b-256 |
61475ca7da9ae052a8005dfd1008a9808610a4ff8c00e55f0aa81534b84fd09b
|