# 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 # devanagari chandra bindu 
letter \x0902 56 # devanagari anuswar 
letter \x0903 6 # devanagari 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 # devanagari ka
letter \x0916 46 # devanagari kha
letter \x0917 1245 # devanagari ga
letter \x0918 126 # devanagari gha
letter \x0919 346 #devanagari aNgaa

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

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

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

letter \x0929 56 #devanagari na nukta

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

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

letter \x093d 2 #devanagari 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 #"devanagari 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 # devanagari 0
litdigit \x0967 1 # devanagari 1
litdigit \x0968 12 # devanagari 2
litdigit \x0969 14 # devanagari 3
litdigit \x096A 145 # devanagari 4
litdigit \x096B 15 # devanagari 5
litdigit \x096C 124 # devanagari 6
litdigit \x096D 1245 # devanagari 7
litdigit \x096E 125 # devanagari 8
litdigit \x096F 24 # devanagari 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 # devanagari ka
always \x0916\x094D 4-46 # devanagari kha
always \x0917\x094D 4-1245 # devanagari ga
always \x0918\x094D 4-126 # devanagari gha
always \x0919\x094D 4-346 #devanagari aNgaa

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

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

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

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

always \x092F\x094D 4-13456 # devanagari yaa
always \x0930\x094D 4-1235 # devanagari ra
always \x0931\x094D 4-12456 # devanagari rra
always \x0932\x094D 4-123 # devanagari la
always \x0933\x094D 4-456 #devanagari la
always \x0934\x094D 4-123 #devanagari la
always \x0935\x094D 4-1236 #devanagari va
always \x0936\x094D 4-146 #devanagari sha
always \x0937\x094D 4-12346 #devanagari ssha
always \x0938\x094D 4-234 #devanagari sa
always \x0939\x094D 4-125 #devanagari 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 # devanagari ka
before HindiVowel always \x0916 46-1 # devanagari kha
before HindiVowel always \x0917 1245-1 # devanagari ga
before HindiVowel always \x0918 126-1 # devanagari gha

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

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

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

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

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

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

