# liblouis: U.K. English Grade 1 table
#
# ------------
#-name: British English grade 1
#-index-name: English, U.K., uncontracted
#-display-name: English uncontracted braille as used in the U.K.
#
#+language:en
#+region:en-GB
#+type:literary
#+contraction:no
#+grade:1
#+system:bauk
# Marked as "direction:forward" by Bue Vester-Andersen
# as tests only run forward.
#+direction:forward
#
# TODO: Please correct the metadata above. It is not meant to be
# accurate nor complete. It hasn't been verified by the table
# author yet. It is merely an attempt by the liblouis maintainers
# to get some sensible initial values in place.
#
# TODO: Please add a reference to official documentation about
# the implemented braille code. Preferably submit the documents
# to https://github.com/liblouis/braille-specs.
# ------------
#
# Based on the braille contraction modules in BRLTTY
#
# Copyright (C) 1995-2004 by The BRLTTY Team.
# Copyright (C) 2004 ViewPlus Technologies, Inc., www.viewplustech.com
# Copyright (C) 2004 Computers to Help People, Inc., www.chpi.org

# This file 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.

# This file 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 this file; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
# liblouis  comes with ABSOLUTELY NO WARRANTY.

# Maintained by Paul Wood, Torch Trust: paulw torchtrust.org

include text_nabcc.dis All display opcodes

include ukchardefs.cti All character definition opcodes


# accented letters

lowercase \x00E0 1				# a with grave
lowercase \x00E1 1				# a with acute
lowercase \x00E2 1				# a with circumflex
lowercase \x00E3 1				# a with tilde
lowercase \x00E4 1				# a with dieresis
lowercase \x00E5 1				# a with ring above
lowercase \x00E6 1				# letter ae
lowercase \x00E7 14				# c with cedilla
lowercase \x00E8 15				# e with grave
lowercase \x00E9 15				# e with acute
lowercase \x00EA 15				# e with circumflex
lowercase \x00EB 15				# e with dieresis
lowercase \x00EC 24				# i with grave above
lowercase \x00ED 24				# i with acute above
lowercase \x00EE 24				# i with circumflex
lowercase \x00EF 24				# i with dieresis
lowercase \x00F0 15				# letter eth
lowercase \x00F1 1345			# n with tilde
lowercase \x00F2 135			# o with grave above
lowercase \x00F3 135			# o with acute above
lowercase \x00F4 135			# o with circumflex
lowercase \x00F5 135			# o with tilde
lowercase \x00F6 135			# o with dieresis

# \x00D7	× multiplication sign	----------------------

lowercase \x00F8 135			# o with stroke
lowercase \x00F9 136			# u with grave above
lowercase \x00FA 136			# u with acute above
lowercase \x00FB 136			# u with circumflex above
lowercase \x00FC 136				# u with dieeresis
lowercase \x00FD 13456		# y with acute above
lowercase \x00FE 2345			# letter thorn
letter \x00DF 2346		# small sharp s
lowercase \x0175 2456 w with circumflex
lowercase \x0177 13456 # y with circumflex
lowercase \x00ff 13456 # y with diaeresis
lowercase \x1EF3 13456 # y with grave

largesign \x00C0 4-1      [C0] upper a grave
largesign \x00E0   4-1      [E0] lower a grave

largesign \x00C1 4-1      [C1] upper a acute
largesign \x00E1   4-1      [E1] lower a acute

largesign \x00C2 4-1      [C2] upper a circumflex
largesign \x00E2   4-1      [E2] lower a circumflex

largesign \x00C3 4-1      [C3] upper a tilde
largesign \x00E3   4-1      [E3] lower a tilde

largesign \x00C4 4-1      [C4] upper a dieresis
largesign \x00E4   4-1      [E4] lower a dieresis

largesign \x00C5 4-1      [C5] upper a ring
largesign \x00E5   4-1      [E5] lower a ring

largesign \x00C6 1-15     [C6] upper ae
largesign \x00E6   1-15			[E6] lower ae

largesign \x00C7 4-14     [C7] upper c cedilla
largesign \x00E7   4-14     [E7] lower c cedilla

largesign \x00C8 4-15     [C8] upper e grave
largesign \x00E8   4-15     [E8] lower e grave

