Chandojñānam

What is a chanda?

Sanskrit prosody or chandaśāstra is the study of poetic metres and verse in Sanskrit. Chandas (Sanskrit metres) include those based on a fixed number of akṣara (syllables) per verse, and those based on fixed number of mātra (morae) per verse.

Where is the chandaśāstra used?

Each chanda has its own rhythm, movements and aesthetics, making the Sanskrit poetic works easier to memorise and recite. Most of the ancient Sanskrit literature adheres to chandaśāstra.
The system can also be used for error identification and correction of text present in the existing digital corpora, text generated by OCR systems, text generated by text-to-speech systems, etc.

How to use the chanda identification system?

The identification system can identify chanda from saṃskṛta text in Devanagari. Chanda can be identified in two modes.

  1. Treat all the lines independently. (Line Mode)
  2. Treat the lines as a set of verses. (Verse Mode)
The system in addition to identifying the chanda from the provided verses, is also capable of suggestiong most-likely matches (fuzzy matches), in case a direct match could not be found.

How is a chanda identified?

Every akṣara (syllable) is identified to be either laghu (short) or guru (long) as per the following rules of chandaśāstra.

  1. laghu vowels: अ, इ, उ, ऋ, ऌ
  2. guru vowels: आ, ई, ऊ, ॠ, ॡ, ए, ऐ, ओ, औ
  3. akṣara is marked laghu or guru based on the vowel it contains.
  4. akṣara containing anusvāra or visarga is always marked as guru.
  5. akṣara that is followed by a saṃyuktākṣara (conjunct letter) is always marked guru.
  6. akṣara that appears at the end of the pada (line) is always marked as guru.
Thus, every line of Sanskrit text can be transformed into a binary sequence of laghu and guru markers. Specific patterns of such sequences are identified as various chandas.
In the case of akṣaragaṇavṛtta, (i.e. meters requiring specific sequence of letters), the akṣaras are divided into groups of 3. There are 8 (23) possible sequences of laghu-guru markers, each of which has been given a special name, called gaṇa.
The following table describes the gaṇas,
gaṇa lakṣaṇa gaṇa lakṣaṇa
लगग गलल
गलग लगल
गगल ललग
ललल गगग

A sequence of gaṇa thus formed, is called lakṣaṇa of a chanda, and can be used to identify the chanda.

How many chandas can this system identify?

The chanda identification system made available hereby has a list of over 200 chandas collated from various sources, most notable among which are Śabdakalpadruma and Vṛttaratnākara.
The current list of chandas can be found here.


Sources: If you wish to contribute, please feel free to do so by reaching us through the feedback icon located at the top of the page.

What are the fuzzy matches?

There may be cases where a chanda match is not found for a particular line. This can happen due to two reasons.

  1. The chanda definition is missing from the database.
  2. There is an error in the line.
We are working towards expanding our chanda database to cover more and more chandas. Fuzzy matches may help in the event of the input line containing an error.
Fuzzy matches are the most probable matches for the given line. The suggestions shown contain the syllables from the original string, alongwith the suggested places where change might be required. The suggestions are identified by three letters i, d and r, indicating insert, delete and replace operations.
They are used in the following manner,
  1. i(laghu-guru-marker): This type of the notation indicates the insertion of a new syllable. i(ल) indicates that a laghu syllable needs to be inserted, similarly i(ग) indicates that a guru syllable needs to be inserted.
  2. r(syllable)[laghu-guru-marker]{suggestion}: This type of notation indicates that the syllable needs to be replaced by a laghu or guru syllable (depending upon the marker). In some cases, a suggested change would be included.
  3. d(syllable): This type of notation indicates that the syllable needs to be deleted.
The recommended changes for each chanda suggestion corresponds to the changes needed to transform the line into one that conforms to that specific chanda.

How are the fuzzy matches found?

The laghu-guru string for the given line is compared with the known chanda signatures, and ranked according to their edit-distance. Backtracing is used to predict which operations are required to reach the target string.

How do I provide input?

There are three primary modes of providing input.

  1. Text: Type or copy-paste input in plain text format using Text tab.
  2. Image: Upload images containing text using Image tab.
  3. File: Upload text files using File tab.

Can I provide input in a different transliteration scheme?

Yes!

Transliteration support is powered by the fantastic indic-transliteration library.
Therefore, any scheme supported by this library can be used to provide input. Further, this also applies for all input types. i.e., Images or files uploaded can also contain text in any supported transliteration scheme. This includes all promient schemes of Devanagari transliteration. It also includes all prominent Indian language scripts, such as, Bangla, Telugu, Tamil, Malayalam, Gujarati and many more.
As a result, if the language of choice shares follows Sanskrit Chandaśāstra one can even provide input in the script of that language (e.g., Telugu) and the system will work seemlessly.

The output, by default, will be displayed using the scheme that input follows. However, this can be controlled and the output can be displayed using multiple transliteration schemes.

How to cite this work?

This work has been published in Proceedings of Computational Sanskrit and Digital Humanities selected papers presented at The 18th World Sanskrit Conference, Australia, 2023. The following BibTeX can be used to cite it.

BibTeX Citation:

@inproceedings{terdalkar2023chandojnanam,
    title = "Chandojnanam: A {S}anskrit Meter Identification and Utilization System",
    author = "Terdalkar, Hrishikesh  and Bhattacharya, Arnab",
    booktitle = "Proceedings of the Computational {S}anskrit {\&} Digital Humanities: Selected papers presented at the 18th World {S}anskrit Conference",
    month = jan,
    year = "2023",
    address = "Canberra, Australia (Online mode)",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.wsc-csdh.8",
    pages = "113--127",
}

Is Chandojñānam open source?

Yes! The code is available at hrishikeshrt/chanda.
If you enjoy using Chandojñānam, please star the project on GitHub. Star
If you face any issues, please feel free to create an issue.