Amidha Ayurveda

ChandasMeter

🕉️ ChandasMeter v3 – Formal Sanskrit Meter Engine

🕉️ ChandasMeter

A Formal Grammar-Based Sanskrit Meter Engine (Varṇa-vṛtta & Mātrā-vṛtta)

Try an Example

Click a button to load a well-known shloka and test the analyzer.

Step 1: Input Shloka Text

How It Works

This tool analyzes Sanskrit text based on a formal phonological pipeline and declarative meter grammars.

  1. Normalization & Segmentation: The text is normalized (Unicode NFC) and segmented into phonetic syllables (akṣaras), correctly handling conjuncts, viramas, and vocalics (ऋ, ऌ).
  2. Weighting (Laghu/Guru): Each syllable is deterministically classified as Laghu (L, 1 mātrā) or Guru (G, 2 mātrās) based on formal rule precedence:
    • A syllable is Guru (G) if its vowel is long (आ, ई, ऊ, ॠ, ॡ, ए, ऐ, ओ, औ) OR it ends in an Anusvara (ं), Visarga (ः), or final Virama (e.g., in राजन्) OR it is short but followed by a conjunct consonant (saṁyoge-guru).
    • Otherwise, it is Laghu (L).
    • The Pādānta Guru option treats the last syllable of any line as Guru by convention.
  3. Grammar Matching: The resulting pattern is matched against two separate, formal grammar databases:
    • Varṇa-vṛtta (Syllable Meters): The L/G pattern is matched against a database of meter-specific Regular Expressions (e.g., Vasantatilakā: ^G-G-L-G-L-L-L-G-L-L-G-L-G(-G)?$). Special logic handles Anuṣṭubh vipulās and Upajāti mixtures.
    • Mātrā-vṛtta (Morae Meters): The total *mātrā* count of each *pāda* is calculated (L=1, G=2) and checked against patterns (e.g., Āryā: `[12, 18, 12, 15]`).
  4. Gana Identification: For display, the L/G pattern is grouped into Ganas (e.g., ya, ma, ta, ra, ja, bha, na, sa).
Amidha Ayurveda