Skip to main content

NLP toolkit based on the flexi-dict data structure, designed for efficient fuzzy search, with a focus on simplicity, performance, and flexibility.

Project description

flexi-nlp-tools

Python Versions Version

A natural language processing toolkit based on the flexi-dict data structure, designed for efficient fuzzy search, with a focus on simplicity, performance, and flexibility.

Table of Contents

  1. Numeral Converter
  2. Installation
  3. License

Numeral Converter

The Numeral Converter allows you to:

  • Convert written numbers (e.g., "forty-two") into integers (42).
  • Convert integers back into their textual numeral form, considering morphological parameters.
  • Find and replace numerals in a text with their numeric equivalents.

Demo

Try the Numeral Converter live: Numeral Converter Demo

Available Languages

  • Russian (ru)
  • English (en)
  • Ukrainian (uk)

Functions

numeral2int(text: str, lang: str) -> int

Converts a numeral text into its integer representation.

from numeral_converter import numeral2int

numeral2int(numeral="two thousand and twenty-five", lang='en', multi_threaded=True)
# Output: 2025

int2numeral(number: int, lang: str, case: str, gender: str, num_class: str) -> str

Converts an integer into a textual numeral based on the specified parameters.

from numeral_converter import int2numeral

int2numeral(
    2025,
    lang='uk',
    case="nominative",
    gender="neuter",
    num_class="ordinal"
)
# Output: дві тисячі двадцять п’яті

convert_numerical_in_text(text: str, lang: str) -> str

Finds and converts numerical words in a given text to their numeric representations.

from numeral_converter import convert_numerical_in_text

convert_numerical_in_text(
    "After twenty, numbers such as twenty-five, fifty, seventy-five, and one hundred follow.",
    lang="en"
)
# Output: After 20, numbers such as 25, 50, 75, and 100 follow.

get_available_languages() -> List[str]

Returns the list of supported languages for numeral conversion.

from numeral_converter import get_available_languages
get_available_languages()
# Output: ['uk', 'en', 'ru']

Installation

You can easily install flexi-nlp-tools from PyPI using pip:

pip install flexi-nlp-tools

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

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

Source Distribution

flexi_nlp_tools-0.2.2.tar.gz (49.3 kB view details)

Uploaded Source

Built Distribution

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

flexi_nlp_tools-0.2.2-py3-none-any.whl (56.3 kB view details)

Uploaded Python 3

File details

Details for the file flexi_nlp_tools-0.2.2.tar.gz.

File metadata

  • Download URL: flexi_nlp_tools-0.2.2.tar.gz
  • Upload date:
  • Size: 49.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.5

File hashes

Hashes for flexi_nlp_tools-0.2.2.tar.gz
Algorithm Hash digest
SHA256 430f1015be0559d4a3e1fdebf6d153d93aeb6bdd5253b2c92bc6f2cf8c0072a8
MD5 d0e34513afff6a45f2ed07b425f5651f
BLAKE2b-256 0b9d645b81ff5adc8b04556d6480bb9851c8f87b2c8a3e4cfa652c4b0b78ddc6

See more details on using hashes here.

File details

Details for the file flexi_nlp_tools-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for flexi_nlp_tools-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 90e4121062207d0f83f03366902402224046c13c7050ba1ee1709dcbda2e8b8e
MD5 620a2f473ae7307219b2ad46f9d78ae1
BLAKE2b-256 eedc2f99fdb855ca0fa6ea0538c26006121f9fbd1584adcb3fc4432b9e307c6a

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