Transforms written numbers in German to numbers.
Project description
word2num-de
EN
- Transforms written numbers in German to numbers.
- Works for numbers 0-999999
DE
- Übersetzt ausgeschriebene Zahlen in (auf Deutsch) in Zahlen
- Unterstützt Zahlen zwischen 0 und 999999.
Implementation based on the following project: https://github.com/IBM/wort-to-number
Installation
Package can be installed using pip.
pip install word2num-de
Usage example
Import the main function word_to_number.
from word2num_de import word_to_number
Given a written-out number, the function returns the number as an integer.
print(word_to_number("sechshunderteinundzwanzig"))
621
Larger numbers are also supported.
print(word_to_number("zweiunddreißigtausendfünfhundertachtundvierzig"))
32548
None is returned in case the word is not a number.
print(word_to_number("bäckerei"))
None
The function should also be robust to words including numbers in them (e.g.; Viereck, Servieren, Tausendsassa, etc.).
print(word_to_number("tausendsassa"))
None
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
word2num_de-1.1.tar.gz
(2.7 kB
view details)
File details
Details for the file word2num_de-1.1.tar.gz.
File metadata
- Download URL: word2num_de-1.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41c6808fcf505b15123953278e6eecd216010506b9fd1777cd3d8c34989d3a40
|
|
| MD5 |
dd3cc7bc93713d062a0e62234ed55c71
|
|
| BLAKE2b-256 |
86fafcfa49759572f219f382b2b5ed23ae5d1249eebe21db3967a8596fcb6a8d
|