Skip to main content

Disvortilo is a simple tool that breaks Esperanto words into roots and affixes.

Project description

Disvortilo

Disvortilo is a simple tool that breaks Esperanto words into roots and affixes.

Getting Started

You can install Disvortilo from PyPI using pip:

pip install disvortilo

Examples

from disvortilo import Disvortilo

disvortilo = Disvortilo()

print(disvortilo.parse("malliberejo"))
# > [('mal', 'liber', 'ej', 'o')]

# some have more than one possible output
print(disvortilo.parse("esperantistino"))
# > [('esper', 'ant', 'ist', 'in', 'o'), ('esperant', 'ist', 'in', 'o')]

# you can also get the morphemes along the their categories
print(disvortilo.parse_detailed("plibonigojn"))
# > [(('pli', WordPart.FULL_WORD), ('bon', WordPart.ROOT), ('ig', WordPart.SUFFIX), ('ojn', WordPart.POS))]

API Reference

Disvortilo

Parser class for splitting Esperanto words into morphemes.

Disvortilo.parse(word: str) -> list[tuple[str, ...]]

Returns all valid analyses of word. Each analysis is a tuple of morpheme strings in order.

Example return value:

[('esper', 'ant', 'ist', 'in', 'o'), ('esperant', 'ist', 'in', 'o')]

Disvortilo.parse_detailed(word: str) -> list[tuple[tuple[str, WordPart], ...]]

Like parse, but each morpheme is returned together with its detected category (WordPart). Each analysis is a tuple of (morpheme, WordPart) pairs.

Example return value:

[(('pli', WordPart.FULL_WORD), ('bon', WordPart.ROOT), ('ig', WordPart.SUFFIX), ('ojn', WordPart.POS))]

WordPart

Enum values used by parse_detailed:

  • PREFIX
  • ROOT
  • SUFFIX
  • FULL_WORD
  • POS
  • NUMBER
  • NAME
  • CORRELATIVE_START
  • CORRELATIVE_END

split_sentence(sentence: str) -> list[str]

Splits a sentence into Esperanto word-like tokens. Supports Esperanto diacritics, optional trailing apostrophes, and forms like 3 and 3an.

Example:

from disvortilo import split_sentence

split_sentence("Mi vidas 3an domon.")
# > ['Mi', 'vidas', '3an', 'domon']

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

disvortilo-0.7.11.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

disvortilo-0.7.11-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file disvortilo-0.7.11.tar.gz.

File metadata

  • Download URL: disvortilo-0.7.11.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for disvortilo-0.7.11.tar.gz
Algorithm Hash digest
SHA256 6df7d7bcd3527dca1edaca14c8bbeba0e5728b6caabfe2461841c896889fceed
MD5 36e68e96ee0f09a34bc86c764d7203e6
BLAKE2b-256 358a04e1ee17d19a7955afe3a9a035e749ed7a5b4091480136d1c0718ddc3150

See more details on using hashes here.

Provenance

The following attestation bundles were made for disvortilo-0.7.11.tar.gz:

Publisher: publish.yml on LerniloEO/disvortilo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file disvortilo-0.7.11-py3-none-any.whl.

File metadata

  • Download URL: disvortilo-0.7.11-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for disvortilo-0.7.11-py3-none-any.whl
Algorithm Hash digest
SHA256 095a84540d368cd08bbf1f698a3c6b74f2ad712c79fd6c1c9d39771e8d5290ec
MD5 72f6761503bd53a085e2873fa8037d6a
BLAKE2b-256 59bb8226f32adbef5daf22937e29b93d897c50fa4a336454da426eaa2ea299a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for disvortilo-0.7.11-py3-none-any.whl:

Publisher: publish.yml on LerniloEO/disvortilo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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