# This table contains braille codes and rules for Devanagari  script.
#
# Copyright (C) 2014 National Institute for Visually Handicapped, 116, Rajpur Road, Dehradun, Uttrakhand, India
#
# This file is part of liblouis.
#
# liblouis is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 2.1 of the
# License, or (at your option) any later version.
#
# liblouis is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with liblouis. If not, see
# <http://www.gnu.org/licenses/>.

# This table is built and maintained under an activity of Braille Council of India
# Contributors: Dipendra Manocha, Sreeja, Dinesh Kaushal, Mesar Hameed
# Last updated on May 5, 2014
# To report any bugs or any suggestion, please write to d@saksham.org and sreeja.param@gmail.com
  
include braille-patterns.cti

letter \x0901 3 # davanagari chandra bindu 
letter \x0902 56 # davanagari anuswar 
letter \x0903 6 # davanagari visarg
letter \x0904 1 #chhoTa aa"
letter \x0905 1 #chhoTa aa"
letter \x0906 345 #baraa aa"
letter \x0907 24 #"chhoTi ii"
letter \x0908 35 #"baRii ii"
letter \x0909 136 #"chhoTaa u"
letter \x090A 1256 #"baRaa uu"
letter \x090B 5-1235 #"RRi"
letter \x090C 5-123 #"lri"
letter \x090D 34 #"e"
letter \x090E 26 #"short e for dravidian"
letter \x090F 15 #"e"
letter \x0910 34 #"ai"
letter \x0911 1346 #"o as in office"
letter \x0912 135 #"short o"
letter \x0913 135 #"o"
letter \x0914 246 #"au"

replace \x200D  

letter \x0915 13 # davanagari ka
letter \x0916 46 # davanagari kha
letter \x0917 1245 # davanagari ga
letter \x0918 126 # davanagari gha
letter \x0919 346 #davanagari aNgaa

letter \x091A 14 # davanagari cha
letter \x091B 16 # davanagari cha
letter \x091C 245 # davanagari ja
letter \x091D 356 # davanagari jha
letter \x091E 25 #davanagari yangaa

letter \x091F 23456 # davanagari ta
letter \x0920 2456 # davanagari tha
letter \x0921 1246 # davanagari da
letter \x0922 123456 # davanagari dha
letter \x0923 3456 #davanagari nna

letter \x0924 2345 # davanagari ta
letter \x0925 1456 # davanagari tha
letter \x0926 145 # davanagari da
letter \x0927 2346 # davanagari dha
letter \x0928 1345 #davanagari na

letter \x0929 56 #davanagari na nukta

letter \x092A 1234 # davanagari pa
letter \x092B 235 # davanagari tha
letter \x092C 12 # davanagari ba
letter \x092D 45 # davanagari bha
letter \x092E 134 #davanagari ma

letter \x092F 13456 # davanagari yaa
letter \x0930 1235 # davanagari ra
letter \x0931 12456 # davanagari rra
letter \x0932 123 # davanagari la
letter \x0933 456 #davanagari la
letter \x0934 123 #davanagari la
letter \x0935 1236 #davanagari va
letter \x0936 146 #davanagari sha
letter \x0937 12346 #davanagari ssha
letter \x0938 234 #davanagari sa
letter \x0939 125 #davanagari ha

letter \x093d 2 #davanagari avagrah

#--------
# matras

letter \x093E 345 #baraa aa ki matra
letter \x093F 24 #"chhoTi ii matra
letter \x0940 35 #"baRii ii matra
letter \x0941 136 #chhoTaa u matra
letter \x0942 1256 #"baRaa uu matra"
letter \x0943 5-1235 #"RRi matra"
letter \x0944 6-1235 #"lri matra"
letter \x0945 34 #"e matra"
letter \x0946 26 #"ai matra"
letter \x0947 15 #"e matra"
letter \x0948 34 #"ai matra"
letter \x0949 1346 #"o"
letter \x094A 135 #"au"
letter \x094B 135 #"o matra"
letter \x094C 246 #"au matra"

letter \x094D 4 # Halant
letter \x0950 135-4-134 #"Devnagari sign for om"
letter \x0958 13 #"Ka qith Nukhta"
letter \x0959 46 #"kha with nukhta"
letter \x095A 1245 #"ga with nukhta"
letter \x095B 245 #"ja with nukhta"
letter \x095C 12456 #"da with nukhta"
letter \x095D 5-12456 #"dhaa with nukhta"

replace \x093C 

always \x0921\x093C 12456 #"da with nukhta"
always \x0922\x093C 5-12456 #"dhaa with nukhta"


letter \x095E 235 #"fa with nukhta"
letter \x095F 13456 #"ya with nukhta"
letter \x0960 6-1235 #"vocalic rr"
letter \x0961 6-123 #"vocalic lla"
letter \x0962 5-123 #"vocalic la"
letter \x0963 6-123 #"vocalic ll"

# poorn Viram and double poorn Viraam
punctuation \x0964 256 # "Poorn Viraam"
punctuation \x0965 256-256 # "Double Poorn Viraam"
punctuation \x0970 256 # "abbreviation sign"


#--------
# digits

litdigit \x0966 245 # davanagari 0
litdigit \x0967 1 # davanagari 1
litdigit \x0968 12 # davanagari 2
litdigit \x0969 14 # davanagari 3
litdigit \x096A 145 # davanagari 4
litdigit \x096B 15 # davanagari 5
litdigit \x096C 124 # davanagari 6
litdigit \x096D 1245 # davanagari 7
litdigit \x096E 125 # davanagari 8
litdigit \x096F 24 # davanagari 9

# ksha and gya

