# Vietnamese signs and punctuations
#
#-copyright: Sao Mai
#-license: LGPLv2.1
#
#  Copyright (C) 2018 by Sao Mai Center for the Blind <www.saomaicenter.org/en>
#
#  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/>.
#
# Created and maintained by: Dang Hoai Phuc, danghoaiphuc@gmail.com

display ! 2346
punctuation ! 235

display " 5
punctuation " 236
#prepunc " 236
#postpunc " 356

display ? 1456
punctuation ? 26
match %[^_~]%<* " %[_.$]*%[a#] 236
match %[a#]%[_.$]* " %>*%[^_~] 356

display # 3456
sign # 456-3456
display $ 1246
sign $ 4-234
display % 146
sign % 3456-245-356
math % 3456-245-356
display & 12346
sign & 4-12346
punctuation ' 3
display ( 12356
punctuation ( 4-126
display ) 23456
punctuation ) 4-345
display * 16
sign * 5-236
display + 346
math + 5-235
display , 6
punctuation , 2
punctuation - 36
math - 5-36
hyphen - 36
display . 46
punctuation . 256
#decpoint . 3
display / 34
sign / 34
math / 5-34
punctuation / 34

display : 156
punctuation : 25
display ; 56
punctuation ; 23
display < 126
math < 5-246
display = 123456
math = 5-2356
display > 345
punctuation > 5-135
display @ 47
sign @ 4

display [ 2467
punctuation [ 46-126
display \\ 12567
sign \\ 4-16
display ] 124567
punctuation ] 46-345
display ^ 457
sign ^ 4-26
display _ 456
sign _ 4-456
display ` 4
sign ` 4-4 grave accent

display } 12456
punctuation } 456-345
display | 1256
sign | 456-1256
display { 246
punctuation { 456-126
display ~ 45
math ~ 4-35

# special signs
#sign \x0300 45-16 ̀̀  grave accent
#noback correct [$l]"̀" "̀"*

#sign \x0301 45-34 ́  acute accent
#noback correct [$l]"́" "́"*

sign \x0302 45-146 ̂  circumflex
noback correct [$l]"̂" "̂"*

#sign \x0303 45-12456 ̃  tilde
#noback correct [$l]"̃" "̃"*
#noback pass2 @45-12456-6 @6-45-12456  move after capital sign

sign \x0304 45-4-36 ̄  macron
noback correct [$l]"̄" "̄"*

sign \x0306 4-346 ̆  breve
noback correct [$l]"̆" "̆"*

sign \x0308 45-25 ̈  diaeresis/umlat
noback correct [$l]"̈" "̈"*

sign \x030a 45-1246 ̊  ring/circle
noback correct [$l]"̊" "̊"*

sign \x030c 45-346 ̌  caron
noback correct [$l]"̌" "̌"*

sign \x0327 45-12346 ̧  cedilla
noback correct [$l]"̧" "̧"*


#   Unicode Greek
# conflict with à as transback
noback lowercase \x03b1 56-1 α Alpha
lowercase \x03b2 56-12 β Beta
lowercase \x03b3 56-1245 γ Gamma
lowercase \x03b4 56-145 δ Delta
# conflict with è as transback
noback lowercase \x03b5 56-15 ε Epsilon
lowercase \x03b6 56-1356 ζ Zeta
lowercase \x03b7 56-156 η Eta
# conflict with ồ as transback
noback lowercase \x03b8 56-1456 θ Theta
# conflict with ì as transback
noback lowercase \x03b9 56-24 ι Iota
lowercase \x03ba 56-13 κ Kappa
lowercase \x03bb 56-123 λ Lamda
lowercase \x03bc 56-134 μ Mu
lowercase \x03bd 56-1345 ν Nu
lowercase \x03be 56-1346 ξ Xi
# conflict with ò as transback
noback lowercase \x03bf 56-135 ο Omicron
lowercase \x03c0 56-1234 π Pi
lowercase \x03c1 56-1235 ρ Rho
lowercase \x03c3 56-234 σ Sigma
noback lowercase \x03c2 56-234 ς Small Letter Sigma
lowercase \x03c4 56-2345 τ Tau
# conflict with ù as transback
noback lowercase \x03c5 56-136 υ Upsilon
lowercase \x03c6 56-124 φ Phi
lowercase \x03c7 56-12346 χ Chi
# conflict with ỳ as transback
noback lowercase \x03c8 56-13456 ψ Psi
lowercase \x03c9 56-2456 ω Omega


#   Unicode Punctuation and Signs

punctuation \x0092 3
punctuation \x0097 36-36
punctuation \x0093 236
punctuation \x0094 356
punctuation \x0096 36
punctuation \x0097 36-36
sign \x00a1 45-56-235 ¡
punctuation \x00a1 235 ¡
sign \x00a2 4-14 ¢ cent
sign \x00a3 4-123 £ pound
#sign \x00a3 3456 £
sign \x00a4 1246 ¤ currency
sign \x00a5 4-13456 ¥ yen
sign \x00a6 46-1256 ¦ broken bar
punctuation \x00a6 456-1256 ¦ broken bar
sign \x00a7 45-234 § section
sign \x00a8 45-25 ¨
sign \x00a9 45-14 © copyright
#sign \x00aa ª
punctuation \x00ab 456-236 «
sign \x00ac 4-1456 ¬
punctuation \x00ad 36 - soft hyphen
sign \x00ae 45-1235 ® registered
sign \x00af 4-36 ¯
#sign \x00ba 0 º
sign \x00b4 45-56-12 ´ acute accent
sign \x00b6 45-1234 ¶ pilcrow 
sign \x00b8 45-12346 ¸ cedilla 
punctuation \x00bb 456-356 »
punctuation \x00bf 45-56-236 ¿
uppercase \x00c6 1-6-45-235-15 Æ capital ligature ae (ash)
lowercase \x00e6 1-45-235-15 æ lowercase ligature ae (ash)
uppercase \x0152 135-6-45-235-15 Œ capital ligature oe
lowercase \x0153 135-45-235-15 œ ligature oe

lowercase \x014b 45-1345 ŋ
lowercase \x0259 456-26 ə

sign \x02d8 4-346 ˘ uncombining breve
sign \x02e6 45-46-14 ˦ high tone
sign \x02e7 45-46-25 ˧ mid tone
sign \x02e8 45-46-36 ˨ low tone

space \x2000 0
space \x2001 0
space \x2002 0
space \x2003 0
space \x2004 0
space \x2005 0
space \x2006 0
space \x2007 0
space \x2008 0
space \x2009 0
space \x200a 0
space \x200b 0
punctuation \x2010 36 ‐
punctuation \x2011 36 ‑
punctuation \x2013 6-36 –
punctuation \x2014 5-6-36 —
punctuation \x2015 5-6-36 ―
noback punctuation \x2018 6-236 ‘
noback punctuation \x2019 6-356 ’
punctuation \x201c 236 “
punctuation \x201d 356 ”
sign \x2020 4-6-1456 † dagger
sign \x2021 4-6-12456 ‡ double dagger
sign \x2022 456-256 • bullet
# same as bullet sign
sign \xf0b7 456-256
sign \x25e6 456-356
sign \xf0a7 456-2356
punctuation \x2026 256-256-256 … ellipse
sign \x20a3 4-124 ₣ franc
sign \x20a6 4-1345 ₦ naira
sign \x20ac 4-15 € euro

sign \x2122 45-2345 ™
sign \x2190 56-1256-246 ←
sign \x2191 56-1256-346 ↑
sign \x2192 56-1256-135 →
sign \x2193 56-1256-146 ↓
sign \x21b5 56-1256-256-146 ↵
sign \x21cc 45-456-2356 ⇌ equilibrium arrow (harpoons)

sign \x25aa 456-256 ▪ 

sign \x2640 45-1346 ♀
sign \x2642 45-13456 ♂
sign \x266D 3456-126 ♭
sign \x266E 3456-16 ♮
sign \x266F 3456-146 ♯

sign \x3003 5-2 〃 ditto mark


#   Unicode Math

sign \x00b0 45-245 °
math \x00b1 456-235 ±
#  grade 1 indicator add before superscipts
math \x00b2 56-35-3456-12 ²
math \x00b3 56-35-3456-14 ³
sign \x00b4 45-34 ´
sign \x00b5 46-134 µ
math \x00b7 4-16 ·
math \x00bc 3456-1-34-145 ¼
math \x00bd 3456-1-34-12 ½
math \x00be 3456-14-34-145 ¾
math \x00d7 5-236 ×
math \x00f7 5-34 ÷

#math \x2070 35-3456-245 ⁰

math \x2150 3456-1-34-1245 ⅐
math \x2151 3456-1-34-24 ⅑
math \x2152 3456-1-34-1-245 ⅒
math \x2153 3456-1-34-14 ⅓
math \x2154 3456-12-34-14 ⅔
math \x2155 3456-1-34-15 ⅕
math \x2156 3456-12-34-15 ⅖
math \x2157 3456-14-34-15 ⅗
math \x2158 3456-145-34-15 ⅘
math \x2159 3456-1-34-124 ⅙
math \x215a 3456-15-34-124 ⅚
math \x215b 3456-1-34-125 ⅛
math \x215c 3456-14-34-125 ⅜
math \x215d 3456-15-34-125 ⅝
math \x215e 3456-1245-34-125 ⅞

sign \x2032 2356 ′ prime (derivative)
sign \x2033 2356-2356 ″ double prime (second derivative)

sign \x2200 45-1 ∀ for all
sign \x2202 4-145 ∂ partial derivative
sign \x2203 45-26 ∃ there exists
sign \x2205 4-245 ∅ empty set
sign \x2207 45-145 ∇ nabla
sign \x2208 45-15 ∈ element of
sign \x220b 4-45-15 ∋ contains (such that)
sign \x2212 5-36 − minus sign (not hyphen)
sign \x2213 456-36 ∓ minus or plus
sign \x2218 5-356 ∘ hollow dot (ring operator)
sign \x221a 5-146 √ square root
sign \x221d 456-5-2356 ∝ proportional to
sign \x221e 3456-123456 ∞ infinity
sign \x2220 456-246 ∠ angle
sign \x2221 46-456-246 ∡ measured angle
sign \x2225 3456-123 ∥ parallel to
sign \x2227 4-236 ∧ logical and
sign \x2228 4-235 ∨ logical or
sign \x2229 46-236 ∩ set intersection
sign \x222a 46-235 ∪ set union
# not transback, conflict with đ
noback sign \x222b 2346 ∫ integral
sign \x222e 4-2346 contour integral
noback sign \x2234 6-16 ∴ therefore # using noback to avoid conflict with Child
sign \x2235 4-34 ∵ because
noback sign \x2236 25 ∶ ratio # using noback to avoid conflict with :
sign \x2237 25-25 ∷ proportion
sign \x2243 456-35 ≃ asymptotically equal to
sign \x2245 5-456-35 ≅ approximately equal to
sign \x2248 45-35 ≈ almost equal to
sign \x224f 45-5-2356 ≏ difference between
sign \x2251 46-5-2356 ≑ geometrically equal
sign \x2260 5-2356-4-156 ≠ not equal
sign \x2261 456-123456 ≡ identical (equivalent) to
sign \x2264 456-4-126 ≤ less than or equal to
sign \x2265 456-4-345 ≥ greater than or equal to
sign \x226a 46-4-126 ≪ much less than
sign \x226b 46-4-345 ≫ much greater than
sign \x2282 45-126 ⊂ subset of
sign \x2283 45-345 ⊃ superset of
sign \x2286 456-45-126 ⊆ subset or equal to
sign \x2287 456-45-345 ⊇ superset or equal to
sign \x228a 46-45-126 ⊊ proper subset
sign \x228b 46-45-345 ⊋ proper superset
sign \x22a3 4-456-25 ⊣ left tack
sign \x22a5 3456-36 ⊥ up tack
sign \x22a6 456-25 ⊦ assertion
sign \x22a8 45-456-25 ⊨ valid
sign \x22b2 4-456-126 ⊲ normal subgroup
sign \x22b3 4-456-345 ⊳ contains as normal subgroup 
sign \x22b4 456-456-126 ⊴ normal subgroup or equal
sign \x22b5 456-456-345 ⊵ contains as normal subgroup or equal
sign \x22be 3456-456-246 ⊾ right angle with arc
sign \x22c5 5-256 ⋅ dot operator
sign \x2ae4 46-456-25 ⫤ reverse 'is valid' sign

math \x2329 4-126 〈
math \x232A 4-345 〉

math \x3008 4-126 〈
math \x3009 4-345 〉


#   Unicode misc

punctuation \x0093 236
punctuation \x0094 356
punctuation \x0096 36

# Diagonal and Vertical lines
noback sign \x2502 456 │ tally mark - vertical single solid line segment
noback sign \x250a 45 ┊ first variant vertical line segment
noback sign \x2551 6-456 ║ second variant vertical line segment
noback sign \x2571 345 ╱ right-leaning single solid diagonal line segment # using noback to avoid conflict with "ar" contraction
noback sign \x2572 126 ╲ left-leaning single solid diagonal line segment # using noback to avoid conflict with "gh" contraction

# Shape Symbols
sign \x25a0 456-1246-3456-145 ■ filled (solid) square
sign \x25a1 1246-3456-145 □ square
sign \x25a7 46-1246-3456-145 ▧ shaded square (upper left to lower right)
sign \x25b2 456-1246-3456-14 ▲ filled (solid) (equilateral) triangle
sign \x25b3 1246-3456-14 △ regular (equilateral) triangle
sign \x25cb 1246-123456 ○ circle
sign \x25cd 46-1246-123456 ◍ shaded circle
sign \x29b5 46-245 ⦵ 'normal' (superscript circle crossed by horizontal line)
noback sign \x25cf 5-35 ● black circle # not representing filled circle shape as it is mostly used in password fields to represent hidden characters

# Uppercase letters
base uppercase \x0391 \x03b1 Αα Alpha
base uppercase \x0392 \x03b2 Ββ Beta
base uppercase \x0393 \x03b3 Γγ Gamma
base uppercase \x0394 \x03b4 Δδ Delta
base uppercase \x0395 \x03b5 Εε Epsilon
base uppercase \x0396 \x03b6 Ζζ Zeta
base uppercase \x0397 \x03b7 Ηη Eta
base uppercase \x0398 \x03b8 Θθ Theta
base uppercase \x0399 \x03b9 Ιι Iota
base uppercase \x039a \x03ba Κκ Kappa
base uppercase \x039b \x03bb Λλ Lamda
base uppercase \x039c \x03bc Μμ Mu
base uppercase \x039d \x03bd Νν Nu
base uppercase \x039e \x03be Ξξ Xi
base uppercase \x039f \x03bf Οο Omicron
base uppercase \x03a0 \x03c0 Ππ Pi
base uppercase \x03a1 \x03c1 Ρρ Rho
base uppercase \x03a3 \x03c3 Σσ Sigma
base uppercase \x03a4 \x03c4 Ττ Tau
base uppercase \x03a5 \x03c5 Υυ Upsilon
base uppercase \x03a6 \x03c6 Φφ Phi
base uppercase \x03a7 \x03c7 Χχ Chi
base uppercase \x03a8 \x03c8 Ψψ Psi
base uppercase \x03a9 \x03c9 Ωω Omega
base uppercase \x014a \x014b Ŋŋ
base uppercase \x018f \x0259 Əə

#   Unicode prefers \x2019 for apostrophe instead of \x27
endword \x2019d 3-145
endword \x2019m 3-134
endword \x2019re 3-1235-15
endword \x2019ve 3-1236-15
endword \x2019ll 3-123-123
endword \x2019s 3-234
endword s\x2019 234-3
endword \x2019t 3-2345

# processing numeric space indicators, borrowed from UEB-g1
include en-ueb-math.ctb UEB math from common linear format

numsign 3456  number sign, just a dots operand
numericmodechars .,
nocontractsign 6
nonumsign 6
numericnocontchars abcdefghij

#   add numeric space indicator
noback context _$d["\s"]$d @5

#   remove numeric space indicator
noback correct _$d["\""]$d "\s"

#   remove numeric indicator from numeric space indicator
noback pass2 @245-5-3456-245 @245-5-245       0 0
noback pass2 @245-5-3456-1 @245-5-1           0 1
noback pass2 @245-5-3456-12 @245-5-12         0 2
noback pass2 @245-5-3456-14 @245-5-14         0 3
noback pass2 @245-5-3456-145 @245-5-145       0 4
noback pass2 @245-5-3456-15 @245-5-15         0 5
noback pass2 @245-5-3456-145 @245-5-124       0 6
noback pass2 @245-5-3456-1245 @245-5-1245     0 7
noback pass2 @245-5-3456-125 @245-5-125       0 8
noback pass2 @245-5-3456-24 @245-5-24         0 9
noback pass2 @1-5-3456-245 @1-5-245           1 0
noback pass2 @1-5-3456-1 @1-5-1               1 1
noback pass2 @1-5-3456-12 @1-5-12             1 2
noback pass2 @1-5-3456-14 @1-5-14             1 3
noback pass2 @1-5-3456-145 @1-5-145           1 4
noback pass2 @1-5-3456-15 @1-5-15             1 5
noback pass2 @1-5-3456-145 @1-5-124           1 6
noback pass2 @1-5-3456-1245 @1-5-1245         1 7
noback pass2 @1-5-3456-125 @1-5-125           1 8
noback pass2 @1-5-3456-24 @1-5-24             1 9
noback pass2 @12-5-3456-245 @12-5-245         2 0
noback pass2 @12-5-3456-1 @12-5-1             2 1
noback pass2 @12-5-3456-12 @12-5-12           2 2
noback pass2 @12-5-3456-14 @12-5-14           2 3
noback pass2 @12-5-3456-145 @12-5-145         2 4
noback pass2 @12-5-3456-15 @12-5-15           2 5
noback pass2 @12-5-3456-145 @12-5-124         2 6
noback pass2 @12-5-3456-1245 @12-5-1245       2 7
noback pass2 @12-5-3456-125 @12-5-125         2 8
noback pass2 @12-5-3456-24 @12-5-24           2 9
noback pass2 @14-5-3456-245 @14-5-245         3 0
noback pass2 @14-5-3456-1 @14-5-1             3 1
noback pass2 @14-5-3456-12 @14-5-12           3 2
noback pass2 @14-5-3456-14 @14-5-14           3 3
noback pass2 @14-5-3456-145 @14-5-145         3 4
noback pass2 @14-5-3456-15 @14-5-15           3 5
noback pass2 @14-5-3456-145 @14-5-124         3 6
noback pass2 @14-5-3456-1245 @14-5-1245       3 7
noback pass2 @14-5-3456-125 @14-5-125         3 8
noback pass2 @14-5-3456-24 @14-5-24           3 9
noback pass2 @145-5-3456-245 @145-5-245       4 0
noback pass2 @145-5-3456-1 @145-5-1           4 1
noback pass2 @145-5-3456-12 @145-5-12         4 2
noback pass2 @145-5-3456-14 @145-5-14         4 3
noback pass2 @145-5-3456-145 @145-5-145       4 4
noback pass2 @145-5-3456-15 @145-5-15         4 5
noback pass2 @145-5-3456-145 @145-5-124       4 6
noback pass2 @145-5-3456-1245 @145-5-1245     4 7
noback pass2 @145-5-3456-125 @145-5-125       4 8
noback pass2 @145-5-3456-24 @145-5-24         4 9
noback pass2 @15-5-3456-245 @15-5-245         5 0
noback pass2 @15-5-3456-1 @15-5-1             5 1
noback pass2 @15-5-3456-12 @15-5-12           5 2
noback pass2 @15-5-3456-14 @15-5-14           5 3
noback pass2 @15-5-3456-145 @15-5-145         5 4
noback pass2 @15-5-3456-15 @15-5-15           5 5
noback pass2 @15-5-3456-145 @15-5-124         5 6
noback pass2 @15-5-3456-1245 @15-5-1245       5 7
noback pass2 @15-5-3456-125 @15-5-125         5 8
noback pass2 @15-5-3456-24 @15-5-24           5 9
noback pass2 @124-5-3456-245 @124-5-245       6 0
noback pass2 @124-5-3456-1 @124-5-1           6 1
noback pass2 @124-5-3456-12 @124-5-12         6 2
noback pass2 @124-5-3456-14 @124-5-14         6 3
noback pass2 @124-5-3456-145 @124-5-145       6 4
noback pass2 @124-5-3456-15 @124-5-15         6 5
noback pass2 @124-5-3456-145 @124-5-124       6 6
noback pass2 @124-5-3456-1245 @124-5-1245     6 7
noback pass2 @124-5-3456-125 @124-5-125       6 8
noback pass2 @124-5-3456-24 @124-5-24         6 9
noback pass2 @1245-5-3456-245 @1245-5-245     7 0
noback pass2 @1245-5-3456-1 @1245-5-1         7 1
noback pass2 @1245-5-3456-12 @1245-5-12       7 2
noback pass2 @1245-5-3456-14 @1245-5-14       7 3
noback pass2 @1245-5-3456-145 @1245-5-145     7 4
noback pass2 @1245-5-3456-15 @1245-5-15       7 5
noback pass2 @1245-5-3456-145 @1245-5-124     7 6
noback pass2 @1245-5-3456-1245 @1245-5-1245   7 7
noback pass2 @1245-5-3456-125 @1245-5-125     7 8
noback pass2 @1245-5-3456-24 @1245-5-24       7 9
noback pass2 @125-5-3456-245 @125-5-245       8 0
noback pass2 @125-5-3456-1 @125-5-1           8 1
noback pass2 @125-5-3456-12 @125-5-12         8 2
noback pass2 @125-5-3456-14 @125-5-14         8 3
noback pass2 @125-5-3456-145 @125-5-145       8 4
noback pass2 @125-5-3456-15 @125-5-15         8 5
noback pass2 @125-5-3456-145 @125-5-124       8 6
noback pass2 @125-5-3456-1245 @125-5-1245     8 7
noback pass2 @125-5-3456-125 @125-5-125       8 8
noback pass2 @125-5-3456-24 @125-5-24         8 9
noback pass2 @24-5-3456-245 @24-5-245         9 0
noback pass2 @24-5-3456-1 @24-5-1             9 1
noback pass2 @24-5-3456-12 @24-5-12           9 2
noback pass2 @24-5-3456-14 @24-5-14           9 3
noback pass2 @24-5-3456-145 @24-5-145         9 4
noback pass2 @24-5-3456-15 @24-5-15           9 5
noback pass2 @24-5-3456-145 @24-5-124         9 6
noback pass2 @24-5-3456-1245 @24-5-1245       9 7
noback pass2 @24-5-3456-125 @24-5-125         9 8
noback pass2 @24-5-3456-24 @24-5-24           9 9
