Metadata-Version: 2.4
Name: polytext2num
Version: 0.3.1
Summary: Convert written-out numbers to digits in multiple languages using a fast Rust + Python binding.
Author-email: Iskaj <iskajjanssen1@hotmail.com>
License: MIT
Requires-Python: >=3.7
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# 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
```python
from polytext2num import txt2num, word2num

print(word2num("negenhonderdvijfenzestig", language="dutch"))
# → "965"

print(word2num("two hundred and thirty four", language="english"))
# → "234"

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."
```
