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

nlp-flexi-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.

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("two thousand and twenty-five", lang='en')
# 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 nlp-flexi-tools from PyPI using pip:

pip install nlp-flexi-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.1.0.tar.gz (21.5 kB view details)

Uploaded Source

Built Distributions

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

flexi_nlp_tools-0.1.0-py3-none-any.whl (53.7 kB view details)

Uploaded Python 3

flexi_nlp_tools-0.1.0-py2-none-any.whl (53.7 kB view details)

Uploaded Python 2

File details

Details for the file flexi-nlp-tools-0.1.0.tar.gz.

File metadata

  • Download URL: flexi-nlp-tools-0.1.0.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.10

File hashes

Hashes for flexi-nlp-tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fb3b34feaeb64263b4f259c68000702ecc627fe792225b1274776373054287a8
MD5 b61a3131021dd092bcddca4fdb6319d8
BLAKE2b-256 9a7827b717de06b5908b2461274133c141861ac2708fbe560ee01d9ceede4e1a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flexi_nlp_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51cc276da8e48b3549020ab9139fb238c3c6c987c0eb52c1c4b62c305b3511c1
MD5 1a4126466c35125fda602528e87a0298
BLAKE2b-256 df3ca4c8a9474d06313c69c02d32ec525e8c88f6ee7b789c966d95b2fb26d99a

See more details on using hashes here.

File details

Details for the file flexi_nlp_tools-0.1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for flexi_nlp_tools-0.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 da1c4c6e96bfa57997b177c7917149c885736900f1f995bc543daceb192d98a4
MD5 b2110ce933732019c609dcb67209e80a
BLAKE2b-256 5273578b5bb9cf37a1a37b5462f2859cc016ab7f0e96f415e3de550e4e77e5a7

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