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.
[](https://pypi.org/project/tamil-utils/)
[](https://github.com/arulnidhii/tamil-utils/actions)
[](https://arulnidhii.github.io/tamil-utils/)
---
## 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 (WIP)**: `ngrams`, `bigrams`, `trigrams`, `word_counts`, `syllables`, `sort_tamil`
---
## Install
```bash
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,
# v0.2 (WIP)
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 (WIP)
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 (WIP): 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
Status
Project details
Release history Release notifications | RSS feed
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.0.tar.gz
(11.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tamil_utils-0.2.0.tar.gz.
File metadata
- Download URL: tamil_utils-0.2.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f361373eb38d92de59bc6c602622f562e953104b5905e9891b5de8b13678858e
|
|
| MD5 |
ca724223c2cd6e274dc159ba5f93f7e5
|
|
| BLAKE2b-256 |
0d17a035f505b5d337c663308ae28edd28e6d3ab886292a715abe9f1d21e5623
|
File details
Details for the file tamil_utils-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tamil_utils-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01d0852e1858a7d08fa866be3f3f940058c7027bde550b63062bd75e525c73db
|
|
| MD5 |
fd53897427d0457925ed03d9dc5cfc6d
|
|
| BLAKE2b-256 |
fe15852084d0452d6856810c3196b69b0d7e1f7d7676f6db279c23f398b89769
|