#  Urdu 6 Dot Grade 1 Braille Table
#  Copyright (C) 2016 by Jake Kyle
#
#  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/>.
#
#  Prepared by Jake Kyle, Compass Braille, UK in consultation with Buta Masih
#  Contact: jake@compassbraille.org
#  www.compassbraille.org
#  Last updated 21st November 2016

# NB. If including an English table the letter sign must be disabled.

include braille-patterns.cti

replace \x200E               # left to right mark
replace \x200F               # right to left mark
replace \x0614               # Arabic Takhallus Sign - optional sign over proper names not used in Braille
replace \x200C               # Zero width non-joiner

punctuation \x00AB 236      # Left-pointing double angle quotation mark («)
punctuation \x00BB 356      # Right-pointing double angle quotation mark (»)

# Standard Arabic characters
#                               Name                     ASCII           Notes
punctuation \x060C 2            Arabic comma             1
punctuation \x061B 23           Arabic semicolon         2
punctuation \x061F 236          Arabic question mark     8
letter \x0621 3                 Hamza                    '
letter \x0622 345               Alef with Madda above    >
letter \x0623 34                Alef with Hamza above    /
letter \x0624 1256              Waw with Hamza above     (backslash)
letter \x0626 3                 Yeh with Hamza above     '               Different from arabic table
letter \x0627 1                 Alef                     A
letter \x0628 12                Beh                      B
letter \x062A 2345              Teh                      T
letter \x062B 1456              Theh                     ?
letter \x062C 245               Jeem                     J
letter \x062D 156               Hah                      :
letter \x062E 1346              Khah                     X
letter \x062F 145               Dal                      D
letter \x0630 2346              Thal                     !
letter \x0631 1235              Reh                      R
letter \x0632 1356              Zain                     Z
letter \x0633 234               Seen                     S
letter \x0634 146               Sheen                    %
letter \x0635 12346             Sad                      &
letter \x0636 1246              Dad                      $
letter \x0637 23456             Tah                      )
letter \x0638 123456            Zah                      =
letter \x0639 12356             Ain                      (
letter \x063A 126               Ghain                    <
letter \x0641 124               Feh                      F
letter \x0642 12345             Qaf                      Q
letter \x0643 13                Kaf                      K
letter \x0644 123               Lam                      L
letter \x0645 134               Meem                     M
letter \x0646 1345              Noon                     N
letter \x0647 125               Heh                      H
letter \x0648 2456              Waw                      W
letter \x064A 24                Yeh                      I
letter \x064B 23                Fathatan                 2
letter \x064E 2                 Fatha                    1
letter \x064F 136               Damma                    U
letter \x0650 15                Kasra                    E
letter \x0651 6                 Shadda                   ,

# Additional letters not defined in the standard arabic table.
letter \x0654 3                 Hamza above              '
letter \x0670 23                Superscript Alef         2                                        
letter \x0679 246               Tteh                     [                                        
letter \x067E 1234              Peh                      P                                        
letter \x0686 14                Tcheh                    C                                        
letter \x0688 346               Ddal                     +                                       
letter \x0691 12456             Rreh                     ]                                        
letter \x0698 346               Jeh                      +
letter \x06A9 13                Keheh                    K                                        
letter \x06AF 1245              Gaf                      G                                        
letter \x06BA 56                Noon Ghunna              ;                                        
letter \x06BE 236               Heh Doachashmee          8                                        
letter \x06C1 125               Heh Goal                 H                Not 236 as in Duxbury
letter \x06C3 2345              Teh Marbuta Goal         T                Not 16 as in Duxbury
letter \x06CC 24                Yeh                      I                                        
letter \x06D2 34                Yeh Barree               /                                         
punctuation \x06D4 256          Arabic fullstop          4                                        


#-----------------------------
# Numerals
#-----------------------------

# Arabic numerals
digit \x0660 345                0
digit \x0661 1                  1
digit \x0662 12                 2
digit \x0663 14                 3
digit \x0664 145                4
digit \x0665 15                 5
digit \x0666 124                6
digit \x0667 1245               7
digit \x0668 125                8
digit \x0669 24                 9

# Extended Arabic Numerals
digit \x06F0 345                0
digit \x06F1 1                  1
digit \x06F2 12                 2
digit \x06F3 14                 3
digit \x06F4 145                4
digit \x06F5 15                 5
digit \x06F6 124                6
digit \x06F7 1245               7
digit \x06F8 125                8
digit \x06F9 24                 9


#-------------------------------------------------------------------------------------------------------
# Dealing with aspirated digraphs followed by Fatha (1), Kasra (E) or Damma (U).
# In the text file these vowel signs come before Heh Doachashmee whereas in Braille they must come after.  
#-------------------------------------------------------------------------------------------------------

#                                              ASCII as in text    ASCII in Braille
always \x0628\x064F\x06BE 12-236-136           BU8                 B8U
always \x067E\x0650\x06BE 1234-236-15          PE8                 P8E
always \x067E\x064E\x06BE 1234-236-2           P18                 P81
always \x062A\x0650\x06BE 2345-236-15          TE8                 T8E
always \x0679\x0650\x06BE 246-236-15           [E8                 [8E
always \x0686\x064F\x06BE 14-236-136           CU8                 C8U
always \x06A9\x064F\x06BE 13-236-136           KU8                 K8U


#-------------------------------------------------------------------------------------------
# Shadda (\x0651) goes after consonant in text file but must go before it in Braille
#-------------------------------------------------------------------------------------------

#                                                ASCII as in text ASCII in Braille     Notes
always \x0648\x0651 6-2456                       W,               ,W
always \x0642\x0651 6-12345                      Q,               ,Q
always \x0635\x0651 6-12346                      &,               ,&
always \x0646\x0651 6-1345                       N,               ,N
always \x0646\x0651\x062C 1345-6-245             N,J              N,J                  No change in this case
always \x0632\x0651 6-1356                       Z,               ,Z
always \x0631\x0651 6-1235                       R,               ,R
always \x06CC\x0651 6-24                         I,               ,I
always \x062C\x064F\x0651 6-245-136              JU,              ,JU
always \x06A9\x06BE\x0651 6-13-236               K8,              ,K8
always \x062F\x0651 6-145                        D,               ,D
always \x0686\x0651 6-14                         C,               ,C
always \x0686\x06BE\x0651 6-14-236               C8,              ,C8
always \x062C\x0651 6-245                        J,               ,J
always \x0628\x0651 6-12                         B,               ,B
always \x0645\x0651 6-134                        M,               ,M
always \x062A\x0651 6-2345                       T,               ,T
always \x0644\x0651 6-123                        L,               ,L
always \x067E\x0651 6-1234                       P,               ,P
always \x0633\x0651 6-234                        S,               ,S
always  \x0679\x0651 6-246                       [,               ,[
always \x0638\x0651 6-123456                     =,               ,=
always \x0688\x0651 6-346                        +,               ,+


#Hamza above after Waw in text should go before it in Braille
always \x0648\x0654 3-2456                       W'               'W
