Sanskrit prosody basics using python
This article introduces some basic concepts in Sanskrit prosody. There’s a Colab notebook on my GitHub that presents the same material but with python implementation for prosodic analysis. Basic familiarity with python coding as well as Sanskrit phonetics and pronunciation will be beneficial to make the most of the notebook. Just open the notebook (link here), read through the text, run all code cells, and observe the output. Here, in this article, I’m presenting the theory and concepts (without code) from that notebook as a read-through with examples.
Table of contents
Indic Scripts Are Syllabic in Nature
Almost all Indic languages have syllabic writing systems, and so does Sanskrit. Technically, these writing systems are alphasyllabaries. Each character in Sanskrit, when written in Devanagari or any other regional script, usually represents one syllable. These can be either stand-alone vowels (like अ, इ, ऐ /ಅ, ಇ, ಐ/a, i, ai, etc.) or more frequently, a consonant combined with a vowel (like छ, दि, कै/ಛ, ದಿ, ಕೈ/cha, di, kai, etc.).
The most important point to note here is that any stand-alone consonant character has the inherent vowel अ/ಅ/a in it. That means, क/ಕ/ka is not just k, but rather, ka. And this vowel is to be pronounced always. For example, in the word राम/ರಾಮ/rāma, the a at the end has to be pronounced. This brings us to the other important point about the writing systems: we use a stop symbol (virāma) to indicate the absence of the inherent vowel. Thus, क्/ಕ್/k denotes just k, and not ka, and छ्/ಛ/ch denotes just ch, and not cha.
Roman Transliteration
Sanskrit is not limited to any one writing system. It can be written with the same precision in several Indic scripts such as Devanagari, Kannada, Malayalam, and Odia, and in any of the numerous Roman transliterations. The International Alphabet for Sanskrit Transliteration (IAST) is one of the most common Roman transliteration schemes. It is illustrated here in comparison with the Devanagari and Kannada letters.
Categories of letters
Vowels: Vowel sounds are produced without any significant constriction or closure in the vocal tract, allowing for a free flow of air.
Short vowels: All short vowels take a short amount of time to pronounce.
Long vowels: All long vowels take a longer amount of time to pronounce.
A long vowel takes almost double the time to pronounce, compared to a short vowel. This is why, the occurrence of short and long vowels in a text affect its rhythmic flow. Therefore, the distinction between short and long vowels is important to analyse the rhythm.
Consonants: Consonant sounds are produced with partial or complete closure of the vocal tract, restricting airflow, e.g., k, p, jh, n; we will consider anusvāra (ं/ಂ/ṃ) and visarga (ः/ಃ/ḥ) as consonants.
Counting Letters
Notice that consonants in the above point do not contain the inherent vowel 'a'. This makes it easier to analyse prosody and makes IAST our preferred script. This is because IAST is a true alphabet (which means, each ‘letter’ represents only one phoneme, only one unit of sound), whereas Devanagari and other Indic scripts are alphasyllabaries (which is a fancy way of saying that each character contains one vowel and an arbitrary number of consonants; e.g., ऐ/ಐ/ai contains one vowel and no consonants, वा/ವಾ/vā contains a consonant v and a vowel ā, and क्र/ಕ್ರ/kra contains two consonants k and r, and a vowel a).
For our purposes, we define a 'letter' as a phoneme, i.e., a single unit of sound. This means ए/ಏ/e has one letter, वै/ವೈ/vai has two letters, and क्र/ಕ್ರ/kra has three letters.
फ/ಫ/pha contains two ‘letters’ (ph and a) because ph together is taken as a single letter. Note that this works only when p and h (प् and ह् / ಪ್ and ಹ್) actually form the letter ph (फ्/ಫ್), and not when they are merely a combination of the letters p and h (प्ह् / ಪ್ಹ್). The latter combination doesn't appear in Sanskrit, so we can treat ph as a single letter.
Sample text
We will use words or phrases from the following verse (Bhagavadgītā 2.47) as examples:
कर्मण्येवाधिकारस्ते मा फलेषु कदाचन।
मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि॥
ಕರ್ಮಣ್ಯೇವಾಧಿಕಾರಸ್ತೇ ಮಾ ಫಲೇಷು ಕದಾಚನ।
ಮಾ ಕರ್ಮಫಲಹೇತುರ್ಭೂರ್ಮಾ ತೇ ಸಙ್ಗೋಽಸ್ತ್ವಕರ್ಮಣಿ॥
karmaṇyevādhikāraste mā phaleṣu kadācana।
mā karmaphalaheturbhūrmā te saṅgo'stvakarmaṇi॥
Counting letters: example
Let us count the letters in the word 'phaleṣu'.
फलेषु - फ् अ ल् ए ष् उ
ಫಲೇಷು - ಫ್ ಅ ಲ್ ಏ ಷ್ ಉ
phaleṣu - ph a l e ṣ u
In the word phaleṣu, we have the letters (ph, a, l, e, ṣ, u), totaling to 6 letters.
Of these, (a, e, u) are vowels, (a, u) are short vowels, (e) is a long vowel, and (ph, l, ṣ) are consonants.
Syllables
Intuition
In practice, we rarely find isolated vowels and consonants. As noted earlier, consonants are almost always followed by a vowel sound or another consonant, except at the end of a line. Thus, any word can be broken down into syllables, where each syllable contains exactly one vowel.
Let us look at our example text and see how we can identify syllables in it. Let us look at individual words from the first half of the first line:
karmaṇi eva adhikāraḥ te
For the first word, karmaṇi, the letters are (k, a, r, m, a, ṇ, i). We see that this word has three vowels, so it contains three syllables: kar-ma-ṇi
Formal approach
Finding syllables in a word is not trivial and is not the same as breaking a word into its constituent letters or characters. Basically, there are three rules to identify individual syllables in text:
Every syllable should have one and only one vowel (definition of syllable).
The syllable tends to start with a consonant wherever possible.
The syllable tends to end with a consonant wherever possible.
Whenever there is only one consonant between two vowels, it goes with the second vowel; therefore, rule 2 takes precedence over rule 3.
We can verify that our syllables kar-ma-ṇi follow these three rules:
Every syllable has one vowel.
Correct: kar-ma-ṇi
Incorect: karma-ṇi (the first part contains two vowels)Wherever there is a consonant before the vowel, the syllable takes it and therefore starts in a consonant.
Correct: kar-ma-ṇi
Incorrect: kar-maṇ-i (here, the syllable i would violate the second rule, because it starts with a vowel even when it could start with a consonant)Wherever there are more than one consonants between two vowels, the first vowel takes one of them and therefore ends in a consonant. In our example, the two consonants between vowels are r and m (karmaṇi).
Correct: kar-ma-ṇi
Incorrect: ka-rma-ṇi (the syllable ka ends with a vowel even when it could end with a consonant, violating the third rule)
We can identify the syllables in this word as (kar, ma, ṇi), 3 syllables.
For the other words:
eva: (e, va), 2 syllables
adhikāraḥ: (a, dhi, kā, raḥ), 4 syllables
te: (te), 1 syllable
saṅgaḥ: (saṅ, gaḥ), 2 syllables
astu: (as, tu), 2 syllables
Please note that although the above approach is sufficient for our purposes, the rules for identifying syllables are more complex and beyond the scope of this article.
Light and Heavy Syllables
Each syllable can be identified as either light or heavy, depending on the amount of time it takes to pronounce it. Any syllable that ends in a short vowel is a light syllable, and any syllable that ends in a long vowel or in a consonant is a heavy syllable.
Here are some examples.
Light syllables:
त, कि, ह, पृ, खु, झ, इ, प्र, ध्य
ತ, ಕಿ, ಹ, ಪೃ, ಖು, ಝ, ಇ, ಪ್ರ, ಧ್ಯ
ta, ki, ha, pṛ, khu, jha, i, pra, dhyaHeavy syllables:
ई, बा, औ, सै, यो, डू, षे, किम्, हन्, अस्, फो, स्ने, क्रो, स्वा, शून्, ऊर्ध्, श्वा, माम्
ಈ, ಬಾ, ಔ, ಸೈ, ಯೋ, ಡೂ, ಷೇ, ಕಿಮ್, ಹನ್, ಅಸ್, ಫೋ, ಸ್ನೇ, ಕ್ರೋ, ಸ್ವಾ, ಶೂನ್, ಊರ್ಧ್, ಶ್ವಾ, ಮಾಮ್
ī, bā, au, sai, yo, ḍū, ṣe, kim, han, as, pho, sne, kro, svā, śūn, ūrdh, śvā, mām
Light syllables are called laghu, and heavy syllables are called guru. A guru requires more time to pronounce, almost double that required to pronounce a laghu
Mātrā
A mora (pl. morae) or a mātrā is a time unit that measures how long it takes to pronounce a syllable. If a syllable is laghu, it has 1 mātrā or mora, and a guru syllable has 2 mātrā or morae.
We can count the number of mātrā or morae in a word by adding up the number of morae in each syllable. For example, to find the mātrā count for the word kadācana, we first identify the syllables in it as (ka, dā, ca, na), we then identify whether these syllables are laghu or guru, to get this pattern: (laghu, guru, laghu, laghu). We add 1 for each laghu and 2 for each guru, thus getting a total of 5 mātrā.
Symbolic representation of mātrā
laghu and guru are usually represented symbolically as । and ऽ, respectively. Thus, the mātrā pattern of word karmaṇi can be symbolically represented as ऽ।।, which is equivalent to its mātrā pattern
(guru, laghu, laghu).
Rhythmic Quality
Prosody refers to the patterns of sounds and rhythms in poetry and speech, and the study of such patterns. When we understand what the mātrā pattern in a verse is, we can chant it in a rhythmic way and even sing it to a tune. The pattern of syllables in a verse is called its metre, or chandas (छन्दस्/ಛನ್ದಸ್).
You can think of these patterns of laghu and guru as patterns of 'da' and 'dum'. If you try to make a beat out of 'da' and 'dum', you get interesting patterns, such as 'dum da da' or 'da dum dum da dum'. Think of the song Tere bina from the movie Guru (coincidentally!), which has this line dum dara dum dara mast mast.
(Sony Music Entertainment India Pvt. Ltd © 2022)
Here, we can clearly identify the pattern of laghu and guru: (dum, da, ra, dum, da, ra, mas, t(a), mas, t(a), da, ra), and the metric pattern: ऽ।। ऽ।। ऽ। ऽ। ।।
These prosodic patterns can also be likened to the beeps of Morse code.
Chandas
There are numerous metres used in Sanskrit poetry. They are broadly classified as mātrika and vārṇika.
Mātrika
These are metres that are identified only on the basis of the number of morae or mātrā in each line or part. For example, if a part contains 4 morae, it doesn't matter if the syllable pattern is ऽऽ, ऽ।।, ।ऽ।, ।।ऽ, or ।।।।. They all total to 4 morae, and mātrika metres don't distinguish between these different patterns. What matters is the total time needed to pronounce a line or part.
Vārṇika
These are metres that are identified based on the quality of individual syllables, and the pattern of laghu and guru syllables.
Metric Patterns and Gaṇas
For our sample text,
karmaṇyevādhikāraste mā phaleṣu kadācana।
mā karmaphalaheturbhūrmā te saṅgo'stvakarmaṇi॥
we get the following pattern of laghu and guru:
ऽऽऽऽ ।ऽऽऽ ऽ।ऽ। ।ऽ।।
ऽऽ।। ।ऽऽऽ ऽऽऽऽ ।ऽ।।
To analyse vārṇika metres, the standard method is to describe groups of three syllables, called gaṇa. Using combinatorics, we know that a total of 8 combinations of laghu and guru are possible for a group of three syllables. Thus, we have 8 distinct gaṇas:
Mnemonic for gaṇas
A mnemonic to memorise the names of these gaṇas is: yamātārājabhānasalagāḥ. If you remember this word, you can find the metric pattern of a gaṇa by looking up the letter corresponding to it. For example, to find ma gaṇa, we look at the mnemonic and see the letter mā. We consider the three consecutive letters mātārā (yamātārājabhānasalagāḥ), and the pattern of these three letters gives us the pattern for the ma gaṇa ऽऽऽ. Similarly, the pattern for ja gaṇa can be found by considering the three letters starting with ja: jabhāna (yamātārājabhānasalagāḥ), which gives us the pattern ।ऽ।.
Gaṇa Description
We can now rearrange the symbolic representation of our pattern in groups of three, to make the analysis easier:
ऽऽऽ ऽ।ऽ ऽऽऽ ।ऽ। ।ऽ। ।
ऽऽ। ।।ऽ ऽऽऽ ऽऽऽ ।ऽ। ।
Using the table above, we can now describe this pattern as:
ma ra ma ja ja laghu
ta sa ma ma ja laghu
Śloka
Perhaps the most ubiquitous of all metres in classical Sanskrit is the śloka. It is characterised as having two lines, each with two parts. Each part has 8 syllables, which means a total of 32 syllables in a śloka. The laghu and guru pattern for this metre is described as:
श्लोके षष्ठं गुरुर्ज्ञेयं सर्वत्र लघु पञ्चमम्।
द्विचतुष्पादयोर्ह्रस्वं सप्तमं दीर्घमन्ययोः॥
ಶ್ಲೋಕೇ ಷಷ್ಠಂ ಗುರುರ್ಜ್ಞೇಯಂ ಸರ್ವತ್ರ ಲಘು ಪಞ್ಚಮಮ್।
ದ್ವಿಚತುಷ್ಪಾದಯೋರ್ಹ್ರಸ್ವಂ ಸಪ್ತಮಂ ದೀರ್ಘಮನ್ಯಯೋಃ॥
śloke ṣaṣṭhaṃ gururjñeyaṃ sarvatra laghu pañcamam।
dvicatuṣpādayorhrasvaṃ saptamaṃ dīrghamanyayoḥ॥
This translates to: The sixth syllable in a part is always guru, and the fifth is laghu. In the second and fourth parts, the seventh syllable is laghu, whereas it is guru in the other two (first and third parts).
This essentially means:
guru syllables: 6, 14, 22, and 30 (sixth syllable in each part), and 7 and 23 (seventh syllable in parts 1 and 3)
laghu syllables 5, 13, 21, 29 (fifth syllable in each part) and 15 and 31 (seventh syllable in parts 2 and 4)
Symbolically, we can represent this pattern as:
XXXX।ऽऽX XXXX।ऽ।X
XXXX।ऽऽX XXXX।ऽ।X
where X is an unspecified syllable type, which can be either laghu or guru.
Examples
Example 1
karmaṇyevādhikāraste mā phaleṣu kadācana।
mā karmaphalaheturbhūrmā te saṅgo'stvakarmaṇi॥
Analysis (result generated using code):
No. of letters: 74
No. of vowels: 32
No. of consonants: 42
No. of short vowels: 19
No. of long vowels: 13
Syllables: kar-maṇ-ye-vā-dhi-kā-ras-te-mā-pha-le-ṣu-ka-dā-ca-na-mā-kar-ma-pha-la-he-tur-bhūr-mā-te-saṅ-gost-va-kar-ma-ṇi
No. of syllables: 32
Mātrā pattern (symbolic): ऽऽऽ ऽ।ऽ ऽऽऽ ।ऽ। ।ऽ। ।ऽऽ ।।। ऽऽऽ ऽऽऽ ऽ।ऽ ।।
Mātrā total: 52
Gaṇa pattern: ma ra ma ja ja ya na ma ma ra laghu laghu
The given text is in śloka metre.
Example 2
lakṣmīnṛsiṃha mama dehi karāvalambam
Analysis (result generated using code):
No. of letters: 33
No. of vowels: 14
No. of consonants: 19
No. of short vowels: 11
No. of long vowels: 3
Syllables: lakṣ-mī-nṛ-siṃ-ha-ma-ma-de-hi-ka-rā-va-lam-bam
No. of syllables: 14
Mātrā pattern (symbolic): ऽऽ। ऽ।। ।ऽ। ।ऽ। ऽऽ
Mātrā total: 21
Gaṇa pattern: ta bha ja ja guru guru
The given text is not in śloka metre.