This repository has been archived by the owner on Oct 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Danylo Yemchenko edited this page Aug 9, 2021
·
10 revisions
pip install numberize
or
pip install /path/to/numberize-1.0.0-py3-none-any.whl
if you prefer to store it local
In the current version there's only one function available.
import numberize
numberizer = numberize.Numberizer(lang='ru') #or 'uk', 'en'
print(
numberizer.replace_numerals(
"""
"сто" - очень простое слово. пятьсот девяносто два миллиона долларов.
девять-восемь, тридцати шести и пяти
"""
)
)
Output:
>>> "100" - очень простое слово. 592000000 долларов.
9-8, 36 и 5
It's that simple
Used morphological analyzer:
- https://github.com/kmike/pymorphy2 - Morphological analyzer / inflection engine for Russian and Ukrainian languages
Feel free to add links to your projects, if they are using this library or related to it in any way:
- https://github.com/volkovskey/exchange-rates-tg-bot - Bot for currency rates. Works in the background in group chat (and private messages) and converts the currency from your message to pre-configured currencies.