chandas

Metrical analysis tools for indic languages in general, and sanskrit in particular


Keywords
indic, metre, meter, hindi, sanskrit, samskritam, kannada, devanagari, tamil, malayalam, telugu, gurumukhi, gujarati, bengali, oriya), SLP1, WX
License
MIT
Install
pip install chandas==0.0.4

Documentation

Chandas

Build Status Documentation Status

Intro

This is a python package for Indic language (mostly sanskrit) metre identification and related tasks like syllabization. This module expects devanAgarI input, and currently produces IAST output.

For users

Installation or upgrade:

  • sudo pip install chandas -U
  • sudo pip install git+https://github.com/sanskrit-coders/chandas/@master -U
  • Web.

Usage

For more examples, see tests.

Metre Identification

from chandas import identify
pattern_lines = identify.to_pattern_lines("निर्दिष्टाङ् कुलपतिना स पर्णशालाम् अध्यास्य प्रयतपरिग्रहद्वितीयः ।\nतच्छिष्याध्ययननिवेदितावसानां सव्ँविष्टः कुशशयने निशान् निनाय ॥".split("\n"))
id_result = identify.identifier.IdentifyFromPatternLines(pattern_lines)
assert id_result['exact'] == "Praharṣiṇī"

Syllabization

from chandas import syllabize
syllabize.get_syllables(u"ॐ मणि पद्मे ऽहम्") == "ओम् म णि पद् मे हम्"
syllabize.get_graphemes(u"बिक्रममेरोनामहो") == "बि क् र म मे रो ना म हो".split(" ")

Shared test data

Please feel free to use test data published here to test your own modules:

For external collaborators

For contributors

Contact

Have a problem or question? Please head to github.

Packaging

  • ~/.pypirc should have your pypi login credentials.
python setup.py bdist_wheel
twine upload dist/* --skip-existing

Build documentation

  • sphinx html docs can be generated with cd docs; make html

Testing

Run pytest in the root directory.

Auxiliary tools