Skip to main content

Tiny Tamil text utilities: normalize, tokenize, stopword removal, graphemes

Project description

tamil-utils

Tiny Tamil‑first text utilities for Unicode‑safe text handling and preprocessing.

PyPI CI Docs License: MIT


Features

  • Core: normalize, tokens, remove_stopwords, graphemes
  • Sentences & numerals: sents, to_arabic_numerals, to_tamil_numerals
  • Script & transliteration: script_of, token_scripts, transliterate_iso15919
  • v0.2: ngrams, bigrams, trigrams, word_counts, syllables, sort_tamil

Install

pip install tamil-utils

Quick start (Python)

from tamil_utils import (
    normalize, tokens, remove_stopwords, graphemes,
    sents, to_arabic_numerals, to_tamil_numerals,
    script_of, token_scripts, transliterate_iso15919,
    word_counts, sort_tamil
)

s = "இது ஒரு சோதனை. இது இரண்டாம்? சரி! ௨௦௨௫"
print(tokens(s))                                # ['இது','ஒரு','சோதனை','இது','இரண்டாம்','சரி','௨௦௨௫']
print(remove_stopwords(tokens(s), preset="ta")) # stopwords removed
print(graphemes("👩‍🚀"))                        # emoji‑safe graphemes
print(sents(s))                                  # sentence split
print(to_arabic_numerals("௨௦௨௫"))                 # "2025"
print(transliterate_iso15919("தமிழ்"))             # "tamiḻ"
print(token_scripts(tokens("கோட்123 hello")))     # [('கோட்123','Mixed'), ('hello','Latin')]

# v0.2
print(word_counts("தமிழ் NLP தமிழ் பயன்பாடு தமிழ் NLP", n=2, top=2))  # bigram freq
print(sort_tamil(["இலங்கை","ஆதி","அடி"]))                         # ['அடி','ஆதி','இலங்கை']

CLI

# tokens / stopwords / graphemes / sents
python -m tamil_utils.cli tokens "இது ஒரு சோதனை"
python -m tamil_utils.cli tokens --rmstop "இது ஒரு சோதனை"
python -m tamil_utils.cli graphemes "👩‍🚀"
python -m tamil_utils.cli sents "இது ஒரு வாக்கியம். இது இரண்டாம்? சரி!"

# numerals
python -m tamil_utils.cli to-arabic "௨௦௨௫"   # -> 2025
python -m tamil_utils.cli to-tamil  "123"     # -> ௧௨௩

# transliteration & script tags
python -m tamil_utils.cli to-iso "தமிழ்"
python -m tamil_utils.cli script "கோட்123 hello"

# v0.2: n‑grams, frequency, syllables, sort
python -m tamil_utils.cli ngrams -n 3 "தமிழ் NLP பயன்பாடு"
python -m tamil_utils.cli freq -n 2 --top 5 "தமிழ் NLP தமிழ் பயன்பாடு தமிழ் NLP"
python -m tamil_utils.cli syllables "தமிழ் test 123"
# sort: pass words as args or via stdin
python -m tamil_utils.cli sort இலங்கை ஆதி அடி
type words.txt | python -m tamil_utils.cli sort

Links


Contributing

PRs welcome! Please run tests locally and ensure linting passes.


License

MIT © Arulnidhi Karunanidhi

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

tamil_utils-0.2.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

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

tamil_utils-0.2.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file tamil_utils-0.2.1.tar.gz.

File metadata

  • Download URL: tamil_utils-0.2.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for tamil_utils-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e8bb9b09c81a1d29de2f333237e7f0d1cc1ea9acdcd120738052116c900ef103
MD5 eeadc9144a0079a2044e05ab9116292d
BLAKE2b-256 8cd3e5d9b846b8ebe82adfd80eee85add5b9ebeb435a2005d72eff8a44e32c3d

See more details on using hashes here.

File details

Details for the file tamil_utils-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: tamil_utils-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for tamil_utils-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81bd29b9f3accd736815e73d584c22c5144109b8b67ee7c96d663cff64dcab9f
MD5 cbbb53d511df93b6ecd9f48fcb1031e2
BLAKE2b-256 34e2a21fdd8ea772108e2da2f61d8898fcbcf5a5cba29a189210a529badc0f4f

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