largesign \x00C9 4-15     [C9] upper e acute
largesign \x00E9   4-15     [E9] lower e acute

largesign \x00CA 4-15     [CA] upper e circumflex
largesign \x00EA   4-15     [EA] lower e circumflex

largesign \x00CB 4-15     [CB] upper e dieresis
largesign \x00EB   4-15     [EB] lower e dieresis

largesign \x00CC 4-24     [CC] upper i grave
largesign \x00EC   4-24     [EC] lower i grave

largesign \x00CD 4-24     [CD] upper i acute
largesign \x00ED   4-24     [ED] lower i acute

largesign \x00CE 4-24     [CE] upper i circumflex
largesign \x00EE   4-24     [EE] lower i circumflex

largesign \x00CF 4-24     [CF] upper i dieresis
largesign \x00EF   4-24     [EF] lower i dieresis

largesign \x00D0 4-15     [D0] upper eth
largesign \x00F0   4-15     [F0] lower eth

largesign \x00D1 4-1345   [D1] upper n tilde
largesign \x00F1   4-1345   [F1] lower n tilde

largesign \x00D2 4-135    [D2] upper o grave
largesign \x00F2   4-135    [F2] lower o grave

largesign \x00D3 4-135    [D3] upper o acute
largesign \x00F3   4-135    [F3] lower o acute

largesign \x00D4 4-135    [D4] upper o circumflex
largesign \x00F4   4-135    [F4] lower o circumflex

largesign \x00D5 4-135    [D5] upper o tilde
largesign \x00F5   4-135    [F5] lower o tilde

largesign \x00D6 4-135    [D6] upper o dieresis
largesign \x00F6   4-135			[F6] lower o dieresis

largesign \x00D8 4-135    [D8] upper o slash
largesign \x00f8   4-135    [F8] lower o slash

largesign \x00D9 4-136    [D9] upper u grave
largesign \x00F9   4-136    [F9] lower u grave

largesign \x00DA 4-136    [DA] upper u acute
largesign \x00FA   4-136    [FA] lower u acute

largesign \x00DB 4-136    [DB] upper u circumflex
largesign \x00FB   4-136    [FB] lower u circumflex

largesign \x00DC 4-136    [DC] upper u dieresis
largesign \x00FC   4-136    [FC] lower u dieresis

largesign \x00DD 4-13456  [DD] upper y acute
largesign \x00FD   4-13456  [FD] lower y acute

largesign \x00DE 4-2345   [DE] upper t horn
largesign \x00FE   4-2345   [FE] lower t horn

largesign \x00DF 234-234 (DF) lower ss


largesign \x0174 4-2456 lower w circumflex
largesign \x0175 4-2456 upper w circumflex

largesign \x0176 4-13456 upper y circumflex
largesign \x0177 4-13456 lower y circumflex

largesign \x0178 4-13456 upper y with dieresis
largesign \x00FF 4-13456 lower y with dieresis

largesign \x1EF2 4-13456 upper y with grave
largesign \x1EF3 4-13456 lower y with grave

hyphen 	\x2010 36		 # 8208			hyphen

# punctuation \x2011 36		 # 8209			non-breaking hyphen
punctuation \x2011 23478	# 8209  non-breaking hyphen

punctuation \x2212 36
noback always \x2212 36
always \s\x2212\s 36-36
midnum \x2013 36-3456
always	\x2013 56-36		 # 8211		smart minus sign


noback always	\x201C 236	 # 8220			smart opening double quote
noback always	\x201D 356	 # 8221			smart closing double quote
noback always	\x201E 236	 # 8222			smart double low quotation mark
noback always	\x201F 356	 # 8223			smart double high reverse quotation mark

