Skip to main content

Convert written-out numbers to digits in multiple languages using a fast Rust + Python binding.

Project description

polytext2num

Convert written out numbers (e.g. "duizendnegenhonderddrieënzeventig") into digits (1973) using a fast Rust + Python binding.

Based on: https://github.com/allo-media/text2num-rs

Works for the following languages:

  • Dutch ("nl")
  • English ("en")
  • French ("fr")
  • Spanish ("es")
  • German ("de")
  • Italian ("it)

Installation

pip install polytext2num

Usage

from polytext2num import txt2num

print(txt2num("duizendnegenhonderddrieënzeventig", "dutch"))    
# "1973"

print(txt2num("one thousand nine hundred seventy-three", "en")) 
# "1973"

print(txt2num("quatre-vingt-dix", "french")) 
# "90"

print(txt2num("I have two apples and one banana, twenty kegs.", "en", threshold = 10)) 
# "I have two apples and one banana, 20 kegs."

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

polytext2num-0.2.26-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (345.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

polytext2num-0.2.26-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (346.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

polytext2num-0.2.26-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (346.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

polytext2num-0.2.26-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (346.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

polytext2num-0.2.26-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (346.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

polytext2num-0.2.26-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (346.1 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

File details

Details for the file polytext2num-0.2.26-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.26-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e4082dccdd59303aa28647d58970a87f7d90e938f6742eafa11f906baa91112
MD5 a6028ed1dac7c38c842dc4cf9a9ff807
BLAKE2b-256 5a72228f7daddfed43245c9fae4962472979af7037246199a8cd7c4ffb7e50c4

See more details on using hashes here.

File details

Details for the file polytext2num-0.2.26-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.26-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cf75753480773ff5b48edbf3ebd40a93c64ae1757aa104ad14c02cd510ff4797
MD5 9b9b8f5c873099c59681016368631eae
BLAKE2b-256 f854c01abb76091a652a3d80682ccce5525476a67475a7d29a39a6198f5789a2

See more details on using hashes here.

File details

Details for the file polytext2num-0.2.26-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.26-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 86f95eddd572217afe0ff19f1a3b0087b951ea3d10bca8f62f018adbe2795b93
MD5 f5785ba9662da12cd8982d7e4120a9a8
BLAKE2b-256 68100761126412ce74b3fead782f563b0a8cda97c9d153f2934ced5a98c82ec8

See more details on using hashes here.

File details

Details for the file polytext2num-0.2.26-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.26-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3bcf5b7fa77d94a54de23896b982391fc0b7e844959c8744670bd84c14639cf5
MD5 8ec6ac2cbacdbadc6264ddeff56e650c
BLAKE2b-256 1af23dd6f8ad1d2f79aea4491d1cbe75e3941006800699ed89be301b7eb83a8d

See more details on using hashes here.

File details

Details for the file polytext2num-0.2.26-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.26-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 005100505f22bb08e709793cfe0a7a6dc98b38a2ffd47807dfde084a0c65c524
MD5 8791bfe0b1097308d1ec57299249aaaf
BLAKE2b-256 4095136a61edac1852f4b20f0f432dc47937a816efbe8c63991aaa1332ba149f

See more details on using hashes here.

File details

Details for the file polytext2num-0.2.26-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.26-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05a25dba42d7eae544c486ea4520a9e1cfaff1e04e802dd10c2dd1be65f04b23
MD5 2e87158fe498ada867cdc4f327ff76aa
BLAKE2b-256 a8531e28a54352de63cd266515da8db7231dda9610e25dd3cfd0162490b2e944

See more details on using hashes here.

Supported by

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