| 1 |
# Liblouis: Danish table for 6 dots grade 1 forward and backward translation (1993) |
| 2 |
# |
| 3 |
# Copyright (C) 2014, 2016-2021, 2023, Bue Vester-Andersen <[email protected]> |
| 4 |
# |
| 5 |
# This file is part of liblouis. |
| 6 |
# |
| 7 |
# liblouis is free software: you can redistribute it and/or modify it |
| 8 |
# under the terms of the GNU Lesser General Public License as |
| 9 |
# published by the Free Software Foundation, either version 2.1 of the |
| 10 |
# License, or (at your option) any later version. |
| 11 |
# |
| 12 |
# liblouis is distributed in the hope that it will be useful, but |
| 13 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
# Lesser General Public License for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU Lesser General Public |
| 18 |
# License along with liblouis. If not, see |
| 19 |
# <http://www.gnu.org/licenses/>. |
| 20 |
# |
| 21 |
# Version: Bue Vester-Andersen, December 2022 |
| 22 |
|
| 23 |
### Table Metadata |
| 24 |
|
| 25 |
#-name: Dansk fuldskrift 6-punkt 1993 |
| 26 |
#-index-name: Danish, uncontracted, 6-dot, 1993 |
| 27 |
#-display-name: Danish 6-dot uncontracted braille (1993 standard) |
| 28 |
|
| 29 |
#+language: da |
| 30 |
#+type: literary |
| 31 |
#+contraction: no |
| 32 |
#+grade: 1 |
| 33 |
#+dots: 6 |
| 34 |
#+direction: both |
| 35 |
#+system: ddp |
| 36 |
#+version: 1993 |
| 37 |
|
| 38 |
# Display opcodes |
| 39 |
include da-dk-octobraille_1993.dis |
| 40 |
|
| 41 |
### Spaces |
| 42 |
|
| 43 |
# These ctrl-chars have to have a representation, so that they can be properly converted back and forth. |
| 44 |
space \t 2478 CHARACTER TABULATION |
| 45 |
space \n 678 LINE FEED (LF) |
| 46 |
space \v 1368 LINE TABULATION |
| 47 |
space \f 12378 FORM FEED (FF) |
| 48 |
space \r 257 CARRIAGE RETURN (CR) |
| 49 |
space \x00a0 a |
| 50 |
|
| 51 |
include spaces.uti |
| 52 |
|
| 53 |
### Character definitions |
| 54 |
|
| 55 |
# Definition of dot cells |
| 56 |
punctuation ! 235 EXCLAMATION MARK |
| 57 |
punctuation " 2356 QUOTATION MARK |
| 58 |
sign & 12346 AMPERSAND |
| 59 |
punctuation ' 4 APOSTROPHE |
| 60 |
punctuation ( 236 LEFT PARENTHESIS |
| 61 |
punctuation ) 356 RIGHT PARENTHESIS |
| 62 |
punctuation * 35 ASTERISK |
| 63 |
punctuation , 2 COMMA |
| 64 |
punctuation - 36 HYPHEN-MINUS |
| 65 |
punctuation . 3 FULL STOP |
| 66 |
punctuation / 34 SLASH |
| 67 |
punctuation : 25 COLON |
| 68 |
punctuation ; 23 SEMICOLON |
| 69 |
punctuation ? 26 QUESTION MARK |
| 70 |
include latinLetterDef6Dots.uti |
| 71 |
|
| 72 |
include digits6Dots.uti |
| 73 |
|
| 74 |
punctuation \x00a7 346 SECTION SIGN (0xa7) |
| 75 |
|
| 76 |
lowercase \x00e5 16 LATIN LETTER A WITH RING ABOVE |
| 77 |
lowercase \x00e6 345 LATIN LETTER AE |
| 78 |
lowercase \x00f8 246 LATIN LETTER O WITH STROKE |
| 79 |
lowercase \x00fc 1256 LATIN LETTER U WITH DIAERESIS |
| 80 |
|
| 81 |
base uppercase \x00c5 \x00e5 LATIN LETTER A WITH RING ABOVE |
| 82 |
base uppercase \x00c6 \x00e6 LATIN LETTER AE |
| 83 |
base uppercase \x00d8 \x00f8 LATIN LETTER O WITH STROKE |
| 84 |
base uppercase \x00dc \x00fc LATIN LETTER U WITH DIAERESIS |
| 85 |
|
| 86 |
math \x00f7 256 DIVISION SIGN |
| 87 |
|
| 88 |
# cover all other Braille patterns |
| 89 |
include braille-patterns.cti |
| 90 |
|
| 91 |
# Characters with two or more cells |
| 92 |
|
| 93 |
punctuation # 45-3456 NUMBER SIGN |
| 94 |
sign $ 45-256 DOLLAR SIGN |
| 95 |
math % 245-356 PERCENT SIGN |
| 96 |
#sign & 6-12346 AMPERSAND |
| 97 |
#punctuation * 6-35 ASTERISK |
| 98 |
math + 45-235 PLUS SIGN |
| 99 |
math < 45-134 LESS-THAN SIGN |
| 100 |
math = 45-2356 EQUALS SIGN |
| 101 |
math > 45-234 GREATER-THAN SIGN |
| 102 |
sign @ 45-1 COMMERCIAL AT |
| 103 |
punctuation [ 5-236 LEFT SQUARE BRACKET |
| 104 |
punctuation \\ 45-16 REVERSE SLASH |
| 105 |
punctuation ] 5-356 RIGHT SQUARE BRACKET |
| 106 |
punctuation ^ 45-346 CIRCUMFLEX ACCENT |
| 107 |
punctuation _ 45-36 LOW LINE |
| 108 |
punctuation ` 4 GRAVE ACCENT |
| 109 |
punctuation { 45-246 LEFT CURLY BRACKET |
| 110 |
punctuation | 4568 VERTICAL LINE |
| 111 |
punctuation } 45-135 RIGHT CURLY BRACKET |
| 112 |
punctuation ~ 467 TILDE (changed by pass 2 to not conflict with indicators |
| 113 |
|
| 114 |
# Misc unicode characters |
| 115 |
include da-dk-6miscChars_1993.cti |
| 116 |
|
| 117 |
# Litdigits |
| 118 |
include litdigits6Dots.uti |
| 119 |
midendnumericmodechars /,.:^ |
| 120 |
undefined 26 |
| 121 |
|
| 122 |
### Braille indicators and special characters |
| 123 |
|
| 124 |
#hyphen - 36 |
| 125 |
|
| 126 |
letsign 6 |
| 127 |
|
| 128 |
# No letsign before normal letters or letters with accents |
| 129 |
# Letters with accents are handled by pass2. |
| 130 |
noletsign ABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅÄÖÜ\x0152 |
| 131 |
noletsign abcdefghijklmnopqrstuvwxyzæøåäöü\x00df\x0149\x0153 |
| 132 |
|
| 133 |
# Emphasis opcodes |
| 134 |
emphclass italic |
| 135 |
emphclass underline |
| 136 |
emphclass bold |
| 137 |
|
| 138 |
begemphphrase italic 56 |
| 139 |
endemphphrase italic after 56 |
| 140 |
|
| 141 |
begemphphrase bold 56 |
| 142 |
endemphphrase bold after 56 |
| 143 |
|
| 144 |
begemphphrase underline 56 |
| 145 |
endemphphrase underline after 56 |
| 146 |
|
| 147 |
capsletter 46 |
| 148 |
begcapsword 456 |
| 149 |
endcapsword 6 |
| 150 |
multind 6-46 letsign capsletter |
| 151 |
multind 46-6 capsletter letsign |
| 152 |
multind 6-456 letsign begcapsword |
| 153 |
|
| 154 |
numsign 3456 |
| 155 |
multind 6-3456 letsign numsign |
| 156 |
|
| 157 |
#class of none-space characters that demand double dashes |
| 158 |
# Used in context lines later. |
| 159 |
#must be the first class defined. |
| 160 |
attribute charsWDoubleDash .,?!/:"'() # class w |
| 161 |
|
| 162 |
### Correct - forward translation |
| 163 |
|
| 164 |
# Chars that don't require a space before percent and permille: |
| 165 |
attribute charsBeforePercent "(\x201e\x0084\x201c\x0093\x201d\x0094\x00ab\x00bb #class x |
| 166 |
noback correct `["%"] * |
| 167 |
noback correct !$sx["%"] "\s%" |
| 168 |
noback correct `["\x2030"] * |
| 169 |
noback correct !$sx["\x2030"] "\s\x2030" |
| 170 |
noback correct `["\x0089"] * |
| 171 |
noback correct !$sx["\x0089"] "\s\x2030" |
| 172 |
|
| 173 |
# Chars to be treated like digits when switching back to letter mode |
| 174 |
attribute extraDigits \x00bc\x00bd\x00be |
| 175 |
|
| 176 |
#Use the "correct" opcode to convert chars that can't be back-translated |
| 177 |
# and make the table more simple. |
| 178 |
|
| 179 |
# Dashes |
| 180 |
attribute dashes \x2013\x2014\x0096\x0097\x00ad |
| 181 |
noback correct %dashes "-" |
| 182 |
|
| 183 |
attribute quotes \x201e\x0084\x201c\x0093\x201d\x0094\x00ab\x00bb |
| 184 |
noback correct %quotes "\"" |
| 185 |
|
| 186 |
attribute apostrophes `\x201a\x0082\x2039\x008b\x2018\x0091\x2019\x0092\x203a\x009b\x00b4 |
| 187 |
noback correct %apostrophes "'" |
| 188 |
|
| 189 |
### Correct - backward translation |
| 190 |
|
| 191 |
# characters that may get mangled by the insertion of extra letsigns |
| 192 |
nofor correct "\x2818" "~" |
| 193 |
#nofor correct "\x282f" "&" |
| 194 |
#nofor correct "\x2814" "*" |
| 195 |
|
| 196 |
# Try to distinguish between times (\x00d7) and bullit (\x2022), |
| 197 |
# which share the same Braille representation. |
| 198 |
nofor correct `["\x00d7"] "\x2022" |
| 199 |
# nofor correct $d["\s\x00d7\s"]$d * #apparently doesn't work now |
| 200 |
nofor correct ["\x00d7"]!$d "\x2022" |
| 201 |
nofor correct !$d["\x00d7"] "\x2022" |
| 202 |
|
| 203 |
nofor correct "\x28a0" ? # Extraneous endcaps signs |
| 204 |
#nofor correct "\x2820" ? |
| 205 |
nofor correct "~\\456/" "|" |
| 206 |
|
| 207 |
### Pass 1 - Forward and backward |
| 208 |
|
| 209 |
# Punctuations, math and numbers |
| 210 |
#midnum , 2 |
| 211 |
#midnum . 3 |
| 212 |
# the following rule is doubtful, but probably does not apply. |
| 213 |
#midnum - 36 |
| 214 |
endnum - 36 |
| 215 |
#midnum / 34 |
| 216 |
#midnum : 25 |
| 217 |
|
| 218 |
midnum ^ 45-346 |
| 219 |
midnum \x00d7 45-3 |
| 220 |
|
| 221 |
# Remove space between § and numbers. |
| 222 |
noback begnum § 346 |
| 223 |
begnum §\s 346 |
| 224 |
begnum §§\s 346-346 |
| 225 |
always §§ 346-346 |
| 226 |
|
| 227 |
# Punctuation |
| 228 |
prepunc " 2356 |
| 229 |
postpunc " 2356 |
| 230 |
prepunc - 36 |
| 231 |
postpunc - 36 |
| 232 |
nofor always \s-\s 0-36-36-0 |
| 233 |
always :- 25-36 |
| 234 |
always ;- 23-36 |
| 235 |
always --- 36-36-36 |
| 236 |
always ---- 36-36-36-36 |
| 237 |
always ----- 36-36-36-36-36 |
| 238 |
|
| 239 |
# these characters must be separated from ")" by a letsign. |
| 240 |
attribute SepToRightpar Jj%'\x2030\x0089\x201a\x0082\x2039\x009b\x2018\x0091\x2019\x0092\x203a\x009b |
| 241 |
after SepToRightpar always ) 6-356 |
| 242 |
|
| 243 |
prepunc ( 236 |
| 244 |
postpunc ) 356 |
| 245 |
|
| 246 |
always .) 3-356 |
| 247 |
always ... 3-3-3 |
| 248 |
|
| 249 |
always !! 235-235 |
| 250 |
always !!! 235-235-235 |
| 251 |
always !!!! 235-235-235-235 |
| 252 |
always !!!!! 235-235-235-235-235 |
| 253 |
|
| 254 |
### Context rules - forward translation |
| 255 |
|
| 256 |
# Ensure two dashes where appropriate. |
| 257 |
noback context $w["-"]$w @36 |
| 258 |
noback context $sw["-"]$sw @36-36 |
| 259 |
noback context `["-"]$sw @36-36 |
| 260 |
noback context $sw["-"]~ @36-36 |
| 261 |
noback context !$sw["-"]~ @36 |
| 262 |
noback context `["-"]~ @36-36 |
| 263 |
|
| 264 |
#ensure dot 6 between a digit and a letter |
| 265 |
noback context $dy[]$u @6 |
| 266 |
noback context $dy$Spm.[]$u @6 |
| 267 |
|
| 268 |
### context - backward translation |
| 269 |
|
| 270 |
# Ensure the correct number of dashes |
| 271 |
nofor context @36[@36-36] "--" |
| 272 |
nofor context [@36-36]@36 "--" |
| 273 |
nofor context $w[@36-36]$w "--" |
| 274 |
nofor context $sw[@36-36]$sw "-" |
| 275 |
nofor context `[@36-36]$sw "-" |
| 276 |
nofor context $sw[@36-36]~ "-" |
| 277 |
nofor context `@36-36~ "-" |
| 278 |
|
| 279 |
|
| 280 |
### Pass 2 - forward translation |
| 281 |
|
| 282 |
# Correct tilde and vertical line |
| 283 |
noback pass2 @467 @45-6 |
| 284 |
noback pass2 @4568 @45-456 |
| 285 |
|
| 286 |
noback pass2 @6-5 @5 # no letsign before letters with accent |
| 287 |
noback pass2 @6-46-5 @46-5 # no letsign before cap letters with accent |
| 288 |
noback pass2 @6-46 @46-6 # Ensure correct order |
| 289 |
|
| 290 |
### Pass 2 - backward |
| 291 |
|
| 292 |
### Pass 3 - forward translation |
| 293 |
|
| 294 |
# Ensure there is only one letsign |
| 295 |
noback pass3 @6-6 @6 |
| 296 |
|
| 297 |
# Ensure there is only one emphasis sign |
| 298 |
noback pass3 @56-56 @56 |
| 299 |
noback pass3 @56-56-56 @56 |
| 300 |
|
| 301 |
### Pass 3 - backward translation |
| 302 |
|
| 303 |
# save ~ and | before inserting extra letsigns and endcapsword in pass 2. |
| 304 |
nofor pass3 @45-6 @468 # Create alternative representation of "~" |
| 305 |
nofor pass3 @45-456 @4568 |