# Uppercase letters
base uppercase \x00C0 \x00E0		# a with grave
base uppercase \x00C1 \x00E1		# a with acute
base uppercase \x00C2 \x00E2		# a with circumflex
base uppercase \x00C3 \x00E3		# a with tilde
base uppercase \x00C4 \x00E4		# a with dieresis
base uppercase \x00C5 \x00E5		# a with ring above
base uppercase \x00C6 \x00E6		# letter ae
base uppercase \x00C7 \x00E7		# c with cedilla
base uppercase \x00C8 \x00E8		# e with grave
base uppercase \x00C9 \x00E9		# e with acute
base uppercase \x00CA \x00EA		# e with circumflex
base uppercase \x00CB \x00EB		# e with dieresis
base uppercase \x00CC \x00EC		# i with grave above
base uppercase \x00CD \x00ED		# i with acute above
base uppercase \x00CE \x00EE		# i with circumflex
base uppercase \x00CF \x00EF		# i with dieresis
base uppercase \x00D0 \x00F0		# letter eth
base uppercase \x00D1 \x00F1		# n with tilde
base uppercase \x00D2 \x00F2		# o with grave above
base uppercase \x00D3 \x00F3		# o with acute above
base uppercase \x00D4 \x00F4		# o with circumflex
base uppercase \x00D5 \x00F5		# o with tilde
base uppercase \x00D6 \x00F6		# o with dieresis
base uppercase \x00D8 \x00F8		# o with stroke
base uppercase \x00D9 \x00F9		# u with grave above
base uppercase \x00DA \x00FA		# u with acute above
base uppercase \x00DB \x00FB		# u with circumflex above
base uppercase \x00DC \x00FC		# u with dieeresis
base uppercase \x00DD \x00FD		# y with acute above
base uppercase \x00DE \x00FE		# letter thorn
base uppercase \x0174 \x0175		# w with circumflex
base uppercase \x0176 \x0177		# y with circumflex
base uppercase \x0178 \x00ff		# y with diaeresis
base uppercase \x1EF2 \x1EF3		# y with grave

# Braille indicators
numsign 3456  number sign, just a dots operand
multind 56-6 letsign capsletter
letsign 56
capsletter 6
begcapsword 6-6
endcapsword 6-3
emphclass italic
emphclass underline
emphclass bold
begemph italic 46
endemph italic 46-3
begemph bold 46-46
endemph bold 46-3
begcomp 6-346
endcomp 6-346

# the decimal digits
include litdigits6Dots.uti

# Letters are defined in en-chardefs

#single letter words
largesign a 1
largesign A 1
word I 24
word O 135
word o 135

# abbreviations
contraction ie
word i.e. 24-256-15-256
contraction ok
word o.k. 135-256-13-256
contraction eg

# Roman Numerals
contraction ii
contraction iii
contraction iv
contraction vi
contraction vii
contraction viii
contraction ix
contraction xi
contraction xii
contraction xiii


