The Rosetta Stone of Indic NLP

The Sanskrit ↔ Computer Science Rosetta Stone

Pāṇini’s 4th-century BCE formal grammar is widely recognized by computer scientists as the earliest ancestor of formal language theory and Backus-Naur Form (BNF). This glossary maps traditional linguistic terms to modern programming, data structures, and computational concepts so students, investors, and engineers speak the same language.

Sanskrit 24-Form Nominal Matrix and Inflectional Mechanics
Showing terms...
Aṣṭādhyāyī अष्टाध्यायी
The Formal Generative Compiler

Pāṇini’s monumental treatise consisting of ~4,000 algorithmic rules (*sūtras*) organized into eight chapters. Rather than simply describing existing sentences, it acts as a deterministic generative compiler: you feed in a conceptual root (*dhātu*) and intent tags (*pratyayas*), and the engine executes transformation rules to compile the exact, grammatically valid output string.

Why it matters: Unlike modern statistical LLMs that "guess" the next word probabilistically, the Aṣṭādhyāyī guarantees zero hallucinations through exact rule-based compilation.

Computer Science Equivalent
Context-Free Grammar (CFG) / Backus-Naur Form (BNF) Compiler Pipeline.
compiler.compile(root=DHATU, intent=TENSE_PERSON) -> ValidString
Dhātu धातु
Base Primitive / Root Class

The indivisible verbal root or semantic primitive. In Sanskrit, nearly every noun, adjective, and verb is derived from approximately 2,000 atomic verbal roots (*dhātus*). A *dhātu* carries the pure seed action (e.g., गम् gam = "to go", भू bhū = "to become").

Why it matters: Instead of storing millions of isolated vocabulary tokens in an embedding matrix, an Indic engine only needs to track core roots and their mathematical derivation formulas.

Programming Analogy
Base Class or Abstract Primitive in Object-Oriented Programming.
class Dhatu_Gam(PrimitiveAction): # "to go"
  def instantiate(self, *modifiers): ...
Pratyaya प्रत्यय
Type Decorator / Modifier Tag

An affix or suffix appended to a root (*dhātu*) or nominal stem (*prātipadika*) to specify tense, aspect, mood, person, case, or part of speech. When a *pratyaya* attaches to a root, it triggers specific phonetic and morphological transformation rules to produce a finalized word (*pada*).

Why it matters: Pratyayas act like typed parameters that modify the state of a base class deterministically.

Programming Analogy
Function Arguments or Type Decorators.
@decorate(tense=Present, number=Singular, person=Third)
def gam(): return "gacchati" # (He goes)
Vibhakti विभक्ति
Argument Role / Explicit Parameter Tag

Inflectional case endings applied to nouns. Sanskrit features a 24-form nominal matrix: 8 grammatical cases (Nominative, Accusative, Instrumental, Dative, Ablative, Genitive, Locative, Vocative) multiplied by 3 grammatical numbers (Singular, Dual, Plural). Every noun carries an explicit ending that announces its exact grammatical role in the sentence.

Why it matters: In English, if you change word order from "Dog bites man" to "Man bites dog", the meaning flips completely. In Sanskrit, because words carry their own *Vibhakti* badges, word order has zero impact on grammatical validity or semantic roles.

Programming Analogy
Explicit Named Keyword Arguments in a function call.
execute_action(
  agent="hunter_1", # 1st Case (Prathamā)
  target="tiger_1", # 2nd Case (Dvitīyā)
  instrument="bow" # 3rd Case (Tṛtīyā)
)
Kāraka कारक
Directed Graph Edge / Semantic Relation

The deep syntactic-semantic relationship between nominal items and the central action (*kriyā*). Pāṇini defined six fundamental kārakas: Kartā (Agent / Source of independent action), Karma (Direct Object / Goal), Karaṇa (Instrument / Means), Sampradāna (Recipient / Beneficiary), Apādāna (Point of Origin / Separation), and Adhikaraṇa (Locus / Space-Time Context).

