# 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 3 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

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

class 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

