Skip to main content

Georgian alphabet and language utilities for Natural Language Processing, script conversion and more.

Project description

AnbaniPy

tests codecov PyPI Python versions License: GPL v3

Georgian Python toolkit for NLP, Transliteration and more. Partially based on anbani.js.

Install

pip install anbani

Transliteration and NLP utilities need only hjson. PDF / e-book extraction (anbani.nlp.utils.ebook2text) additionally requires PyMuPDF:

pip install anbani[pdf]

Quickstart

Transliteration example:

from anbani.core.converter import convert, interpret

interpret("გამარჯობა", "asomtavruli")

# 'ႢႠႫႠႰႿႭႡႠ'

Georgianisation example:

from anbani.nlp.georgianisation import georgianise

georgianise("gamarjoba - rogor xar - rasa iqm - kaia kata - kai erti")

# 'გამარჯობა - როგორ ხარ - რასა იქმ - კაია კატა - კაი ერთი'

Convert ebooks with qwerty encoding to unicode Mkhedruli:

from anbani.nlp.utils import ebook2text
from anbani.core.converter import classify_text
from anbani.core.converter import convert

text = ebook2text("/home/george/Dev/georgian-text-corpus/sources/mylibrary/raw/files/ჩარლზ დიკენსი - დევიდ კოპერფილდი.pdf")
print(text[:300])

print(classify_text(text))

print(convert(text, "qwerty", "mkhedruli")[:300])

# Carlz dikensi daviT koperfildi Tavi pirveli dabadeba me viqnebi gmiri Cemive sakuTari Tavgadasavlisa Tu sxva...

# latin

# ჩარლზ დიკენსი დავით კოპერფილდი თავი პირველი დაბადება მე ვიქნები გმირი ჩემივე საკუთარი თავგადასავლისა თუ სხვა...

Expand contractions:

from anbani.nlp.contractions import expand_text

text = "ილია ჭავჭავაძე (დ. 8 ნოემბერი, 1837, სოფელი ყვარელი — გ. 12 სექტემბერი, 1907, წიწამური)"

print(text)
print(expand_text(text))

# ილია ჭავჭავაძე (დ. 8 ნოემბერი, 1837, სოფელი ყვარელი — გ. 12 სექტემბერი, 1907, წიწამური)
# ილია ჭავჭავაძე (დაბადება 8 ნოემბერი, 1837, სოფელი ყვარელი — გარდაცვალება 12 სექტემბერი, 1907, წიწამური)

Contract them back:

from anbani.nlp.contractions import contract_text

print(contract_text("მასის ატომური ერთეული და ასე შემდეგ"))

# მ.ა.ე. და ა.შ.

To-Do

Feel free to fork this repo!

  • Tokenizer
  • Transliteration
  • Expand contractions
  • ebook2pdf converter
  • Stemmer
  • Lemmatizer
  • Stopwords

Resources used

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

anbani-0.10.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

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

anbani-0.10.0-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file anbani-0.10.0.tar.gz.

File metadata

  • Download URL: anbani-0.10.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anbani-0.10.0.tar.gz
Algorithm Hash digest
SHA256 68c305d79c1722f855b41a22b2e23121c491b34e490cf3bea723ac100f54255d
MD5 fca27d9c9c0ccd047437fab9dd1a667a
BLAKE2b-256 abc9ec0fc169deb7592372099a46c876b8e68b9106f8ac899253332c38b9d005

See more details on using hashes here.

Provenance

The following attestation bundles were made for anbani-0.10.0.tar.gz:

Publisher: publish.yml on Anbani/anbani.py

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

File details

Details for the file anbani-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: anbani-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anbani-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47ef30548e29277ab3c4d2160a4dc14665d4dae168554511f692ef9492c5f631
MD5 878cdd82c138d96defc67f7e7efe7945
BLAKE2b-256 c568e2dc11ed877675375ff17150a61b3d08f1efb9131e9ef1e67b618aa03934

See more details on using hashes here.

Provenance

The following attestation bundles were made for anbani-0.10.0-py3-none-any.whl:

Publisher: publish.yml on Anbani/anbani.py

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