Why it matters: Kāraka theory directly maps human thought to modern Directed Acyclic Knowledge Graphs (DAGs) without ambiguous parsing.

Computer Science Equivalent
Edge Labels in a Semantic Knowledge Graph.
Graph.add_edge(source=Agent, target=Action, label="Kartā")
Graph.add_edge(source=Action, target=Object, label="Karma")
Kāma-cāra कामचार
Position-Independent Memory / Order Invariance

Absolute syntactic freedom of word order. Because every Sanskrit word is self-encapsulated with its case, gender, number, and syntactic role, tokens in a sentence can be placed in any sequence without altering the logical core meaning.

Why it matters: Positional embedding vectors in Transformer models (e.g. RoPE) are often brittle when word order changes. Understanding Sanskrit's order invariance allows building robust, topology-based reasoning models.

Programming Analogy
Order-Independent Key-Value Dictionaries vs. Strict Sequential Arrays.
# Any order evaluates to the same state:
{"agent": Rama, "action": sees, "object": forest} ==
{"action": sees, "object": forest, "agent": Rama}
Sandhi सन्धि
Stream Boundary Fusion / Phonetic Compaction

Deterministic phonetic blending across word and morpheme boundaries. When two phonetic units occur adjacent to each other, their vocal tract interaction causes them to fuse into a harmonious sound according to strict mathematical rules (e.g., deva + ālaya = devālaya; tat + ca = tacca).

Why it matters: Standard AI models frequently misparse blended Sandhi words as brand new unknown tokens. An Aindrak-powered parser splits and resolves Sandhi with 100% mathematical reversibility.

Programming Analogy
Pipelined Stream Fusion & Byte Boundary Compression.
fuse_stream(tokenA.last_phoneme, tokenB.first_phoneme) -> fused_phoneme
Samāsa समास
Composite Data Structure / Struct Packing

Morphological compounding. Multiple nouns and adjectives are combined into a single, cohesive compound word with intermediate case markers dropped, receiving a single inflectional ending at the very end. Categories include Tatpuruṣa (deterministic dependency), Bahuvrīhi (external reference / pointer), and Dvandva (parallel sets).

Why it matters: Rather than using multi-word clauses that consume tokens, Sanskrit compresses complex hierarchical relationships into a single memory-efficient struct.

Programming Analogy
Nested Struct or Bit-Packed Composite Object.
struct CompoundConcept {
  Entity modifier;
  Entity head;
};
Śiva Sūtras (Māheśvara Sūtras) माहेश्वर सूत्राणि
Phonetic Character Class / Sound Group Set

Fourteen compact phonetic formulas that organize all sounds of the language by acoustic properties (vowels, semivowels, nasals, sibilants, voiced stops, unvoiced stops). By combining the start character of a subset with a terminator marker (*it*), Pāṇini created Pratyāhāras — concise abbreviations for complex sound intervals.

Why it matters: A single two-letter code like अच् (ac) matches all vowels, and हल् (hal) matches all consonants — functioning as a concise regex range or character class filter.

Computer Science Equivalent
Regex Character Class / Acoustic Set.
const auto PRATYAHARA_AC = "[aeiouāīūṛṝḷ]"; // All vowels
const auto PRATYAHARA_HAL = "[k-h]"; // All consonants
Utsarga & Apavāda उत्सर्ग व अपवाद
Default Fallback & Specific Override / Inheritance Hierarchy

The foundational rule-priority conflict resolution mechanism in Pāṇinian grammar. An Utsarga is a general, default rule that applies broadly. An Apavāda is an exception rule designed for a specialized, narrower context. In the Pāṇinian engine, a specific exception rule unconditionally overrides the generic rule (*Apavādo hy utsargaṁ bādhate*).

Why it matters: Eliminates runtime conflicts deterministically, ensuring unambiguous rule execution across the entire morphological system.

Programming Analogy
Method Overriding in Subclasses / CSS Specificity Cascades.
if (has_specialized_override(context)):
  execute_apavada_rule()
else:
  execute_default_utsarga_rule()