Skip to main content

A project to help spelling in Sanskrit (Devanaagari)

Project description

Akshara

Helps you spell!

Linting Tests Code Tests GitHub commit activity GitHub last commit

Akshara is a tool for all your spelling needs. The package offers functions to:

  1. Spell any given word (or any string) in Devanagari script.
  2. Construct a word from a given spelling.
  3. Count the number of svaras in a string.
  4. Count the number of sentences in a string.
  5. Obtain the syllables of a word.

Installation

Latest version of akshara can be directly installed from PyPI using

pip3 install akshara

Usage

Load the varnakaarya module

import akshara.varnakaarya as vk

Obtain spelling (vinyaasa) of a word

a = vk.get_vinyaasa("राम")       # a = ['र्', 'आ', 'म्', 'अ']
b = vk.get_vinyaasa("गमॢँ")       # b = ['ग्', 'अ', 'म्', 'ऌँ']
c = vk.get_vinyaasa("स पठति ।")  # c = ['स्', 'अ', ' ', 'प्', 'अ', 'ठ्', 'अ', 'त्', 'इ', ' ', '।']

Obtain syllables (akshara) of a word

a = vk.get_akshara("राम")       # a = ['रा', 'म']
b = vk.get_akshara("गमॢँ")       # b = ['ग', 'मॢँ']
c = vk.get_akshara("पठति")      # c = ['प', 'ठ', 'ति']

Create a word (shabda) from a given vinyaasa

d = vk.get_shabda(['स्', 'अ', 'ं', 'स्', 'क्', 'ऋ', 'त्' ,'अ', 'म्'])    # d = 'संस्कृतम्'
e = vk.get_shabda(['श्', 'इ', 'व्', 'अ', 'ः'])                        # e = 'शिवः'
f = vk.get_shabda(['द्', 'ए', 'व्', 'अ', 'द्', 'अ', 'त्', 'त्', 'अ३'])  # f = देवदत्त३

Count svaras, vyanjanas, ayogavaahas and vaakyas

g = "बुद्धं शरणं गच्छामि । धर्मं शरणं गच्छामि । सङ्घं शरणं गच्छामि ॥"

num_svaras = vk.count_svaras(g)            # num_svaras = 24
num_vyanjanas = vk.count_vyanjanas(g)      # num_vyanjanas = 30
num_ayogavaahas = vk.count_ayogavaahas(g)  # num_ayogavaahas = 6
num_varnas = vk.count_varnas(g)            # num_varnas = 60
num_vaakyas = vk.count_vaakyas(g)          # num_vaakyas = 3

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

akshara-1.1.0.tar.gz (344.7 kB view details)

Uploaded Source

Built Distribution

akshara-1.1.0-py3-none-any.whl (360.5 kB view details)

Uploaded Python 3

File details

Details for the file akshara-1.1.0.tar.gz.

File metadata

  • Download URL: akshara-1.1.0.tar.gz
  • Upload date:
  • Size: 344.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for akshara-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e680af61a4bcc81a648e1389c357873ce0e21d19530ec953addcef0e6a0dc989
MD5 b00ccd180c2a644b216943a0711f0c63
BLAKE2b-256 8213fa74dade9a9ee593ff312b4fb76d7815ac3569d967346a51dd1e24347b28

See more details on using hashes here.

File details

Details for the file akshara-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: akshara-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 360.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for akshara-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 361b557d88419cb0c95fa0e703562514b9e81a51c7e2915d72818c8e7ee4a5b5
MD5 4adabc03eb9f2739be21dc81d0bcc828
BLAKE2b-256 2186fa9647056312bb5cf50c99a319b20f64baf5a5317490004c8f1eb8213569

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page