Automation of ‘it’ karaṇam from Aṣṭādhyāyī Sūtras

Sarada Susarla,
Karnataka Sanskrit University,
Prof. Shivani V.,
Karnataka Sanskrit University,
Dr. Sai Susarla, MIT-ADT University
School of Vedic Sciences, , Pune



We believe that Aṣṭādhyāyī itself is a complete and unified solution for word generation (kṛt, taddhita), compounding (samāsa) and conjugation (sandhi) in Saṃskrit. The ability to interpret Aṣṭādhyāyī sūtra corpus mechanically has numerous benefits for pedagogy, Saṃskrit word synthesis as well as analysis. Aṣṭādhyāyī employs a custom vocabulary generation scheme in its sūtras called ’it’ karaṇam for compactness of expression. So the first step to decode Aṣṭādhyāyī sūtras is to identify and decode custom words therein.

In this paper, we present an automated method to decode Aṣṭādhyāyī ’it’ words. We start with a curated representation of Aṣṭādhyāyī in CSV format and convert it into machine interpretable JSON format. We have developed a novel vibhakti-based mechanism to transform sūtras into machine-interpretable expressions using Aṣṭādhyāyī’s inherent embedded conventions. We use this to extract all term definitions (saṃjñās) and pratyayas automatically. We then interpret the 7 ’it’ Saṃjñā rules of Aṣṭādhyāyī to decode the rest of the sūtras employing ’it’-encoded words. We demonstrate this process via a python library we have developed for this purpose.

  1. Introduction

Pāṇini’s Aṣṭādhyāyī is widely accepted as the oldest linguistic treatise with accurate grammar and word generation scheme for Samskrit in particular. This is also proven to be very useful for any natural language processing. Pāṇini himself is referred to as ‘Father of linguistics’.

“Not only Pāṇini was by far the first linguist in recorded history, but I claim he was the first informatician, 24 centuries before computers came into existence.” Huet (2007)

We have started with a well-annotated online Aṣṭādhyāyī resource in CSV format. We have generated a Python-based compiler to automatically convert Aṣṭādhyāyī sūtras into a custom machine-interpretable language (JSON), and an interpreter to reproduce Aṣṭādhyāyī’s prakriyā for term definitions (samjñās), meta-rules (paribhāśā sūtras) and vidhi sūtras. We avoid man- ually supplying any data that can be directly derived from Aṣṭādhyāyī. We are now able to automatically enumerate the character sequences denoted by samjñās defined in Aṣṭādhyāyī, and determine which paribhāṣā sūtras apply to which vidhi sūtras. We are in the process of developing a generic rūpa-siddhi engine starting from a prakṛti-pratyaya sequence. In this pro- cess we are able to identify all the ‘it’ varṇās and then remove them using the appropriate vidhi sūtras. This is verified for all the dhātus by tagging them as well as used in generating the pratyāhārās. In this paper we describe our approach and the specific results with respect to ‘it’ karaṇam.1

  1. Related Work

