Quickstart¶
This quickstart doc will show you how to generate words with Padmini. We first show how Padmini produces basic derivations. We then show how Padmini generates optional derivations if multiple prakriyās could be produced from the same initial conditions.
Note
As a reminder, Padmini uses SLP1 transliteration internally. For details, see the SLP1 Transliteration doc.
tiṅanta¶
A tiṅanta is a verb. All tiṅantas are generated by the tinanta()
function, which you can see below:
from padmini.ashtadhyayi import tinanta
from padmini.constants import Tag as T
prakriya = tinanta('BU', '01.0001', 'la~w', tags=[T.PRATHAMA, T.EKAVACANA])
print(prakriya.text)
for result, rule in prakriya.history:
print(f" {result} ({rule})")
In order, the arguments to tinanta()
are:
the dhātu in its upadeśa form, including accent marks
the dhātu’s gaṇa and order within the Dhātupāṭha
the specific lakāra to use with this dhātu
the derivation context, here referring to prathama-puruṣa and ekavacana
tinanta()
returns a Prakriya
object, which
contains our final words. For example, the script above will produce the
following output:
Bavati
BU (start)
BU (1.3.1)
BU la~w (3.3.123)
BU la~w (1.3.2)
BU la~w (1.3.4)
BU l (1.3.9)
BU l (1.3.78)
BU tip (3.4.78)
BU tip (1.3.4)
BU ti (1.3.9)
BU ti (3.4.113)
BU Sap ti (3.1.68)
BU Sap ti (1.3.4)
BU Sap ti (1.3.8)
BU a ti (1.3.9)
BU a ti (3.4.113)
Bo a ti (7.3.84)
Bav a ti (6.1.78)
Each step modifies the Prakriya
in some way. For example, rule 1.3.1
(bhūvādayo dhātavaḥ) adds the tag Tag.DHATU to the first Term
.
subanta¶
A subanta is usually a nominal, but this category also includes uninflected
words. All subantas are generated by the subanta()
function, which you
can see below:
from padmini.ashtadhyayi import subanta
from padmini.constants import Tag
prakriya = subanta('nara', Tag.PUM, [Tag.V6, Tag.EKAVACANA])
print(prakriya.text)
for result, rule in prakriya.history:
print(f" {result} ({rule})")
In order, the arguments to tinanta()
are:
the prātipadika to use
the liṅga (gender) to use
the derivation context, here referring to ṣaṣṭhī-vibhakti and ekavacana
subanta()
returns a Prakriya
object, which
contains our final word. For example, the script above will produce the
following output:
narasya
nara (start)
nara (1.2.45)
nara Nas (4.1.2)
nara Nas (1.3.8)
nara as (1.3.9)
nara sya (7.1.12)
Optional Prakriyās¶
For now, optional prakriyās are supported only in test code. See test/utils.py for an example, particularly the run_all_permutations function.