Prakaraṇa API

Conceptually, the rules of the Ashtadhyayi are organized into functional areas called prakaraṇas. Whereas a prakriyā is like the specific execution of some program, a prakaraṇa is like the program itself.

All of Padmini’s rules are in the padmini.prakarana module, which splits the Ashtadhyayi’s rule into smaller modules and functions. Each prakaraṇa module typically has a run function that accepts a Prakriya and performs some operations on it:

def run(p: Prakriya):
    ...

Below, we share the major prakaraṇa modules.

it_samjna

(1.3.2 - 1.3.9)

The most “core” prakaraṇa is the it-saṁjñā-prakaraṇa, which identifies remove different it sounds from an upadeśa. Most derivations use this prakaraṇa at least once.

vikarana

(3.1.33 - 3.1.90)

Rules that add various intermediate suffixes, called vikaraṇas, between the dhātu and the tiṅ ending. Roughly, we can split these rules into four groups:

  • rules for lr̥t, lr̥ṅ, luṭ, and leṭ (3.1.33 - 3.1.34)

  • rules for ām-pratyaya (3.1.35 - 3.1.42)

  • rules for luṅ (3.1.43 - 3.1.67)

  • rules for sārvadhātuka pratyayas (3.1.68 - 3.1.90), which includes laṭ, loṭ, laṅ, and vidhi-liṅ.

(āśīr-liṅ and liṭ do not use any vikaraṇas.)

la_karya

(various rules in 3.2, 3.3, and 3.4)

Rules that introduce a specific lakāra to the prakriyā.

Most lakāras are available under multiple different semantic conditions. For example, laṭ denotes the present tense, but it can denote the past tense if sma is used as an upapada. But since Padmini focuses specifically on generating word forms with their common semantics, implementing all of these conditions would complicate the program with little real gain. Therefore, we implement one common semantic condition per lakāra.

tin_pratyaya

(3.4.77 - end of 3.4)

The rules in this section have two main functions:

  1. Replace a giving lakāra with the appropriate tiṅ-pratyaya. This is called tiṅ-ādeśa (“verb ending substitution”). To perform tiṅ-ādeśa, we must know the puruṣa, vacana, and pada associated with this prakriyā.

  2. Modify the basic tiṅ-pratyaya according to the lakāra and any other conditions relevant to the prakriyā (for example, vidhi-liṅ vs. āśīr-liṅ). This is called tiṅ-siddhi (“verb ending completion”).

All of these rules are found at the end of section 3.4 of the Ashtadhyayi.

it_agama

(7.2.8 - 7.2.78)

Various Sanskrit words have an “i” vowel inserted between the dhātu and the pratyaya. This “i” is called iṭ. Roots use iṭ in one of three patterns:

  • Roots that generally use iṭ are called seṭ (sa-iṭ).

  • Roots that generally avoid iṭ are called aniṭ (an-iṭ).

  • Roots that optionally use iṭ are called veṭ (vā-iṭ).

This prakaraṇa fully specifies the rules that add the iṭ-āgama to the prakriyā.

Order of operations:

  • must run before dvitva for undidizati, etc.

  • must run after vikarana since it checks for sya, si~c, etc.

abhyasasya

(7.4.58 - end of 7.4)

Rules that modify the abhyāsa.

ac_sandhi

(6.1.66 - 6.1.101)

tripadi

(8.2.1 - end of 8.4)

The final three pādas of the Ashtadhyayi are called the tripādi. The tripādi generally contains sandhi rules and other miscellaneous sound change rules.

The tripādi uses a different rule selection mechanism from the rest of the Ashtadhyayi: whereas the rest of the text selects rules based on their priority and allows a rule to apply if it has scope, the tripādi applies rules in order and will never “go back” to apply an earlier rule.