Metrical analysis tools for indic languages in general, and sanskrit in particular
Project description
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
---------
- `Autogenerated Docs on readthedocs (might be
broken) <http://chandas.readthedocs.io/en/latest/>`__.
- Manually and periodically generated docs
`here <https://sanskrit-coders.github.io/chandas/build/html/>`__
- For detailed examples and help, please see individual module files in
this package.
Installation or upgrade:
~~~~~~~~~~~~~~~~~~~~~~~~
- ``sudo pip install chandas -U``
- ``sudo pip install git+https://github.com/sanskrit-coders/chandas/@master -U``
- `Web <https://pypi.python.org/pypi/chandas>`__.
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:
- `syllabizationTests.json <https://github.com/sanskrit-coders/chandas/blob/master/src/test/data/syllabizationTests.json>`__
For external collaborators
--------------------------
- We copy the data and identification code from `shreevatsa's
repo <https://github.com/shreevatsa/sanskrit/>`__. This code has been
transformed a bit to conform to PEP conventions.
- You may be interested in sharing and contributing to a common pool of
test cases - see the chandas-id and syllabization tests under
https://github.com/sanskrit-coders/chandas/tree/master/tests/data .
For contributors
----------------
Contact
~~~~~~~
Have a problem or question? Please head to
`github <https://github.com/sanskrit-coders/chandas>`__.
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
~~~~~~~~~~~~~~~
- |Build Status|
- |Documentation Status|
- `pyup <https://pyup.io/account/repos/github/sanskrit-coders/chandas/>`__
.. |Build Status| image:: https://travis-ci.org/sanskrit-coders/chandas.svg?branch=master
:target: https://travis-ci.org/sanskrit-coders/chandas
.. |Documentation Status| image:: https://readthedocs.org/projects/chandas/badge/?version=latest
:target: http://chandas.readthedocs.io/en/latest/?badge=latest
.. |Documentation Status| image:: https://readthedocs.org/projects/indic-transliteration/badge/?version=latest
:target: http://indic-transliteration.readthedocs.io/en/latest/?badge=latest
-------
|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
---------
- `Autogenerated Docs on readthedocs (might be
broken) <http://chandas.readthedocs.io/en/latest/>`__.
- Manually and periodically generated docs
`here <https://sanskrit-coders.github.io/chandas/build/html/>`__
- For detailed examples and help, please see individual module files in
this package.
Installation or upgrade:
~~~~~~~~~~~~~~~~~~~~~~~~
- ``sudo pip install chandas -U``
- ``sudo pip install git+https://github.com/sanskrit-coders/chandas/@master -U``
- `Web <https://pypi.python.org/pypi/chandas>`__.
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:
- `syllabizationTests.json <https://github.com/sanskrit-coders/chandas/blob/master/src/test/data/syllabizationTests.json>`__
For external collaborators
--------------------------
- We copy the data and identification code from `shreevatsa's
repo <https://github.com/shreevatsa/sanskrit/>`__. This code has been
transformed a bit to conform to PEP conventions.
- You may be interested in sharing and contributing to a common pool of
test cases - see the chandas-id and syllabization tests under
https://github.com/sanskrit-coders/chandas/tree/master/tests/data .
For contributors
----------------
Contact
~~~~~~~
Have a problem or question? Please head to
`github <https://github.com/sanskrit-coders/chandas>`__.
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
~~~~~~~~~~~~~~~
- |Build Status|
- |Documentation Status|
- `pyup <https://pyup.io/account/repos/github/sanskrit-coders/chandas/>`__
.. |Build Status| image:: https://travis-ci.org/sanskrit-coders/chandas.svg?branch=master
:target: https://travis-ci.org/sanskrit-coders/chandas
.. |Documentation Status| image:: https://readthedocs.org/projects/chandas/badge/?version=latest
:target: http://chandas.readthedocs.io/en/latest/?badge=latest
.. |Documentation Status| image:: https://readthedocs.org/projects/indic-transliteration/badge/?version=latest
:target: http://indic-transliteration.readthedocs.io/en/latest/?badge=latest
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
chandas-0.0.4-py3-none-any.whl
(14.7 kB
view details)
File details
Details for the file chandas-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: chandas-0.0.4-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90092ad2dce428a808bb33b71100e78991a2aa118d0ddc20af9758222651e80b |
|
MD5 | 951505563ee3c805dfcc218a23e1ec4a |
|
BLAKE2b-256 | bd7299a2ab04d6cd38222a577e75ffefce32037eab3827c81582685ec7cd9b13 |