<?xml version="1.0" encoding="utf-8"?>
<lgr xmlns="urn:ietf:params:xml:ns:lgr-1.0">
  <meta>
    <version comment="Proposed LGR for Devanagari">1</version>
    <date>2016-12-08</date>
    <language>und-Deva</language>
    <scope type="domain">.</scope>
    <unicode-version>6.3.0</unicode-version>
    <description type="text/html"><![CDATA[
    <h1>Label Generation Rules for Devanagari</h1>
    <h2>Overview</h2>
    <p>For more details on this proposal see "Proposal for Generation Panel for 
    Neo-Brahmi Scripts Label Generation Ruleset for the Root Zone [Proposal]"</p>
    <h2>Repertoire</h2>
    <p>The 65 code points are according to Section 5 "Repertoire" in [Proposal]. 
      
    <h2>Variants</h2>
    <p>This LGR defines no variants till the time other script panels under 
    Neo-brahmi GP begin work on their respective LGRs</p>
      
    <h2>Character Classes</h2>
    <p></p>
      
    <h2>Whole Label Evaluaton (WLE) rules</h2>

]]></description>
    <references>
      <reference id="0">The Unicode Standard 1.0.0, The Unicode Consortium, Mountain View, CA. 1991</reference>
      <reference id="101">IS 16350: 2016 Enhanced Inscript Keyboard layouts</reference>
    </references>
  </meta>
  <data>

    <char cp="0901" when="follows-only-V-or-C-or-N-or-M" tag="diacritic" ref="0 101" comment="DEVANAGARI SIGN CANDRABINDU = anunasika" />
    <char cp="0902" when="follows-only-V-or-C-or-N-or-M" tag="diacritic" ref="0 101" comment="DEVANAGARI SIGN ANUSVARA = bindu" />
    <char cp="0903" when="follows-only-V-or-C-or-N-or-M" tag="visarga" ref="0 101" comment="DEVANAGARI SIGN VISARGA" />
    <char cp="0905" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER A" />
    <char cp="0906" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER AA" />
    <char cp="0907" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER I" />
    <char cp="0908" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER II" />
    <char cp="0909" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER U" />
    <char cp="090A" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER UU" />
    <char cp="090B" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER VOCALIC R" />
    <char cp="090D" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER CANDRA E" />
    <char cp="090F" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER E" />
    <char cp="0910" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER AI" />
    <char cp="0911" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER CANDRA O" />
    <char cp="0913" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER O" />
    <char cp="0914" tag="vowel" ref="0 101" comment="DEVANAGARI LETTER AU" />
    <char cp="0915" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER KA" />
    <char cp="0916" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER KHA" />
    <char cp="0917" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER GA" />
    <char cp="0918" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER GHA" />
    <char cp="0919" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER NGA" />
    <char cp="091A" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER CA" />
    <char cp="091B" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER CHA" />
    <char cp="091C" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER JA" />
    <char cp="091D" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER JHA" />
    <char cp="091E" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER NYA" />
    <char cp="091F" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER TTA" />
    <char cp="0920" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER TTHA" />
    <char cp="0921" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER DDA" />
    <char cp="0922" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER DDHA" />
    <char cp="0923" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER NNA" />
    <char cp="0924" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER TA" />
    <char cp="0925" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER THA" />
    <char cp="0926" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER DA" />
    <char cp="0927" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER DHA" />
    <char cp="0928" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER NA" />
    <char cp="092A" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER PA" />
    <char cp="092B" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER PHA" />
    <char cp="092C" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER BA" />
    <char cp="092D" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER BHA" />
    <char cp="092E" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER MA" />
    <char cp="092F" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER YA" />
    <char cp="0930" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER RA" />
    <char cp="0931 094D 092F" comment="To enable Eyelash Repha Formation with Rra+Halanta+Ya and prevent stand-alone RRA from occuring" />
    <char cp="0931 094D 0939" comment="To enable Eyelash Repha Formation with Rra+Halanta+Ha and prevent stand-alone RRA from occuring" />
    <char cp="0932" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER LA" />
    <char cp="0933" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER LLA" />
    <char cp="0935" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER VA" />
    <char cp="0936" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER SHA" />
    <char cp="0937" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER SSA" />
    <char cp="0938" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER SA" />
    <char cp="0939" tag="consonant" ref="0 101" comment="DEVANAGARI LETTER HA" />
    <char cp="093C" when="follows-only-consonant" tag="nukta" ref="0 101" comment="DEVANAGARI SIGN NUKTA" />
    <char cp="093E" when="follows-only-C-or-N" tag="matra" ref="0 101" comment="DEVANAGARI VOWEL SIGN AA" />
    <char cp="093F" when="follows-only-C-or-N" tag="matra" ref="0 101" comment="DEVANAGARI VOWEL SIGN I stands to the left of the consonant" />
    <char cp="0940" when="follows-only-C-or-N" tag="matra" ref="0 101" comment="DEVANAGARI VOWEL SIGN II" />
    <char cp="0941" when="follows-only-C-or-N" tag="matra" ref="0 101" comment="DEVANAGARI VOWEL SIGN U" />
    <char cp="0942" when="follows-only-C-or-N" tag="matra" ref="0 101" comment="DEVANAGARI VOWEL SIGN UU" />
    <char cp="0943" when="follows-only-C-or-N" tag="matra" ref="0 101" comment="DEVANAGARI VOWEL SIGN VOCALIC R" />
    <char cp="0945" when="follows-only-C-or-N" tag="matra" ref="0 101" comment="DEVANAGARI VOWEL SIGN CANDRA E = candra" />
    <char cp="0947" when="follows-only-C-or-N" tag="matra" ref="0 101" comment="DEVANAGARI VOWEL SIGN E" />
    <char cp="0948" when="follows-only-C-or-N" tag="matra" ref="0 101" comment="DEVANAGARI VOWEL SIGN AI" />
    <char cp="0949" when="follows-only-C-or-N" tag="matra" ref="0 101" comment="DEVANAGARI VOWEL SIGN CANDRA O" />
    <char cp="094B" when="follows-only-C-or-N" tag="matra" ref="0 101" comment="DEVANAGARI VOWEL SIGN O" />
    <char cp="094C" when="follows-only-C-or-N" tag="matra" ref="0 101" comment="DEVANAGARI VOWEL SIGN AU" />
    <char cp="094D" when="follows-only-C-or-N" tag="halant" ref="0 101" comment="DEVANAGARI SIGN VIRAMA = halant (the preferred Hindi name); suppresses inherent vowel" />



  </data>
  <!--Rules section goes here-->
  <rules>
    <!--Character class definitions go here-->
    <class name="consonant" from-tag="consonant" />
    <class name="vowel" from-tag="vowel" />
    <class name="matra" from-tag="matra" />
    <class name="visarga" from-tag="visarga" />
    <class name="halant" from-tag="halant" />
    <class name="nukta" from-tag="nukta" />
    <class name="diacritic" from-tag="diacritic" />

    <!--Whole label evaluation and context rules go here-->
    <rule name="leading-combining-mark" comment="Default rule from MSR-2. \u253F">
      <start />
      <union>
        <class property="gc:Mn" />
        <class property="gc:Mc" />
      </union>
    </rule>

    <rule name="follows-only-consonant" comment="These characters can only be preceded by consonant">
      <look-behind>
        <class by-ref="consonant" />
      </look-behind>
      <anchor />
    </rule>

    <rule name="follows-only-C-or-N" comment="These characters can only be preceded by consonant or nukta">
      <look-behind>
        <choice>
          <class by-ref="consonant" />
          <class by-ref="nukta" />
        </choice>
      </look-behind>
      <anchor />
    </rule>

    <rule name="follows-only-V-or-C-or-N-or-M" comment="These characters can only be followed by either Vowel or Consonant or Nukta or Matra">
      <look-behind>
        <choice>
          <class by-ref="vowel" />
          <class by-ref="consonant" />
          <class by-ref="nukta" />
          <class by-ref="matra" />
        </choice>
      </look-behind>
      <anchor />
    </rule>
	
    <!-- Commenting as the Nukta has been restricted to precede only specific consonants
	
    <rule name="nukta-does-not-follow-eyelash-reph" comment="Matches a nukta following an eyelash reph">
      <choice>
        <char cp="0931 094D 092F" comment="eylash reph with ya" />
        <char cp="0931 094D 0939" comment="eylash reph with ha" />

      </choice>
      <class by-ref="nukta" />
    </rule>

    <!--Action elements go here - order defines precedence-->    
    <action disp="invalid" match="nukta-does-not-follow-eyelash-reph" comment="A nukta cannot follow an eyelash-reph" />
	-->
    <action disp="invalid" match="leading-combining-mark" />
    <action disp="invalid" any-variant="out-of-repertoire-var" comment="any variant label with a code point out of repertoire is invalid ���" />
    <action disp="blocked" any-variant="blocked" comment="default action MSR-2 ���" />
    <action disp="allocatable" any-variant="allocatable" comment="default action MSR-2 ���" />
    <action disp="valid" comment="catch all; default action from MSR-2 ���" />
  </rules>
</lgr>