always \x0915\x094D\x0937\x094D 4-12345 #"ksha"
always \x091C\x094D\x091E 156 #"gyan"
always \x0915\x094D\x0937  12345 #"ksha"


#--------
# half characters

always \x0915\x094D 4-13 # davanagari ka
always \x0916\x094D 4-46 # davanagari kha
always \x0917\x094D 4-1245 # davanagari ga
always \x0918\x094D 4-126 # davanagari gha
always \x0919\x094D 4-346 #davanagari aNgaa

always \x091A\x094D 4-14 # davanagari ca
always \x091B\x094D 4-16 # davanagari cha
always \x091C\x094D 4-245 # davanagari ja
always \x091D\x094D 4-356 # davanagari jha
always \x091E\x094D 4-25 #davanagari yangaa

always \x091F\x094d 4-23456 # davanagari ta
always \x0920\x094D 4-2456 # davanagari tha
always \x0921\x094D 4-1246 # davanagari da
always \x0922\x094D 4-123456 # davanagari dha
always \x0923\x094D 4-3456 #davanagari nna

always \x0924\x094D 4-2345 # davanagari ta
always \x0925\x094D 4-1456 # davanagari tha
always \x0926\x094D 4-145 # davanagari da
always \x0927\x094D 4-2346 # davanagari dha
always \x0928\x094D 4-1345 #davanagari na
always \x0929\x094D 4-56 #davanagari na nukta

always \x092A\x094D 4-1234 # davanagari pa
always \x092B\x094D 4-235 # davanagari tha
always \x092C\x094D 4-12 # davanagari ba
always \x092D\x094D 4-45 # davanagari bha
always \x092E\x094D 4-134 #davanagari ma

always \x092F\x094D 4-13456 # davanagari yaa
always \x0930\x094D 4-1235 # davanagari ra
always \x0931\x094D 4-12456 # davanagari rra
always \x0932\x094D 4-123 # davanagari la
always \x0933\x094D 4-456 #davanagari la
always \x0934\x094D 4-123 #davanagari la
always \x0935\x094D 4-1236 #davanagari va
always \x0936\x094D 4-146 #davanagari sha
always \x0937\x094D 4-12346 #davanagari ssha
always \x0938\x094D 4-234 #davanagari sa
always \x0939\x094D 4-125 #davanagari ha

always \x0958\x094D 4-13 #"Ka qith Nukhta"
always \x0959\x094D 4-46 #"kha with nukhta"
always \x095A\x094D 4-1245 #"ga with nukhta"
always \x095B\x094D 4-245 #"ja with nukhta"
always \x095C\x094D 4-12456 #"da with nukhta"
always \x095D\x094D 4-5-12456 #"dhaa with nukhta"

replace \x093C  

always \x0921\x093C\x094D 4-12456 #"da with nukhta"
always \x0922\x093C\x094D 4-5-12456 #"dhaa with nukhta"

always \x095E\x094D 4-235 #"fa with nukhta"
always \x095F\x094D 4-13456 #"ya with nukhta"
always \x0960\x094D 4-6-1235 #"vocalic rr"
always \x0961\x094D 4-6-123 #"vocalic lla"
always \x0962\x094D 4-5-123 #"vocalic la"
always \x0963\x094D 4-6-123 #"vocalic ll"

#------------
# consonent followed by vowel but not matra

attribute HindiVowel \x0907\x0908\x0909\x090A\x090D\x090E\x090F\x0910\x0911\x0912\x0913\x0914

attribute HALANT \x094D

before HindiVowel always \x0915 13-1 # davanagari ka
before HindiVowel always \x0916 46-1 # davanagari kha
before HindiVowel always \x0917 1245-1 # davanagari ga
before HindiVowel always \x0918 126-1 # davanagari gha

#before HALANT always \x0915 4-13 # davanagari ka

before HindiVowel always \x091A 14-1 # davanagari ca
before HindiVowel always \x091B 16-1 # davanagari cha
before HindiVowel always \x091C 245-1 # davanagari ja
before HindiVowel always \x091D 356-1 # davanagari jha

before HindiVowel always \x091F 23456-1 # davanagari ta
before HindiVowel always \x0920 2456-1 # davanagari tha
before HindiVowel always \x0921 1246-1 # davanagari da
before HindiVowel always \x0922 123456-1 # davanagari dha
before HindiVowel always \x0923 3456-1 #davanagari nna

before HindiVowel always \x0924 2345-1 # davanagari ta
before HindiVowel always \x0925 1456-1 # davanagari tha
before HindiVowel always \x0926 145-1 # davanagari da
before HindiVowel always \x0927 2346-1 # davanagari dha
before HindiVowel always \x0928 1345-1 #davanagari na

before HindiVowel always \x092A 1234-1 # davanagari pa
before HindiVowel always \x092B 235-1 # davanagari tha
before HindiVowel always \x092C 12-1 # davanagari ba
before HindiVowel always \x092D 45-1 # davanagari bha
before HindiVowel always \x092E 134-1 #davanagari ma

before HindiVowel always \x092F 13456-1 # davanagari yaa
before HindiVowel always \x0930 1235-1 # davanagari ra
before HindiVowel always \x0931 12456-1 # davanagari rra
before HindiVowel always \x0932 123-1 # davanagari la
before HindiVowel always \x0933 456-1 #davanagari la
before HindiVowel always \x0934 123-1 #davanagari la
before HindiVowel always \x0935 1236-1 #davanagari va
before HindiVowel always \x0936 146-1 #davanagari sha
before HindiVowel always \x0937 12346-1 #davanagari ssha
before HindiVowel always \x0938 234-1 #davanagari sa
before HindiVowel always \x0939 125-1 #davanagari ha