Aṣṭādhyāyī and its interpretation for Saṃskṛt grammatical analysis and word synthesis has been studied extensively Goyal et al. (2008; Scharf and Hyman (2009; Goyal et al. (2012; Satuluri and

1In this paper, we use the IAST convention for Sanskrit words

Kulkarni (2013; Patel and Katuri (2016; Krishna and Goyal (2016; Subbanna and Varakhedi (2010). Here, we assume the reader is familiar with Pāṇini’s Aṣṭādhyāyī and its various concepts relevant to computational modeling. For a good overview of those concepts, the reader is referred to earlier publications Goyal et al. (2008; Petersen and Hellwig (2016). Several earlier efforts attempted to highlight and emulate various techniques used in Aṣṭādhyāyī for specific grammatical purposes. They typically select a particular subset of Aṣṭādhyāyī’s engine and code its semantics manually to reproduce a specific prakriyā. Mishra (2008) manually enumerated the terms and their definitions including pratyāhāras.

The Aṣṭādhyāyī 2.0 project by Petersen and Hellwig (2016) has developed a richly anno- tated electronic representation of Aṣṭādhyāyī that makes it amenable to research and machine- processing. We have achieved a similar objective via manual splitting of sandhis and word- separation within compounds(samāsās), and by developing a custom vibhakti analyzer for de- tecting word recurrence across vibhakti and vacana variations. Petersen and Soubuste Petersen and Soubusta (2013) have developed a digital edition of the Aṣṭādhyāyī. They have created a relational database schema and web-interface to support custom views and sophisticated queries. We opted for a hierarchical key-value structure (JSON) to represent Aṣṭādhyāyī as it enables a more convenient way to navigate the text unlike a relational model.

  1. Workflow

The specific details addressed in this paper include

  1. A programmatic interface to Aṣṭādhyāyī with a powerful query language for sophisticated search,
  2. A mechanism to automatically extract definitions of saṃjñās (both statically and dynami- cally derived) by interpreting their sūtra text.
  3. A mechanism to decode sūtra words employing ’it’ forms, in the entire text and pāthās, such as dhātus (e.g., gambol), pratyayas (śānac), pratyāhāras (ac, hal) etc.
  4. Database

We have started with a well-annotated and curated online resource for Aṣṭādhyāyī Susarla and Susarla (2012) available as a spreadsheet due to its amenability to augmentation and scripted manipulation. Table 1 outlines its schema. The spreadsheet assigns each sūtra a canonical ID string in the format APSSS (e.g., 11076 to denote the 76th sūtra in 1st pāda of 1st adhyāya). To enable machine-processing, each sūtra is provided with its words split by sandhi and the individ- ual words in a samāsa separated by hyphens and tagged with simple morphological attributes such as type (subanta, tiṅanta or avyaya), vibhakti and vacana to enable auto-extraction. The adhikāra sūtras are also explicitly tagged with their influence given as a sūtra range. For each sūtra, the padas that are inherited from earlier sūtras through anuvṛtti are listed along with their source sūtra id and vibhakti modification in the anuvṛtta form if any.

We auto-convert this spreadsheet into a JSON JSON (2000) dictionary and use it as the basis for the PAIAS service. Table 2 shows an example JSON description of sūtra 1.2.10 with all the above mentioned features illustrated.

  1. Interpretation

At a high-level, our approach to Aṣṭādhyāyī interpretation involves the following manual steps:

  • Splitting of sandhis and samāsa in the sūtra text to facilitate detection of word recurrences.
  • Enumerating the anuvṛtta padas of each sūtra (from earlier sūtras).
  • Preparation of a vibhakti suffix table that covers subantas of Aṣṭādhyāyī for use in mor- phological analysis of sūtra words.


‘ ‘ Adhyaaya”  : ‘ ‘ Adhyaaya # adhyAyaH ” , ‘ ‘ Paada”  : ‘ ‘ Paada # pAdaH” ,

‘ ‘ sutra_num”  : ‘ ‘ sutra_num sU . saM . ” ,

‘ ‘ sutra_krama ”  : ‘ ‘ sutra_krama sU . kra . saM” ,

‘ ‘ Akaaraadi_krama ”  : ‘ ‘ Akaaraadi_krama akArAdi kra . saM” , ‘ ‘ Kaumudi_krama”  : ‘ ‘ Kaumudi_krama kaumudI kra . saM” ,

‘ ‘ sutra_ id ”  : ‘ ‘ sutra_ id pUrNa sU . saM . ” ,

‘ ‘ sutra_ type ”  : ‘ ‘ sutra_ type sutralakShaNam ” , ‘ ‘ Term”  : ‘ ‘ Term saMj~nA” ,

‘ ‘ Metarule ”  : ‘ ‘ Metarule paribhAShA ” ,

‘ ‘ Special_ case ”  : ‘ ‘ Special_ case atidesha H ” , ‘ ‘ I n f l u e n c e ”  : ‘ ‘ I n f l u e n c e adhikAraH ” ,

‘ ‘ Commentary”  : ‘ ‘ Commentary vyAkhyAnam” , ‘ ‘ sutra_ text ”  : ‘ ‘ sutra_ text sutram ” ,

‘ ‘ PadacCheda”  : ‘ ‘ PadacCheda padchChedaH ” ,

‘ ‘ SamasacCheda”  : ‘ ‘ SamasacCheda samAsachChedaH ” ,

‘ ‘ Anuvrtti ”  : ‘ ‘ Anuvrtti pada  s u t r a # anuv RRitti padam  sutra sa~NkhyA” , ‘ ‘ PadacCheda_notes ”  : ‘ ‘ PadacCheda_notes ”


Table 1: Aṣṭādhyāyī Database Schema

” 12010 ” : {

” Adhyaaya” : 1 ,

” Paada” : 2 ,

” Sutra_num” : 10 ,

” Sutra_krama” : 12010 ,

” Akaaraadi_krama ” : 3913 ,

”Kaumudi_krama” :  2613 , ” Sutra_ id ” : ” 1 . 2 . 1 0 ” ,

” Sutra_type ” : [  ” atide Sa H ”  ] , ” Sutra_ text ” : ” halant Acca  | ” , ” PadacCheda” : [

{ ” pada” : ” halant At ” , ” pada_ split ” : ” hal antAt ” ,

” type ” : ” subanta ” ,  ” vachana ”  :  1 , ” v i b h a k t i ” : 5 } ,

{ ” pada” : ” ca ” , ” type ” : ” avyaya ” , ” vachana ” : 0 ,

” v i b h a k t i ”  :  0  } ] ,

” Anuvrtti ”  : [

{  ” s u t r a ” :  12005 ,  ” padas ” :  [ ” k i t ” ]  } ,

{  ” s u t r a ” :  12008 ,  ” padas ” :  [ ” san ” ]  } ,

{ ” s u t r a ” : 12009 , ” padas ” : [ ” ikaH ” , ” J a l ” ] }



Table 2: Aṣṭādhyāyī Database Schema

  • Coding of custom functions to interpret the meaning of some technical words used in Aṣṭād- hyāyī but not defined therein (e.g., adarśanam, ādiḥ, antyam, etc.).

Then we automatically preprocess the Aṣṭādhyāyī database as follows.

  1. We first perform morphological analysis of each word of every sūtra to extract its prāti- padikam. This is required to identify recurrence of a word in the Aṣṭādhyāyī regardless of vibhakti and vacana variations. We describe this step in Section 3.3.
  2. For  each sūtra,  we generate a canonical sūtra text that we refer to as its ‘mahāvākya’  as follows. We expand the sūtra’s text to include all anuvṛtta-padas inherited from earlier sūtras. We represent a mahāvākya as a list of pada descriptions, each with its morphological analysis output.
  3. We auto-extract the definitions of all terms (saṃjñās) used in the Aṣṭādhyāyī. These come in different forms and need to be handled differently. We describe this step in Section 4.
  4. We compile saṃjñā and vidhi sūtras into rules to be interpreted at prakriyā time.
  5. Morphological Analysis

To detect recurrences of a sūtra word at different locations in Aṣṭādhyāyī (e.g. through anuvṛtti or embedded references) despite their vibhakti and vacana variations, we need the prātipadikam of each word. Since most Aṣṭādhyāyī words are subantas specific to the treatise and not found in typical Saṃskṛt dictionaries, we developed a simple suffix-based vibhakti analyzer for this purpose. Since our Aṣṭādhyāyī spreadsheet already has words tagged by their vibhakti and vacana, our vibhakti analyzer takes them as hints and finds possible matches in predefined vibhakti tables based on various common word-endings. Once a match is found, it emits an analysis that includes possible alternative prātipadikas along with their liṅga and word-ending. We store the subanta analysis for each Aṣṭādhyāyī word and store it in the padacCheda section of the sūtra JSON entry for ready reference.

With this technique, we are able to determine the prātipadikam accurately for all the tech- nical terms used in Aṣṭādhyāyī and use it for detecting word recurrences. Though the tool generated multiple options for liṅga, that ambiguity doesn’t hurt for our purpose of detecting word recurrence since the prātipadikam is unique. Then we extract term (saṃjñā) definitions from the saṃjñā sūtras as described in Section 4.

  1. Extracting Saṃjñā Definitions from Aṣṭādhyāyī

Aṣṭādhyāyī’s word transformation method consists of detecting pre-defined patterns denoted by saṃjñās or terms and performing associated transformations. These terms denote either a set of explicitly enumerated member elements or conditional expressions to be dynamically checked at prakriyā time. Hence during preprocessing stage, we create a term definition database where each term is defined as a list of member elements or as a compiled rule. The Aṣṭādhyāyī itself defines four types of terms (in increasing order of extraction complexity):

  1. Terms defined in an adhikāra cum saṃjñā sūtra denoting a set of elements enumerated explicitly in subsequent vidhi sūtras (e.g., pratyaya, taddhita, nipāta). The term itself becomes an anuvṛtta pada in all vidhi sūtras in its adhikāra. Moreover, those sūtras refer to both the term and its member elements in prathamā vibhakti. Hence, to extract the definition, we pick prathamā vibhakti terms excluding (a) terms defined in saṃjñā sūtras of Aṣṭādhyāyī and (b) a manually prohibited list of words meant to convey colloquial meaning. With this method, we were able to successfully extract all the pratyayas, taddhitas, nipātas, samāsas from Aṣṭādhyāyī automatically, and verify their authenticity with those identified in Dikshita (2010).
  2. Terms with explicit name defined in saṃjñā sūtras denoting a set of elements enumerated explicitly (e.g., vṛddhi). In this case, the elements are listed in prathamā vibhakti and hence can be extracted directly from the sūtra.
  3. Terms with an explicit name defined in saṃjñā sūtras, and denoting a condition to be computed at prayoga time (e.g., ‘it’).
  4. Terms whose name (saṃjñā) and its members (saṃjñi) are both dynamically computed quantities (e.g., pratyāhāras such as ‘ac’ and ‘hal’)
  5. Terms which are predefined (e.g., ādiḥ, antyam)
  6. Process of ’it’ karaṇam

Many Aṣṭādhyāyī sūtrās contain sūtra padās and dhātu names, maheśvara sūtrās that employ ’it’ varṇās. The first step of processing many Aṣṭādhyāyī sūtrās is to identify the ’it’ varṇās in sūtra padās and removing them. There are 7 saṃjñā sūtrās to identify ’it’ varṇās. In this section, we describe our mechanism for interpreting these ’it’ saṃjñā sūtrās.

  1. Types of words encountered in Aṣṭādhyāyī Sūtrās

To process Aṣṭādhyāyī sūtrās we need to interpret the sūtra padās in a programmatic way. We shall illustrate how sūtra pada interpretation is done for all the words used for ’it’ karaṇam. These are based on the categories mentioned in 4

  1. Terms defined as set of elements in Aṣṭādhyāyī and related pāthas (dhātu pātha, māheśvara sūtrās and śikṣā)
    • upadeśa = all padas listed as members of the upadeśa set in Aṣṭādhyāyī. (Upadeśa includes dhātus and māheśvara sūtrās which are external inputs not from Aṣṭādhyāyī, vibhaktis, pratyayas, kāraka names, samāsa names etc. automatically derived lists from Aṣṭādhyāyī)
  2. Terms automatically and dynamically generated via sūtrās from Aṣṭādhyāyī
    • ac = List of varṇās (pratyāhāra)
    • hal = List of varṇās (pratyāhāra)
    • vibhaktiḥ = List of subanta and tiṅanta pratyayas from Aṣṭādhyāyī
    • a-taddhita = not in taddhita (taddhita matches all padas listed as members of the taddhita set in Aṣṭādhyāyī. a-taddhita matches those not in the taddhita set).
  3. Terms already enumerated in śikṣā
    • ku = ka-varga varṇās [k kh g gh ṅ]
    • cu = ca-varga varṇās

[c ch j jh ñ]

  • ṭu = ṭu-varga varṇās [ṭ ṭh ḍ ḍh ṇ]
  • tu = ta-varga varṇās[t, th, d, dh, n]
  • Terms defined in Aṣṭādhyāyī to be processed using specific conditions in the sūtrās
    • it
  • Terms extracted directly from Aṣṭādhyāyī
    • lopaḥ = adarśanam
  • Manually predefined terms
    • ādiḥ = beginning of the pada.
    • antyam = end of the pada
    • anunāsikaḥ = ’~’ (for anusvāra )
    • ’ñi’ or ’ṭu’ or ’ḍu’ in sūtra ’ādirñiṭuḍavaḥ’ hard coded to check exactly for ñi’ or ’ṭu’ or ’ḍu’ respectively in the beginning of the upadeśa pada
    • ’tasya’ = ’itaḥ’
    • adarśanam = remove (’adarśanam lopaḥ’ is the saṃjñā sūtra for ’lopaḥ’)
  • Process for ’it’ Labeling and Removal


The saṃjñā sūtrās of ’it’ fall into the category of those that explicitly list a term and its definition in prathamā vibhakti with some other conditions e.g., (upadeśe pratyayasya ādiḥ it) cuṭū, etc. We transform all of the saṃjñā sūtrās containing an explicit saṃjñā pada ’it’ into the following by using an example of dhātu ’gamlṛm’ and pratyaya ’śatṛm” :

  • [IF <V7 padas> or <V6 padas>] <V1 padas>2
  • If a given pada matches V7 condition, then those varṇās of the pada matching the criteria specified in V1 padās will be labeled as ’it’.
  • For ’upadeśe anunāsikaḥ ac it’
    • When applying this sūtra to the pratyaya pada ’śatṛm’
    • ’śatṛm’ is labeled by our tool as upadeśa pada because it is part of pratyaya list. Hence this rule matches.
    • ’ac’ varṇās in ’śatṛm’ are ’a’ in position 2 and ’ṛ’ in position 4
    • To those varṇās, we apply the anunāsika check. Then only the varṇa in position 4 namely ’ṛ’ matches. That is labeled as the ’it’ varṇa in ’śatṛ’
    • Similarly for dhātu ’gamlṛm’, it is labelled as upadeśa pada because it is part of dhātu list. After anunāsika check ’lṛ’ is labeled as the ’it’ varṇa.
  • For ’upadeśe antyam hal it’
    • When applying this sūtra to dhātu ’māṅ’
    • ’māṅ’ is labeled upadeśa pada because it is a dhātu pada. Hence this rule matches.
    • ’ṅ’ is the ’hal’ varṇa at the end of the pada here it is in position 3. This is labeled as the ’it’ varṇa.
  • For ’upadeśe vibhaktau antyam hal tu-s-m-āḥ na it’
    • When applying this sūtra to vibhakti pratyayas like ’jas’, ’śas’, ’am’, ’bhyām’
    • ’jas’, ’śas’ are members of ’sup’ hence the tool labels them as upadeśa and vibhakti but not as ’it’ because their antyam hal is ’s’
    • similarly ’am’, ’bhyām’ whose antyam hal is ’m’
  • For ’upadeśe ādiḥ ṇi-ṭu-ḍavaḥ it’
    • When applying this sūtra to dhātu ’ḍukṛñ’
    • ’ḍukṛñ is labeled as an upadeśa pada because it is a dhātu pada and ’ḍu’ is the ādiḥ of that pada hence tagged as ’it’
  • For ’upadeśe pratyayasya ādiḥ ṣaḥ it’
    • When applying this sūtra to pratyaya ’ṣvun’
    • ’ṣvun’ is labeled as upadeśa pada because it is a pratyaya and ’ṣ’ is its ādiḥ hence tagged as ’it’

2V7 = saptamī vibhakti, V6 = ṣaṣṭhī vibhakti, V1 = prathamā vibhakti

  • For ’upadeśe pratyayasya ādiḥ cu-ṭū it’
    • When applying this sūtra to pratyayas ’ñuṭ’ and ’ṇa’
    • ’ñuṭ’ is a pratyaya, ’ñ’ is its ādiḥ, and this varṇa belongs to ca-varga hence tagged as ’it’
    • Similarly ’ṇa’ is a pratyaya , ’ṇ’ is its ādiḥ, and this varṇa belongs to ṭa-varga which is tagged as ’it’
  • For ’upadeśe pratyayasya ādiḥ la-śa-ku-ataddhite it’
    • When applying this sūtra for pratyayas ’lyu’, ’śatṛm’, ’śānac’, and ’ktavatu’
    • ’lyu’ is a pratyaya which is not part of taddhita list, the ādi varṇa ’l’ is tagged as ’it’
    • ’śatṛm’ and ’śānac’ are pratyayas which are not taddhitas, the ādi varṇa ’ś’ is tagged as ’it’
    • Similarly for ’ktavatu’, it is a pratyaya which is not taddhita, the ādi varṇa ’k’ is tagged as ’it’

Figures 1 and 2 show a tree representation for the respective sūtrās. A saṃjñā sūtra has three components: the term denoted by the edge labeled ‘kA’ or ’kaḥ’ , its definition denoted by ‘kasya’, and the context in which the definition applies, denoted by ‘kutra’. saptamī vibhakti padas in the sūtra denote the context. The saṃjñā term, if explicitly present in the sūtra will be in prathamā vibhakti with its defining words also in prathamā. In that case, an executable version of the sūtra is a representation of the tree as a hierarchical list. All words in the same vibhakti in the sūtra have viśeṣaṇa-viśeṣya relation. In ’na vibhaktau tusmāḥ’ the ’na’ denotes the negation or prohibition.

Figure 1: Rule Hierarchy for sūtra ‘cuṭū’

Now that all the ’it’ words are identified, we will use the corresponding vidhi sūtra to remove the ’it’. The process is explained as follows.

  • Using ’tasya lopaḥ’
    • We manually equate tasya = itaḥ
  • For ’adarśanam lopaḥ’
    • lopaḥ = adarśanam self explanatory from Aṣṭādhyāyī itself
    • We pre-define adarśanam as removal. Thus the ’it’ karaṇam process is complete.

Figure 2: Rule Hierarchy for sūtra ‘na vibhaktau tusmāh’

  1. Implementation

We have implemented PAIAS as a Python library and a Flask web micro-service that pro- vides RESTful API access to its functionality.  The API-based interface provides a flexi-   ble, reliable and reusable foundation for open collaborative development of higher level tools and user interfaces in multiple programming languages to accelerate research on  Aṣṭād- hyāyī, while ensuring interoperability of those tools. The code is available on GitHub at and will soon be available as a pip installable module.

The module comes bundled with the Aṣṭādhyāyī spreadsheet along with dhātu pātha and other associated data sets. Upon first invocation after a clean install, the Aṣṭādhyāyī mod- ule computes mahāvākyas for all sūtras, compiles sūtras into machine-executable rules, builds saṃjñā definitions, extracts listable terms such as Pratyayas etc, and transforms vidhi sūtras by applying the matching paribhāṣā sūtras. It then stores all this derived state persistently in JSON format in a MongoDB database. This enables fast access to the Aṣṭādhyāyī engine sub- sequently. Our current implementation does not handle the transformation and interpretation of vidhi sūtras yet.

Figure 3 shows an example Python script using the Aṣṭādhyāyī library. We have also devised a powerful query interface to Aṣṭādhyāyī for sophisticated search. The query condition can be specified as a JSON dictionary supporting a hierarchical specification of desired attributes as shown in this example. We have shown the example of dhātu ’gamlṛm’ and pratyaya ’śatṛm’ where m denotes the anunāsikā. The entire output of ’it’ karaṇam i.e. identifying ’it’ using  all the ’it’ saṃjñā sūtrās and then removal of ’it’ using the vidhi sūtra. The log for the entire process is captured below and the end result is ’gam’ and ’at’ which is the expected output. 3

  1. Evaluation: Putting it all together

In this section, we illustrate the automated operation of our engine via by identifying the ’it’ definition and lopa action. This is an essential step to enable the rest of Aṣṭādhyāyī interpreta- tion.

Our engine accomplishes ‘it’ karaṇam as follows. First, it compiles all saṃjñā sūtras into mahāvākyas and then into machine-interpretable rules. Table 4 shows the mahāvākya repre- sentations and corresponding rules generated by our engine for specific sūtras relevant to ’it’ karaṇam. The engine maintains a terms_db database that caches the set of lexemes denoted by each saṃjñā. At start time, the engine resets this database and populates it with the lexemes of all saṃjñās that are listed explicitly in Aṣṭādhyāyī. During pada_desc tagging, whenever the occurrence of a saṃjñā needs to be detected, the engine checks the terms_db cache first before attempting to interpret the saṃjñā’s rules.

  1. Conclusion

In this paper, we have presented a programmatic interface to the celebrated Saṃskṛt grammar treatise Aṣṭādhyāyī with the goal to evolve a direct interpreter of its sūtras for Saṃskṛt word generation and transformation in all its variations. We have demonstrated this for ’it’ tagging and removal successfully on all dhātus and pratyayas.


Pushpa Dikshita, 2010. Ashtadhyayi Sutra Pathah, chapter 4. Samskrita Bharati.

Pawan Goyal, Amba Kulkarni, and Laxmidhar Behera. 2008. Computer simulation of ashtadhyayi: Some insights. In 2nd International Symposium on Sanskrit Computational Linguistics.

3In our programming, we use the SLP1 convention for Sanskrit alphabet

from ashtadhyayi . u t i l s import * from ashtadhyayi import *

def a ( ) : return ashtadhyayi ( )

pseq = PadaSequence ( padas =[ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] )

r e s = a ( ) . apply_ vidhi_ rule ( pseq , sutra_ id = ’ 13009 ’)

# ’ i t ’ i d e n t i f i c a t i o n and i t s removal .

Pada Sequence : [ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] : Applying Vidhi Sutra tasya lopaH |

label_ samjna ( i t , [ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] ) : Checking sutra 13002 upadeSe ’ janun Asika i t | . . found ac : padas =[ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] varnas =[ ’ a \\ ’ , ’ x ~ ’ , ’ a ’ , ’ f ~ ’ ]

found  anunAsika :  padas =[ ’ ga\\mx~ ’ ,  ’ Satf ~ ’ ]  varnas =[ ’ x ~ ’ ,  ’ f ~ ’ ] label_ samjna ( i t , [ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] ) : Checking sutra 13003 halantyam | . .

found hal : padas =[ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] varnas =[ ’ g ’ , ’m’ , ’ S ’ , ’ t ’ ] found antya : padas =[ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] varnas =[ ’ x ~ ’ , ’ f ~ ’ ]

label_ samjna ( i t , [ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] ) : Checking sutra 13004 na viBaktO tusmAH | . . label_ samjna ( i t , [ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] ) : Checking sutra 13005 AdirYiwuqavaH | . .

found Adi : padas =[ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] varnas =[ ’ g ’ , ’ S ’ ]

label_ samjna ( i t , [ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] ) : Checking sutra 13006 zaH pratyayasya | . . found pratyaya : padas =[ ’ Satf ~ ’ ]

found Adi : padas =[ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] varnas =[ ’ g ’ , ’ S ’ ]

eval_samjna : Checking za ag ai ns t sutra ’ 11071 ’ Adirantyena sahetA | . . found Adi : padas =[ ’ za ’ ] varnas =[ ’ z ’ ]

found antya : padas =[ ’ za ’ ] varnas =[ ’ a ’ ] found i t : padas =[ ’ aiuR ~ ’ ] varnas =[ ’R~ ’ ]

eval_samjna : Checking za ag ai ns t sutra ’ 11072 ’ yena  vi Distadantasya | . . eval_samjna : Checking za ag ai ns t sutra ’ 11070 ’ taparastatk Alasya | . .

eval_samjna : Checking za ag ai ns t sutra ’ 11068 ’ svaM rUpaM SabdasyASabdasaMjYA | . . label_ samjna ( i t , [ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] ) : Checking sutra 13007 cuwU | . .

found pratyaya : padas =[ ’ Satf ~ ’ ]

found Adi : padas =[ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] varnas =[ ’ g ’ , ’ S ’ ]

label_ samjna ( i t , [ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] ) : Checking sutra 13008 la Sakvatad Dite | . . found pratyaya : padas =[ ’ Satf ~ ’ ]

found Adi : padas =[ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] varnas =[ ’ g ’ , ’ S ’ ]

eval_samjna : Checking l a ag ai ns t sutra ’ 11071 ’ Adirantyena sahetA | . . found Adi : padas =[ ’ la ’ ] varnas =[ ’ l ’ ]

found antya : padas =[ ’ la ’ ] varnas =[ ’ a ’ ] found i t : padas =[ ’ aiuR ~ ’ ] varnas =[ ’R~ ’ ]

eval_samjna : Checking  l a ag ai ns t sutra ’ 11072 ’ yena  vi Distadantasya | . . eval_samjna : Checking  l a ag ai ns t sutra ’ 11070 ’ taparastatk Alasya | . .

eval_samjna : Checking l a ag ai ns t sutra ’ 11068 ’ svaM rUpaM SabdasyASabdasaMjYA | . . eval_samjna : Checking Sa ag ai ns t sutra ’ 11071 ’ Adirantyena sahetA | . .

found Adi : padas =[ ’ Sa ’ ] varnas =[ ’ S ’ ] found antya : padas =[ ’ Sa ’ ] varnas =[ ’ a ’ ] found i t : padas =[ ’ aiuR ~ ’ ] varnas =[ ’R~ ’ ]

eval_samjna : Checking Sa ag ai ns t sutra ’ 11072 ’ yena vi Distadantasya | . . eval_samjna : Checking Sa ag ai ns t sutra ’ 11070 ’ taparastatk Alasya | . .

eval_samjna : Checking Sa ag ai ns t sutra ’ 11068 ’ svaM rUpaM SabdasyASabdasaMjYA | . . found Sa : padas =[ ’ Satf ~ ’ ] varnas =[ ’ S ’ ]

found i t : padas =[ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] varnas =[ ’ x ~ ’ , ’ S ’ , ’ f ~ ’ ] After 13009 [ ’ ga\\mx~ ’ , ’ Satf ~ ’ ] g a\ m a t

Table 3: Example usage of Aṣṭādhyāyī Service. This figure shows a sample Python script using our Aṣṭādhyāyī interpreter library and its processing output for prakriti pratyaya sequence ’gamlṛm’ + ’śatṛm’ by the Vidhi sutra ’tasya lopaH’. The output shows the sequence of actions taken and their result. The Samskrit varnas are displayed in SLP1 transliteration format.

sūtra #(APSSS) Mahāvākya Representation Generated rule
13002 it = upadeśe(7) ac(1)anunāsikaḥ(1) [[IF, “upadeśa”], [“ac”, “anunāsikaḥ”]]
13003 it = upadeśe(7) hal(1) antyam(1) [[IF, “upadeśa”], [“hal”, “antyam”]]
13004 it = upadeśe(7) na(0)vibhaktau(7) tusmāḥ(1) [[IF, “upadeśa”, “vibhakti”], [PROHIBIT,“tu-s-ma”]]
13005 it = upadeśe(7) ādiḥ(1)ṇiṭuḍavaḥ(1) [[IF, “upadeśa”], [“ādiḥ”, “ṇi-ṭu-ḍu”]]
13006 it = upadeśe(7) ādiḥ(1) ṣaḥ(1)pratyayasya(6) [[IF, “upadeśa”], [“pratyaya”, [“ādiḥ”, “ṣaḥ”]]
13007 it = upadeśe(7) ādiḥ(1)pratyayasya(6) cuṭū(1) [[IF, “upadeśa”], [“pratyaya”, [“ādiḥ”, “cu-ṭu”]]
13008 it = upadeśe(7) ādiḥ(1)pratyayasya(6) laśaku(1) ataddhite(7) [[IF, “upadeśa”, [NOT, “taddhita”]],[“pratyaya”, [“ādiḥ”, “la-śa-ku”]]
13009 tasya(6) lopaḥ(1) tasya = itaḥ [[“it”, [“lopaḥ”]]
11060 lopa = iti(0) adarśanam(1) [“adarśanam”]

Table 4: Mahāvākya representations produced specific saṃjñā sūtras relevant to ’it’ karaṇam.

Pawan Goyal, Gérard Huet, Amba Kulkarni, Peter Scharf, and Ralph Bunker. 2012. A distributed plat- form for Sanskrit processing. In 24th International Conference on Computational Linguistics (COL- ING), Mumbai.

Prof. Ǵerard Huet. 2007. Inaugural speech. In International Sanskrit Computational Linguistics Sym- posium, 29th Oct.

JSON. 2000. Introducing json.

Amrit Krishna and Pawan Goyal. 2016. Towards automating the generation of derivative nouns in Sanskrit by simulating panini. In Sanskrit and Computational Linguistics – 16th World Sanskrit Conference, Bangkok, Thailand, 2015.

Anand Mishra. 2008. Simulating the paninian system of sanskrit grammar. In 1st and 2nd International Symposium on Sanskrit Computational Linguistics.

Dhaval Patel and Shivakumari Katuri. 2016. Prakriyāpradarśinī – an open source subanta generator. In Sanskrit and Computational Linguistics – 16th World Sanskrit Conference, Bangkok, Thailand, 2015.

Wiebke Petersen and Oliver Hellwig. 2016. Annotating and analyzing the ashtadhyayi. In Input a Word, Analyse the World: Selected Approaches to Corpus Linguistics, Newcastle upon Tyne: Cambridge Scholars Publishing.

Wiebke Petersen and Simone Soubusta. 2013.  Structure and implementation of a digital edition of  the ashtadhyayi. In In Recent Researches in Sanskrit Computational Linguistics – Fifth International Symposium IIT Mumbai, India, January 2013 Proceedings.

Pavankumar Satuluri and Amba Kulkarni. 2013. Generation of sanskrit compounds. In International Conference on Natural Language Processing, 19th-20th Dec.

Peter Scharf and Malcolm Hyman. 2009. Linguistic Issues in Encoding Sanskrit. Motilal Banarsidass, Delhi.

Sridhar Subbanna and Srinivasa Varakhedi. 2010. Asiddhatva principle in computational model of ashtadhyayi. In 4th International Sanskrit and Computational Linguistics Symposium.

Sarada Susarla and Sai Susarla. 2012. Panini ashtadhyayi sutras with commentaries: Sortable index.