# punctuation
prepunc " 236
postpunc " 356
always \s-" 36-36-356
always \s-” 36-36-356
always ..." 3-3-3-356
always …" 3-3-3-356
always ...” 3-3-3-356
always …” 3-3-3-356
always ?" 236-356
word " 236
begnum ' 3
prepunc ' 6-236
postpunc ' 356-3
postpunc '' 356
postpunc ''' 356-3-356

noback always ' 3
word 'ave 3-1-1236-15
word ’ave 3-1-1236-15
midendword 'an 3-1-1345
midendword ’an 3-1-1345
endword 'ah 3-1-125
endword ’ah 3-1-125
midendword 'am 3-1-134
midendword ’am 3-1-134
word c'mon 14-3-134-135-1345
word c’mon 14-3-134-135-1345
endword 'd 3-145
endword ’d 3-145
begword d' 145-3
begword d’ 145-3
word 'em 3-15-134
word ’em 3-15-134
word 'ear 3-15-1-1235
word ’ear 3-15-1-1235
midendword e'e 15-3-15
midendword e’e 15-3-15
word goin' 1245-135-24-1345-3
word goin’ 1245-135-24-1345-3
begword ha'p 125-1-3-1234
begword ha’p 125-1-3-1234
endword 'll 3-123-123
endword ’ll 3-123-123
endword 'm 3-134
endword ’m 3-134
endword 'n 3-1345
endword ’n 3-1345
begword o'd 135-3-145
begword o’d 135-3-145
begword o'l 135-3-123
begword o’l 135-3-123
word 'ome 3-135-134-15
word ’ome 3-135-134-15
endword 're 3-1235-15
endword ’re 3-1235-15
endword 'ry 3-1235-13456
endword ’ry 3-1235-13456
endword 'r 3-1235
endword ’r 3-1235
endword 's 3-234
endword ’s 3-234
endword 't 3-2345
endword ’t 3-2345
word 'tis =
word 'twas =
word 'uns 3-136-1345-234
word ’uns 3-136-1345-234
endword 've 3-1236-15
endword ’ve 3-1236-15
midnum , 3
noback always , 2
midnum . 2
#decpoint . 2 # removed to sort out translations such as p.11
noback always . 256
noback always ; 23
midnum : 3456
noback always : 25
#endnum ! 6-235
noback always ! 235
begnum # 4
always # 4-3456
midnum / 456-34-3456
always / 456-34
always // 345
noback always ? 236
endnum % 0-25-1234
always % 25-1234
midnum ^ 346-3456
always ^ 456-126
always ~ 4-156
always & 4-12346
midnum * 0-56-236-3456
always * 35-35
repeated *** 35-35-0-35-35-0-35-35
noback always ( 2356
prepunc ( 2356
postpunc ) 2356
begword ( 2356
endword ) 2356
always [ 6-2356
always ] 2356-3
always { 46-2356
always } 46-2356
always -com 36-14-135-134
endword -to 36-2345-135 pointed-to resource
endword -by 36-12-13456 used-by
# always _ 78
prepunc `` 236
postpunc ` 6-236
prepunc ` 6-236
postpunc ’ 356-3 end single curly quote
prepunc ’ 356-3
always ‘ 6-236 start single curly quote
noback always ` 4
begword @ 4-2346
noback always @ 2346
always \\ 5-16
always | 5-123
repeated \x00a0 0 no break space
repeated --- 36-36-36

# repeated ___ 78-78-78
repeated ___ 46-46-46

repeated ::: 25-25-25

repeated === 56-2356-56-2356-56-2356
repeated ~~~ 4-156-4-156-4-156
always \s-\s 36-36
always \s-\scom 36-36-14-135-134
always ... 3-3-3
always .\s.\s. 3-3-3 . . .
# always  \x2026 3-3-3 # 8230			MS Word smart ellipsis

# the hyphen
always \s–\s 36-36
#always - 36
repeated ­­­ 36-36-36
always \s­\s 36-36
midword - 36
joinword - 36
begword - 36
hyphen - 36



# mathematical symbols
#decpoint . 2 # removed to sort out translations such as p.11
noback always < 246
joinword = 56-2356
joinnum = 56-2356
noback always > 135
midnum + 0-56-235-3456
begnum + 56-235
joinnum + 56-235
joinword + 56-235
midnum - 36-3456 removed for verse references
midnum \x2013 36
#always - 36
joinnum × 56-236
joinword × 56-236
midnum ÷ 0-56-256-3456 division sign
joinnum ÷ 56-256
joinword ÷ 56-256
begnum £ 123
always £ 4-123 pounds

# other special characters
always © 45-14 copyright
sign ™ 45-2345 trademark
sign ® 45-1235 registered
always ¶ 1234-345 paragraph
always § 234-3 section
noback always ° 356 degrees
begnum $ 256
always $ 4-256
always ¢ 4-14 cents
sign € 4-15	euro
always € 4-15	euro
always ¥ 4-13456 yen
always µ 2-134 mu

# special character sequences
literal :// URLs
literal www.

literal .com
literal .edu
literal .gov
literal .mil
literal .net
literal .org
literal .doc
compbrl .xml
compbrl .xsl
literal .htm
literal .html
literal .tex
literal .txt
literal .gif
literal .jpg
literal .png
literal .wav
literal .tar
literal .zip
literal .uk

# include countries.cti

# Problems handled with context
#context _$l["."]$l @256 U.S.
noback context _$d["a"] @56-1
noback context _$d["A"] @56-1
#corrects Capital A's after a number ending up with letter sign AFTER Caps sign
noback pass2 @6-56 @56-6
include braille-patterns.cti
# Remove space between word and italic signs
noback pass2 [@0-46-3]   @46@3
noback pass2 [@46@0]   @46
#pass2 \s+  \s
noback pass2 [@345-0-0]  @345@0
noback pass2 [@345-0-0-0]  @345@0

