IastFramework
A package used to convert indic language to iast and iast to inidc langauge viceversa.
Installation
pip install -i https://test.pypi.org/simple/ IastFramework # test pypi
pip install IastFramework # still in development
Usage
import sqlite3
import os
import sys
from IastFramework import IAST
#create a IAST object
iast = IAST()
# customization
# iast = IAST(db_path='iast-token.db', table_name_alpha='IndianAlphabet',table_name_barakadi='Barakhadi')
Converting All Indic language(hinid, telugu, kannada, Malayalam, Odia, Bengali&Assamese, Gujarati, tamil) to iast
InProgress Research and Analysis is going on in Tamil Script, Nastaliq Script, Sinhala Script.
iast.to_iast('''ଧୃତରାଷ୍ଟ୍ର ଉଵାଚ |\tধৃতরাষ্ট্র উবাচ |\tધૃતરાષ્ટ્ર ઉવાચ |\tத்றுதராஷ்ட்ர உவாச |''')
# >>>
# dhr̥tarāṣṭra uvāca | dhr̥tarāṣṭra ubāca | dhr̥tarāṣṭra uvāca | ta்ṟutarāṣa்ṭa்ra uvāca |
Convert iast to Indic Language
Currently this can convert IAST to kannada, hindi, telugu, malyalam
word = 'kaṁ itāḥ kiṁ yuyutsavaḥ kl̥̄ kl̥ pāṇḍavānīkaṁ itāḥ kiṁ āṁ īṁ yuyutsuṁ kiṁ rānsakhīṁstathā'
print(IAST.iast2tokens( word) )
# >>> ['k', 'a', 'ṁ', ' ', 'i', 't', 'ā', 'ḥ', ' ', 'k', 'i', 'ṁ', ' ', 'y', 'u', 'y', 'u', 't', 's', 'a', 'v', 'aḥ', ' ', 'k', 'l̥̄', ' ', 'k', 'l̥', ' ', 'p', 'ā', 'ṇ', 'ḍ', 'a', 'v', 'ā', 'n', 'ī', 'k', 'a', 'ṁ', ' ', 'i', 't', 'ā', 'ḥ', ' ', 'k', 'i', 'ṁ', ' ', 'ā', 'ṁ', ' ', 'ī', 'ṁ', ' ', 'y', 'u', 'y', 'u', 't', 's', 'u', 'ṁ', ' ', 'k', 'i', 'ṁ', ' ', 'r', 'ā', 'n', 's', 'a', 'kh', 'ī', 'ṁ', 's', 't', 'a', 'th', 'ā']
indic_lang = 'Telugu' # 'Kannada' # 'Telugu', 'Odia', 'Gujarati', 'Bengali-Assamsese',
# indic_lang='Devanagari'
# indic_lang='Kannada'
# indic_lang='Telugu'
# indic_lang='Odia'
# indic_lang='Bengali–Assamese'
# indic_lang='Tamil' # In development state
print(iast.iast2indic(word,indic_lang))
IAST.dict_tokens2indic(dict_tokene_list,halant)
# >>> కం ఇతాః కిం యుయుత్సవః పాణ్డవానీకం ఇతాః కిం ఆం ఈం కిం యుయుత్సుం రాన్సఖీంస్తథా
Phonetic Hash for Phonetic Search
search_word = 'dhr̥tarāṣṭra uvāca'
search_word = search_word.strip().lower()
# to_iast
search_iast = iast.to_iast(search_word) # similar to idempotent matrx no loss of info if ':' not present
# >>> dhr̥tarāṣṭra uvāca
print(search_iast)
print("# Original Text:", search_word)
print('BASIC HASHING: ',IAST.basic_hash(search_iast))
print('NORMAL HASHING',IAST.normal_hash(search_iast))
# >>> Original Test: dhr̥tarāṣṭra uvāca
# >>> BASIC HASHING: drtrstr vc
# >>> NORMAL HASHING: drtarastra uvaca
Contribute
InProgress Research and Analysis is going on in Tamil Script, Nastaliq Script, Sinhala Script.
Issue
Please open an issue
here in case any bug was encountered.
Mail id : dankarthik25@gmail.com
Metadata
Release files for IastFramework 0.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| IastFramework-0.0.11.tar.gz | 15.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| IastFramework-0.0.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.3 kB
Release files / IastFramework-0.0.11.tar.gz
| Download URL | IastFramework-0.0.11.tar.gz |
|---|---|
| Size | 15.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c98da2ba52cf7aba3245934edee61bdaa00839a4d091aa344fa2c5c2de3832fe
|
|
BLAKE2b-256 checksum How to use checksums |
f3d7a6073b9f486337011bee756f2fa8fcf1def2568c4206262760df3eea0886
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Release files / IastFramework-0.0.11-py3-none-any.whl
| Download URL | IastFramework-0.0.11-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b55a3d8fc8c228058aaf9aca834fbf93fb05acd08ef4f428a13b70e912ff97e
|
|
BLAKE2b-256 checksum How to use checksums |
b5d8c14100efacc389688a9980bfe4e12b8f8492eb5a056e24254981e78d2f39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|