Vyakarana (Sanskrit Grammar)
Analyze and explain Sanskrit grammatical constructions following the Paninian tradition.
Provenance & Accuracy
- Narrate: Explain if you are using a local script (
sandhi.py), a web lookup (Ashtadhyayi.com), or your own inference.
- Verify: Check derived rules against
references/sandhi.md or web sources. If a Sutra is not verified, describe the rule phonetically (e.g., "Guṇa: a + i = e") without inventing a Sutra number.
- Label: Clearly mark inferred derivations or simplified analogies (e.g., "This is a simplified explanation...").
Analysis Workflow
When analyzing a word or explaining grammar:
1. Identify the Word Type
- Subanta (nominal): Ends in a case suffix (सुप्)
- Tiganta (verbal): Ends in a verbal suffix (तिङ्)
- Avyaya (indeclinable): No inflection
2. For Subanta (Nominals)
प्रकृति (stem) + प्रत्यय (suffix) = पद (word)
Identify:
- Pratipadika (nominal stem)
- Linga (gender): पुंल्लिङ्ग, स्त्रीलिङ्ग, नपुंसकलिङ्ग
- Vacana (number): एकवचन, द्विवचन, बहुवचन
- Vibhakti (case): प्रथमा through सप्तमी + सम्बोधन
3. For Tiganta (Verbals)
धातु (root) + विकरण (class marker) + तिङ् प्रत्यय (personal ending)
Identify:
- Dhatu (root) with gana (class 1-10)
- Lakara (tense/mood): लट्, लिट्, लुट्, etc.
- Pada (voice): परस्मैपद, आत्मनेपद, उभयपद
- Purusha (person): प्रथम, मध्यम, उत्तम
- Vacana (number)
4. For Samasa (Compounds)
Break down showing:
- Component words (पूर्वपद, उत्तरपद)
- Compound type (see references/samasa.md)
- Vigrahavakya (dissolution)
5. Apply Sandhi Rules
When forms combine, identify:
- Type of sandhi (स्वर, व्यञ्जन, विसर्ग)
- Rule applied
- Original forms
Quick Reference Tables
Vibhakti (Case) Meanings
| Case |
Name |
Karaka |
Meaning |
Markers |
| 1 |
प्रथमा |
कर्ता |
subject, nominative |
-स्, -औ, -अस् |
| 2 |
द्वितीया |
कर्म |
object, accusative |
-अम्, -औ, -अस् |
| 3 |
तृतीया |
करण |
by/with, instrumental |
-आ, -भ्याम्, -भिस् |
| 4 |
चतुर्थी |
सम्प्रदान |
to/for, dative |
-ए, -भ्याम्, -भ्यस् |
| 5 |
पञ्चमी |
अपादान |
from, ablative |
-अस्, -भ्याम्, -भ्यस् |
| 6 |
षष्ठी |
सम्बन्ध |
of, genitive |
-अस्, -ओस्, -आम् |
| 7 |
सप्तमी |
अधिकरण |
in/on/at, locative |
-इ, -ओस्, -सु |
Lakara (Tense/Mood) Overview
| Lakara |
Name |
Usage |
| लट् |
वर्तमान |
Present tense |
| लङ् |
अनद्यतन भूत |
Past (not today) |
| लुङ् |
सामान्य भूत |
Aorist (general past) |
| लिट् |
परोक्ष भूत |
Perfect (unwitnessed past) |
| लुट् |
अनद्यतन भविष्यत् |
Periphrastic future |
| लृट् |
सामान्य भविष्यत् |
Simple future |
| लोट् |
आज्ञा |
Imperative |
| विधिलिङ् |
विधि |
Optative (should) |
| आशीर्लिङ् |
आशीः |
Benedictive (blessing) |
| लृङ् |
सङ्केत |
Conditional |
Scripts
Utility scripts in shared/scripts/. Libraries: indic-transliteration, sanskrit_parser, vidyut.
cd shared/scripts
uv sync
Usage
# Transliteration
uv run python transliterate.py "संस्कृतम्" devanagari iast # → saṃskṛtam
uv run python transliterate.py "rāma" iast devanagari # → राम
# Sandhi
uv run python sandhi.py --split "devālayaḥ"
uv run python sandhi.py --join "deva" "ālaya" # → devālaya
# Prakriya (Derivation)
uv run python prakriya.py subanta rAma Pum Prathama Eka
uv run python prakriya.py tinanta gam 1 Kartari Prathama Eka Lat
# Dhatu lookup
uv run python dhatu.py bhū
uv run python dhatu.py --gana 1
uv run python dhatu.py --search "to go"
References
For detailed rules, see:
- references/sandhi.md - Euphonic combination rules
- references/samasa.md - Compound types with examples
- references/vibhakti.md - Declension paradigms
- references/dhatu.md - Common verbal roots by gana
- references/pratyaya.md - Krit and Taddhita suffixes
- references/lakara.md - Conjugation paradigms
Example Analysis
Word: गच्छति
Analysis:
धातु: √गम् (गतौ) - 1st gana (भ्वादि)
विकरण: शप् (→ अ)
लकार: लट् (वर्तमान)
पद: परस्मैपद
पुरुष: प्रथम
वचन: एकवचन
Formation: गम् + शप् + ति
गम् + अ + ति
गच्छ् + अ + ति (गम् takes the present stem गच्छ्)
= गच्छति
Word: राज्ञः
Analysis:
प्रातिपदिक: राजन् (m. king)
लिङ्ग: पुंल्लिङ्ग
वचन: एकवचन
विभक्ति: षष्ठी (genitive) OR पञ्चमी (ablative)
Formation: राजन् + अस् (षष्ठी/पञ्चमी एकवचन)
राज् + ञ् + अस् (न् → ञ् before अस्)
= राज्ञस् → राज्ञः (विसर्ग)
Compound: नीलोत्पलम्
Analysis:
समास: कर्मधारय (विशेषणपूर्वपद)
विग्रह: नीलम् उत्पलम् (a blue lotus)
पूर्वपद: नील (adj. blue)
उत्तरपद: उत्पल (n. lotus)
सन्धि: नील + उत्पल → नीलोत्पल (गुण सन्धि: अ + उ = ओ)
Related Skills
| Need |
Use |
| Full verse analysis |
sloka |
| Word meanings, synonyms |
kosha |
| Literary context |
sahitya |
| Shared scripts/references |
shared |
1---2name: vyakarana3description: Sanskrit grammar analysis including sandhi (euphonic combinations), samasa (compounds), vibhakti (case declensions), dhatu (verbal roots), pratyaya (suffixes), and lakara (tenses/moods). Use when explaining Sanskrit grammar rules, breaking down word formations, analyzing declensions or conjugations, identifying compound types, or teaching Paninian grammar concepts.4---56# Vyakarana (Sanskrit Grammar)78Analyze and explain Sanskrit grammatical constructions following the Paninian tradition.910## Provenance & Accuracy1112* **Narrate:** Explain if you are using a local script (`sandhi.py`), a web lookup (Ashtadhyayi.com), or your own inference.13* **Verify:** Check derived rules against `references/sandhi.md` or web sources. If a Sutra is not verified, describe the rule phonetically (e.g., "Guṇa: a + i = e") without inventing a Sutra number.14* **Label:** Clearly mark inferred derivations or simplified analogies (e.g., "This is a simplified explanation...").1516## Analysis Workflow1718When analyzing a word or explaining grammar:1920### 1. Identify the Word Type21- **Subanta** (nominal): Ends in a case suffix (सुप्)22- **Tiganta** (verbal): Ends in a verbal suffix (तिङ्)23- **Avyaya** (indeclinable): No inflection2425### 2. For Subanta (Nominals)2627```28प्रकृति (stem) + प्रत्यय (suffix) = पद (word)29```3031Identify:32- **Pratipadika** (nominal stem)33- **Linga** (gender): पुंल्लिङ्ग, स्त्रीलिङ्ग, नपुंसकलिङ्ग34- **Vacana** (number): एकवचन, द्विवचन, बहुवचन35- **Vibhakti** (case): प्रथमा through सप्तमी + सम्बोधन3637### 3. For Tiganta (Verbals)3839```40धातु (root) + विकरण (class marker) + तिङ् प्रत्यय (personal ending)41```4243Identify:44- **Dhatu** (root) with gana (class 1-10)45- **Lakara** (tense/mood): लट्, लिट्, लुट्, etc.46- **Pada** (voice): परस्मैपद, आत्मनेपद, उभयपद47- **Purusha** (person): प्रथम, मध्यम, उत्तम48- **Vacana** (number)4950### 4. For Samasa (Compounds)5152Break down showing:53- Component words (पूर्वपद, उत्तरपद)54- Compound type (see references/samasa.md)55- Vigrahavakya (dissolution)5657### 5. Apply Sandhi Rules5859When forms combine, identify:60- Type of sandhi (स्वर, व्यञ्जन, विसर्ग)61- Rule applied62- Original forms6364## Quick Reference Tables6566### Vibhakti (Case) Meanings6768| Case | Name | Karaka | Meaning | Markers |69|------|------|--------|---------|---------|70| 1 | प्रथमा | कर्ता | subject, nominative | -स्, -औ, -अस् |71| 2 | द्वितीया | कर्म | object, accusative | -अम्, -औ, -अस् |72| 3 | तृतीया | करण | by/with, instrumental | -आ, -भ्याम्, -भिस् |73| 4 | चतुर्थी | सम्प्रदान | to/for, dative | -ए, -भ्याम्, -भ्यस् |74| 5 | पञ्चमी | अपादान | from, ablative | -अस्, -भ्याम्, -भ्यस् |75| 6 | षष्ठी | सम्बन्ध | of, genitive | -अस्, -ओस्, -आम् |76| 7 | सप्तमी | अधिकरण | in/on/at, locative | -इ, -ओस्, -सु |7778### Lakara (Tense/Mood) Overview7980| Lakara | Name | Usage |81|--------|------|-------|82| लट् | वर्तमान | Present tense |83| लङ् | अनद्यतन भूत | Past (not today) |84| लुङ् | सामान्य भूत | Aorist (general past) |85| लिट् | परोक्ष भूत | Perfect (unwitnessed past) |86| लुट् | अनद्यतन भविष्यत् | Periphrastic future |87| लृट् | सामान्य भविष्यत् | Simple future |88| लोट् | आज्ञा | Imperative |89| विधिलिङ् | विधि | Optative (should) |90| आशीर्लिङ् | आशीः | Benedictive (blessing) |91| लृङ् | सङ्केत | Conditional |9293## Scripts9495Utility scripts in `shared/scripts/`. Libraries: [indic-transliteration](https://github.com/indic-transliteration/indic_transliteration_py), [sanskrit_parser](https://github.com/kmadathil/sanskrit_parser), [vidyut](https://github.com/ambuda-org/vidyut).9697```bash98cd shared/scripts99uv sync100```101102### Usage103```bash104# Transliteration105uv run python transliterate.py "संस्कृतम्" devanagari iast # → saṃskṛtam106uv run python transliterate.py "rāma" iast devanagari # → राम107108# Sandhi109uv run python sandhi.py --split "devālayaḥ"110uv run python sandhi.py --join "deva" "ālaya" # → devālaya111112# Prakriya (Derivation)113uv run python prakriya.py subanta rAma Pum Prathama Eka114uv run python prakriya.py tinanta gam 1 Kartari Prathama Eka Lat115116# Dhatu lookup117uv run python dhatu.py bhū118uv run python dhatu.py --gana 1119uv run python dhatu.py --search "to go"120```121122## References123124For detailed rules, see:125- [references/sandhi.md](references/sandhi.md) - Euphonic combination rules126- [references/samasa.md](references/samasa.md) - Compound types with examples127- [references/vibhakti.md](references/vibhakti.md) - Declension paradigms128- [references/dhatu.md](references/dhatu.md) - Common verbal roots by gana129- [references/pratyaya.md](references/pratyaya.md) - Krit and Taddhita suffixes130- [references/lakara.md](references/lakara.md) - Conjugation paradigms131132## Example Analysis133134**Word**: गच्छति135136**Analysis**:137```138धातु: √गम् (गतौ) - 1st gana (भ्वादि)139विकरण: शप् (→ अ)140लकार: लट् (वर्तमान)141पद: परस्मैपद142पुरुष: प्रथम143वचन: एकवचन144145Formation: गम् + शप् + ति146 गम् + अ + ति147 गच्छ् + अ + ति (गम् takes the present stem गच्छ्)148 = गच्छति149```150151**Word**: राज्ञः152153**Analysis**:154```155प्रातिपदिक: राजन् (m. king)156लिङ्ग: पुंल्लिङ्ग157वचन: एकवचन158विभक्ति: षष्ठी (genitive) OR पञ्चमी (ablative)159160Formation: राजन् + अस् (षष्ठी/पञ्चमी एकवचन)161 राज् + ञ् + अस् (न् → ञ् before अस्)162 = राज्ञस् → राज्ञः (विसर्ग)163```164165**Compound**: नीलोत्पलम्166167**Analysis**:168```169समास: कर्मधारय (विशेषणपूर्वपद)170विग्रह: नीलम् उत्पलम् (a blue lotus)171पूर्वपद: नील (adj. blue)172उत्तरपद: उत्पल (n. lotus)173सन्धि: नील + उत्पल → नीलोत्पल (गुण सन्धि: अ + उ = ओ)174```175176## Related Skills177178| Need | Use |179|------|-----|180| Full verse analysis | **sloka** |181| Word meanings, synonyms | **kosha** |182| Literary context | **sahitya** |183| Shared scripts/references | **shared** |