<?xml version="1.0"?><!DOCTYPE article SYSTEM "/project/take/software/searchbench_offline_processing/paperxml_generator/aclextractor/src/python/../resource/dtd/paperxml.dtd"><article><header><firstpageheader><page local="1"/><title>Vaakkriti: Sanskrit Tokenizer</title><author surname="Pappu" givenname="Aasish"><org  name="Indian Institute of Information Technology" country="India" city="Allahabad"/></author><author surname="Sanyal" givenname="Ratna"><org  name="Indian Institute of Information Technology" country="India" city="Allahabad"/></author></firstpageheader><frontmatter><p><b>Vaakkriti: Sanskrit Tokenizer</b></p><p><b>Aasish Pappu and Ratna Sanyal</b></p><p>Indian Institute of Information Technology, Allahabad (U.P.), India { akpappu_b03, rsanyal}@iiita.ac.in</p></frontmatter><abstract>Machine Translation has evolved tremen­dously in the recent time and stood as center of research interest for many computer scientists. Developing a Machine Transla­tion system for ancient languages is much more fascinating and challenging task. A detailed study of Sanskrit language reveals that its well-structured and finely orga­nized grammar has affinity for automated translation systems. This paper provides necessary analysis of Sanskrit Grammar in the perspective of Machine Translation and also provides one of the possible solution for Samaas Vigraha(Compound Dissolution). <i>Keywords: </i>Machine Translation, Sanskrit, Natural Language Parser, Samaas Vigraha, Tokenization </abstract></header><body><section number="1" title="Introduction"><p>Sanskrit language and its grammar had exterted an emphatic impact on Computer Science and related research areas. It has resulted to put in extensive ef­forts in the field of Machine Translation(hereafter re­ferred as MT). MT of Sanskrit is never an easy task, because of structural vastness of its Grammar. Be­sides, its strutural vastness Sanskrit Grammar is well organized and least ambigious compared to other natural languages, illustrated by the fact of increas­ing fascination for this ancient Aryan language. Its grammar possesses well organized rules and meta rules to infer those rules, thus proving to be a powerful analogy to context free grammar of a computer language.</p><p>Subsequently, it supports the idea of developing a parser for Sanskrit language, that would be helpful in developing a full-fledged MT system. As a part of development of parser, there are other important as­pects to be taken care off. A <i>morphological analyser </i>and a <i>tokenizer </i>are two of the important components that play a vital role in the parser. A morpholog­ical analyser is used for identification of the base words from their morphonemes, further to under­stand the semantics of the original text. A tokenizer also plays its significant part in a parser, by identi­fying the group or collection of words, existing as a single and complex word in a sentence. Later on, it breaks up the complex word into its constituents in their appropriate forms. In Sanskrit, mainly we have two categories of complex words. They are• Sandhi</p><p>• Samaas <b>1.1   Sandhi and Samaas</b></p><p><i>Sandhi: </i>When two words combine to produce a new word whose point of combination is result of anni­hilation of case-end of former word and case-begin of latter. In short, the resulted new character that has been created at the point of combination is ex­actly equivalent to the sound produced when those two words are uttered without a pause. The inverse procedure to Sandhi-formation is known as <i>Sandhi Wicched.</i></p><p>On the other hand, when two or more words are combined, based on their semantics then the result­ing word is known as <i>Samaas </i>or Compound. Unlike<page local="2"/></p><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">577</doubt><p>Sandhi, the point of combination in Samaas may or may not be a deformed in the resulting word. The in­verse procedure of break-up of a Samaas is known as <i>Samaas Vigraha. </i>Considering the complexity of this problem, we restricted our focus to Samaas Vigraha or <i>Compound Dissolution(hereafter </i>Compound Dis­solution is referred as CD for convenience).</p><subsection number="1.2" title="Organization of the Paper"><p>Initially, we would discuss about the problem of fo­cus and the main objective of this paper in detail. Further, a little overview about the Sanskrit grammar and Knowledge Representation, that are required to understand the underlying concepts of the system. Then, we would brief about the existing systems in this areas and the related areas of interest. Later on, we would give a detailed description of the architec­ture of Vaakkriti. We would give a detailed analysis of the results of our system and finally, throw some light over our contribution to this research area.We shall conclude with some of drawbacks of our sys­tem and the challenges we have faced.</p></subsection></section><section number="2" title="The Problem"><p>Semantics being the prime focus, we need to learn the factors that effect the formation of a compound from the set of atomic words. The basic problem is identification of factors, by thorough analysis of language structure or with the help of a linguist. Es­pecially various examples of Samaas must be exten­sively observed. After identification of factors, we need to find out the appropriate form of Knowledge Representation for the rule-base. Here, knowledge being the rules, based on which a particular com­pound is formed. The importance of CD can be clearly understood, during the process of tokeniza-tion. A well-defined set of rules in Sanskrit can be found in "Ashtadyayi", authored by 3rd century grammarian and linguist Panini. Ashtadyayi con­tains rules of Grammar in a concise form, distributed over eight chapters. Our rule-base system would be based on the work of Kale et. al, that has detailed description of Paninian Grammar.</p></section><section number="3" title="Sanskrit Grammar"><p>As we have already mentioned that, it is necessary to know some of the basic concepts of the Sanskrit grammar. First, we would give some important def­initions of terms that are frequently used in this pa­per.</p><subsection number="3.1" title="Important Definitions"><subsubsection number="3.1.1" title="Vibhakti(Declension)"><p>Sanskrit is a highly inflected language with three grammatical genders (masculine, feminine, neuter) and three numbers (singular, plural, dual). It has eight cases: nominative, vocative, accusative, instru­mental, dative, ablative, genitive, and locative.</p></subsubsection><subsubsection number="3.1.2" title="Dhatupata(Verbal Conjugation)"><p>The verbs tenses (a very inexact application of the word, since more distinctions than simply tense are expressed) are organized into four 'systems' (as well as gerunds and infinitives, and such creatures as in­tensives or frequentatives, desideratives, causatives, and benedictives derived from more basic forms) based on the different stem forms (derived from ver­bal roots) used in conjugation. There are four tense systems:</p><p>• Present (Present, Imperfect, Imperative, Opta­tive)</p><p>• Perfect</p><p>• Aorist</p><p>• Future (Future, Conditional)</p></subsubsection></subsection><subsection number="3.2" title="Factors that effect"><p>The list of factors that are involved in a rule are• Part of Speech(hereafter referred as POS)</p><p>• List of Words(a token must be among a set of words to satisfy a rule)</p><p>• Case-End</p><p>• Case-Begin</p><p>• Declension</p><p>• Sense(a token with a particular sense is only qualified)</p><p>• Meaning</p><doubt alpha="71.4" length="7" tooSmall="False" monospace="0.0">• Affix</doubt><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">578</doubt><page local="3"/><p>• Affix <i>Type(Taddita </i>and <i>Kriti)</i></p><p>• Number(sng, two, mny)(hereafter we refer number as num)</p><doubt alpha="65.2" length="23" tooSmall="False" monospace="0.0">• Gender(mas, fem, neu)</doubt><p>The list of actions that act as functions in the con­sequent of a rule are:-</p><p>• setDecl(set the declension case for a specified token)</p><p>• addBefore(add a string before a specified to­ken)</p><p>• addAfter(add a string after a specified token)</p><p>• setNumber(set   the   number of ken(sng,two,mny))</p><doubt alpha="60.0" length="5" tooSmall="False" monospace="0.0">a to-</doubt><p>• replace(replace a token with a string related to it)</p></subsection><subsection number="3.3" title="Compounds"><p>Nominal compounds occur with various structures, however morphologically speaking they are essen­tially the same. Each noun (or adjective) is in its (weak) stem form, with only the final element re­ceiving case inflection. Some examples of nominal compounds include:</p><p><b>Trutiya(Instrumental) Tatpurusha</b></p><p>Example: j:*Htfid:to adrtr:</p><p><i>Rule: </i>POS(token1,noun) A (POS(token2,verb) V WordList(tofcen2,pVj-, S^f , UT))^ setDecl(token1,ins) <b>Chaturthi(Dative) Tatpurusha</b></p><p>Example: yHdlZ (yupadaru)to       dTZ"(yupaya daru) <i>Rule:   </i>POS(token1,noun) A (Sense(tofcen2,"material")</p><doubt alpha="64.3" length="42" tooSmall="False" monospace="0.0">V WordList(tofcen2,aT",bfl,f^d",S^T,TfW))=</doubt><p>setDecl(token1,dat)</p><p><b>Panchami(Ablative) Tatpurusha</b></p><p>Example: C^H^m (cOrabayam)to CC HrrncOraad <i>Rule:</i><i> </i>POS(token1,noun) A (WordList(token2,</p><doubt alpha="83.3" length="6" tooSmall="False" monospace="0.0">bayam)</doubt><p>, Hrtr, Hrftr, HY:, aTr, aTrs" , mpfr, Tfrrtr, aTV-r))= setDecl(token1,abl)</p><p><b>Shashti(Genitive) Tatpurusha</b></p><p>Example: rijpzq: (rAjapurushaH)to</p><p>pzq:(rAjangya PurushaH)</p><p><i>Rule: </i>POS(token1,noun) A (POS(tofcen2,noun)A-POS(tofcen2,verb)A— NumeralType(tofcen2,ordinal)A— SenseOf(tofcen2,"quality"))=&gt; setDecl(token1,gen) <b>Saptami(Locative) Tatpurusha</b></p><p>Example: + :(nagarAkAkaH)to nft kTk:</p><p>iV(nagare kAkaH iva)</p><p><i>Rule: </i>POS(token1,noun)</p><p>A (MeaningOf(iofcen2,"crow")A Example: &lt;imi#HZH&lt;df^ai :(RAmaLakshmaNaBaratAH)SenseOf(iofcen2,''contempt''))=- setDecl(ioken1,loc)A to TTH": C IWT: C BTf": C 3Tp":(RAma ca, LakshmaNa    addAfter(iofcen2, iV) ca, Barata ca)</p><p><i>Rule: </i>Viofcen POS(iofcen,noun) == setDecl(iofcen,nom)A addAfter(iofcen,C) <b>Samahaara</b></p><p>Example: PiZlpidl (pANlpAdau)to</p><p>TPZT C PlddH C(pANI ca pADam)</p><p><i>Rule: </i>Viofcen, Elsense     POS(iofcen,noun) A</p><p>SenseOf(iofcen, sense) == setDecl(iofcen,nom)A addAfter(iofcen,C)</p><p><b>Dvitiya(Accusative) Tatpurusha</b></p><p>Example: d":&lt;&lt;dd1r:(dukhatltaH)to ^:^hh afrr":(dukhamatItaH) <i>Rule:</i><i>     </i>POS(iofcen1,noun)  A  WordList(iofcen2,f5Tfr,</p><p>after, ?1w, gr, ary-r, srra", arw, gHY, fB"p</p><p>=setDecl(iofcen1,acc)</p></subsection></section><section number="4" title="Knowledge Representation"><p>We have already learnt that the process ofCD is sup­ported by a rule-base system. A production system is a good illustration to understand a rule-base sys­tem. To represent a complex rule, it would be bet­ter to use First Order Predicate Logic(FOPL). Un­der FOPL a rule can be written as of the form P (a) a where <i>P, Q </i>and R are predicates <i>a,</i><i> </i><i>b</i><i> </i>and c are constant symbols <i>Action </i>is a function symbol</p><doubt alpha="64.0" length="50" tooSmall="False" monospace="0.0">Q(a)AQ(6)AR(c) == Actioni(a)AAction2(b)AActioni(c)</doubt><p>The rule-base system of Vaakkriti is de­veloped considering the factors as pred­icates and the tokens as constant sym­bols.     A sample rule would look like this<page local="4"/></p><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">579</doubt><p>POS(tofc1,noun) a (POS(tofc2, verb) decl(tofc2, acc)) == setDecl (tofcen1, acc).</p></section><section number="5" title="Related Work"><p>In the recent times many efforts have been made to develop various utilities for Sanskrit. The tools de­veloped includes Sanskrit to other Indian Language transliteration tools, simple and primitive transla­tion tools, many grammar analysing tools and many more learning tools. Some of the important works includes Anusaraka, a primitive machine translation tool developed by Akshar et. al. Anusaraka tries to take advantage of the relative strengths of the computer and the human reader, where the com­puter takes the language load and leaves the world knowledge load on the reader. Besides, these tools, there are some beautiful theory-based research work was also done. The concept of Indian Network Lan-guage(INL) is one of such concepts that was pro­posed by Anupam et. al. It gives a hypothesis to consider Sanskrit as INL because of its important properties like free word order and inherent seman­tic net structure. There are few other interesting re­search concepts that have been analysed in the con­text of Sanskrit language. Rick Braggs et. al have shown in his article how Knowledge Representation in the language of Sanskrit is one of those wonderful concept to show that Semantic Nets. Semantic Nets are concept respresenting structures, that show how a concept is related to other concepts semantically, a semantic net would like in the figure below. Another beautiful research work was comparison of Paninian Grammar and Computer language Grammar. Bhate et al. has analysed to show that how well organized and structured is Sanskrit Grammar and its forgot­ten valuable contributions to the field of Computer Science.</p></section><section number="6" title="Architecture"><p>An Itrans standard formatted devanagiri text is given as input to the system and the output of the system is the set of tokens produced after CD. The list of components in the system are listed below:</p><p>• Input Processor</p><p>• Symbol Table</p><p>• Knowledge Base</p><p>• Inference Engine</p><p>• Database</p><p>• Rule-Base Editor</p><p>The architecture of Vaakkriti can be seen in the fig­ure</p><figure caption="Figure 1: Architecture of Vaakriti"></figure><p>The algorithm of Vakkriti is given below:- A de-</p><p><b>Algorithm 1 </b>Algorithm of Vaakkriti 1: input — Itrans-Devanagiri Text 2: input' — breakUp(input) 3: tokenList — tentativeTokenize(input') 4: tokenlnfoList — tokenList 5: <b>for </b>token in tokenlnfoList <b>do </b>6:    token(i) — extractInfo(token» 7:    <i>update </i>token(i) in tokenlnfoList 8: <b>end for</b></p><p><i>return </i>r <b>end if</b> tailed description of each component is as follows.</p><doubt alpha="0.0" length="7" tooSmall="False" monospace="0.0">10: 11:</doubt><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">12:</doubt><doubt alpha="60.0" length="10" tooSmall="False" monospace="0.0">13:end for</doubt><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">580</doubt><p>9: <b>for </b>each rule(r) in Knowledge-Base(KB) <b>do</b></p><p>result — infer(r,tokenInfoList) <b>if </b>result is <i>true </i><b>then</b><page local="5"/></p><subsection number="6.1" title="Input Processor"><p>The unstemmed compound taken as input to the sys­tem is a string in itrans format. First, Input Processor breaks the itrans string into chunks of characters on the basis of Devanagiri Character set. The heuristic for break up procedure is given below:-</p><p>The reason behind the breakup procedure is to ease the process of breaking the string into words in their tentative forms. If a string is considered as it is without breakup into devanagiri characters, then there is a high chance of ambiguity while lookup in</p><p>the dictionary. For example:-Without breakup of input string</p><doubt alpha="100.0" length="3" tooSmall="False" monospace="0.0">aja</doubt><p>ajagaraH— Found this word</p><p>With breakup of string into character sequences</p><doubt alpha="75.0" length="4" tooSmall="False" monospace="0.0">a,ja</doubt><p>a,ja,ga,raH</p><p>Later on the chunks of characters are processed as in the procedure below:-</p><p>The words lying in input string are tentatively guessed by maintaining a stack of character se­quences, thus checking with the dictionary for the right word. But, in most of the cases, the word in the input string do not have an exact match in the dictionary. This is because of the <i>matra </i>appended to <i>Case-End </i>of a word. Therefore, we have generated tokens for each matra and tried to find it in the dic­tionary. If the word is found, then the word along with its meaning is stored in the Symbol Table.</p></subsection><subsection number="6.2" title="Symbol Table"><p>Now, we shall discuss more about how a Symbol Table fetches those subtle information of a token. Symbol table extracts token information in the fol­lowing manner:-</p><subsubsection number="6.2.1" title="Part of Speech"><p>Part of Speech is identified with the help of stan­dard Monier Williams Dictionary, List of Adverbs, List of Prepositions, List of Numerals.</p></subsubsection><subsubsection number="6.2.2" title="Sense and Meaning"><p>First, meaning of the token is known from the dic­tionary and the sense of the token is fetched through a special kind of procedure. The technique has fol­lowing steps:1. Identify the nouns in the meaning phrase.</p><p>2. Find sense for each noun with the help of En­glish Wordnet.</p><p>3. Find a list of "common" senses for all the nouns.</p><p>4. That list of senses is assumed to the sense of a token.</p></subsubsection><subsubsection number="6.2.3" title="Gender and Number"><p>These are fetched from the XML database.</p></subsubsection></subsection><subsection number="6.3" title="Knowledge Base"><p>The Knowledge Base(KB) contains facts and rules that supports the system, for identifying a given in­put. The KB has been classified well, according to the Rule Sets. A Rule Set is a set of rules that are meant for a particular type of compound. Infact, a new rule set can be created whenever there is a new part of speech to be dealt with. It has been assumed that, a rule has clauses(both unit and definite) on an-tescendent side, whose number is equal to tentative number of tokens in the input parsed string. On the other hand, the consequent or conclusion contains the list of actions that has to be operated over the to-kens(in the input string) by the system. More about the rule structure in the next section.</p><p>The KB is well integrated with the Rule Base Ed-itor(RBE) and the Inference Engine. Currently, it contains limited number of rules this makes the KB non-monotonic, yet it can be made monotonic, by addition of new rules.</p></subsection><subsection number="6.4" title="Database"><p>There is a large database that supports the whole sys­tem of Vaakriti. The database is contained in the form of XML files. There are following tables in the database:-• Nouns, Adjectives, Numerals Declensions.</p><p>• Adverbs, Conjunctions and Prepositions.</p><p>• Dictionary Database.</p><p>• Preverbs database.</p><p>• Other Morphonemes.</p><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">581</doubt><page local="6"/></subsection><subsection number="6.5" title="Inference Engine"><p>Whenever premises of a particular are satisified by the input parse string, then it is said that a rule is fired. A fired rule applies its consequent part over the parsed string to result in actual goal. This proce­dure is known as Rule Inference.</p></subsection><subsection number="6.6" title="Rule Base Editor"><p>The sole motive of Rule-Base Editor is to free the Knowledge Engineer free from rule entry. A Lin­guist with little training to operate the GUI can be provided, would suffice this task.</p></subsection></section><section number="7" title="Results"><p>The system has been tested with many examples that have been taken from the book written by Kale et al. The set of examples have been chosen from differ­ent set of Compounds. In most of the cases system has given correct results with a precision of 90%, but in some of the cases that involve sense, it be­came quite difficult to produce the result. Lack of linguistic tools like Wordnet for Sanskrit language imposes limitations on word sense disambiguation. We have developed a sense list for a limited set of words by observing some of the important sanskrit texts, based on the knowledge we have acquired.</p></section><section number="8" title="Our Contribution"><p>We have proposed a utility called Rule-Base Editor, besides our actual work on CD. The motive behind Rule-Base Editor is to induce the property of flexi­bility into the system. It always avails a linguist to enter new rules with the help of Rule-Base Editor without any support from knowledge engineer.</p><p>We have already learnt that Samaas Vigraha(CD) is the most important aspect of the tokenization phase in a parser. Implicitly, the acquisition of fac­tors and rules also gather equal importance. Signify­ing this fact, we have done rigorous survey over the grammar to identify these factors. Hence, we assert that our system will be a significant contribution in this area of research.</p></section><section number="9" title="Future Scope and Conclusion"><p>We assert that Vaakkriti would be a preliminary con­tribution to the realm of NLP. Adding to the major works that have been done already, Vaakkriti is an attempt to enhance the existing works. We would extend the current system and develop a full-fledged parser that will suffice most of the requirements of MTsystem.</p><p>Although, it looks the way that the problem has been solved, but the actual problems arouses when a Sanskrit poem is given as input to a MT system. Usually, a sanskrit poem conveys more than one meaning and sometimes figure of speech is used, that adds fuel to the fire. This becomes a herculean task for a MT system and it will remain as a myth forever.</p></section><section title="Acknowledgements"><p>The authors would like to specially thank Gerard Huet for providing linguistic database of declensions and verbal roots, that was quite helpful in making our system fine and complete. The authors grate­fully acknowledge financial support from the Uni­versal Digital Library project, funded by the Min­istry of Communication and Information Technol­ogy (MCIT) India and also Indian Institute of Infor­mation Technology, Allahabad.</p></section><references><p>Higher Sanskrit Grammar, M. R. Kale, Motilal Banarasi-Dass Publishers.</p><p>"Paninis Grammar and Computer Science", Saroja Bhate and Subhash Kak, Annals of the Bhandarkar Oriental Research Institute, vol. 72, 1993, pp. 79-94.</p><p>"Knowledge Representation in Sanskrit and Artificial In­telligence", Rick Briggs "Artificial Intelligence", Elain Rich and Kevin Knight, 2nd Edition, Tata McGrawHill, 1991.</p><p>"Artificial Intelligence, A Modern Approach" Stuart Rus­sell and Peter Norvig, 2nd Edition, Pearson Education, 2003.</p><p>"Sanskrit as Indian Networking Language: A Sanskrit Parser", Anupam, 2004.</p><p>"Natural Language Processing, A Paninian Perspective", Akshar Bharti, Vineet Chaitanya and Rajeev Sangal, Pearson Education.</p><p>"Natural Language Processing using PROLOG" by M. Gerald, M Chris, Addison and Wisley, 1989.</p><p>"Cognitive Science Learning Resource", http://www.comp.leeds.ac.uk/ugadmit/cogsci/knowled</p><doubt alpha="0.0" length="3" tooSmall="False" monospace="0.0">582</doubt></references></body></article>