forked from liblouis/liblouisutdml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnemeth_edit_en_us_with_switch_indicators.ctb
80 lines (77 loc) · 3.9 KB
/
nemeth_edit_en_us_with_switch_indicators.ctb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# liblouis Table for Post-Translation Editing
#with Nemeth switch indicators added
#
#Use it for EBAE literary texts surrounding Nemeth math blocks
#Typical usecase:
# mathtextTable en-us-g1.ctb or en-us-g2.ctb
# mathexprTable nemeth.ctb
# editTable nemeth_edit_en_us_with_switch_indicators.ctb
#
# Based on the Linux screenreader BRLTTY, copyright (C) 1999-2006 by
# The BRLTTY Team
#
# Copyright (C) 2004-2006 ViewPlus Technologies, Inc. www.viewplus.com
# Copyright (C) 2004-2006 JJB Software, Inc. www.jjb-software.com
# Copyright (C) 2023 Norbert Márkus (hamilfonz at gmail dot com),
# Hungary
#
# 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/>.
#This table marks the beginning and end of math blocks with Nemeth switch indicators.
#The switch indicators help distinguish literary text from technical content.
#
#liblouisutdml inserts a space before and after each math block to separate it from the literary text.
#Such spaces are often undesirable, e.g., for punctuation and grouping symbols around the math blocks.
#In many cases these signs do not take their most appropriate forms as the math blocks
#are not yet present at the stage of literary Braille translation.
#This table makes a limited attempt to reconstruct the most likely form of some of the signs
#directly preceding or following a math block and to decide which of the automatically added spaces
#are to be kept or removed.
include en-chardefs.cti
#remove any extra spaces added by shapes or ellipses at the beginning of Nemeth blocks
noback correct "\eb\s" "\eb"
repeated \s 0
#corrections after the math blocks
always \ee\s`4 1b-15-256 period
always \ee\s`6 1b-15-235 exclamation point
#Try to detect whether the math excerpt is preceded and followed by double quotes and then restore the ending quotation mark.
noback context ["`8\s\eb"] #1=1@236-1b-12
noback context #1=1["\ee\s`8"] #1=0@1b-15-356
#Otherwise consider it as a question mark following the Nemeth block
always \ee\s`8 1b-15-236
always \ee\s`1 1b-15-2 comma after the math block
#prevent the first two cells of a percent sign from being treated as a prefixed colon after the math block
always \ee\s`3p 1b-15-4-25-1234
always \ee\s`3 1b-15-25 colon
always \ee\s`2 1b-15-23 semicolon
#Try to detect whether the math excerpt is preceded and followed by single quotes (apostrophe) and then restore the ending single quotation mark.
noback context ["`'\s\eb"] #2=1@6-236-1b-12
noback context #2=1["\ee\s`'"] #2=0@1b-15-356-3
#Otherwise consider it as an apostrophe following the Nemeth block
always \ee\s`' 1b-15-3
always \ee\s- 1b-15-36 hyphen
always \ee\s99 1b-15-35-35 asterisk
always `,7\s\eb 6-2356-1b-12 left bracket before math block
always `;7\s\eb 56-2356-1b-12 left brace before math block
always `7\s\eb 2356-1b-12 left parenthesis before math block
always \ee\s`7 1b-15-2356 right parenthesis after math block
always \ee\s,8;s 1b-15-3-234 plural or possessive
always \ee\s''' 1b-15-3-3-3 horizontal ellipsis
noback context "\eb"[]$l"\ee" @56 add a letsign (letter prefix) when the math block contains a single letter only
noback context "\eb"[]","$l"\ee" @56 add a letsign to a single capital letter making up the math block
noback pass2 @1b-12 @456-146-0 add Nemeth block start indicators
noback pass2 @1b-15 @0-456-156 add Nemeth block end indicators
noback pass2 @1b-12-4-4 @456-146-0-4