From af11fc0a52bb603303196f7e203374dd18601d47 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Thu, 22 Jun 2023 14:48:07 +0200 Subject: [PATCH 01/21] Corrected the expected output for a number of test cases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - mathml_nemeth/mover_01 - mathml_nemeth/mover_08: the test had the same expected output as the mover_07 test, but this was a mistake. - mathml_nemeth/munder_01: the test was not aware of a 2018 Nemeth rule update allowing for a contracted braille notation of a horizontal bar under a single digit or letter. expected.txt has been updated to reflect this new syntax. - mathml_nemeth/munder_03 - mathml_nemeth/munderover_02: fixed a typo Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- tests/Makefile.am | 4 +--- tests/mathml_nemeth/mover_01.test/expected.txt | 2 +- tests/mathml_nemeth/mover_08.test/expected.txt | 2 +- tests/mathml_nemeth/munder_01.test/expected.txt | 2 +- tests/mathml_nemeth/munder_03.test/expected.txt | 2 +- tests/mathml_nemeth/munderover_02.test/expected.txt | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 7a6e45c2..18b3a789 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -481,22 +481,20 @@ XFAIL_TESTS += \ mathml_nemeth/mmultiscripts_05.test \ mathml_nemeth/mmultiscripts_06.test \ mathml_nemeth/mmultiscripts_07.test \ - mathml_nemeth/mover_01.test \ mathml_nemeth/mover_02.test \ mathml_nemeth/mover_03.test \ mathml_nemeth/mover_04.test \ mathml_nemeth/mover_05.test \ mathml_nemeth/mover_06.test \ mathml_nemeth/mover_07.test \ - mathml_nemeth/mover_08.test \ mathml_nemeth/mover_13.test \ mathml_nemeth/mover_14.test \ mathml_nemeth/mover_15.test \ + mathml_nemeth/munder_01.test \ mathml_nemeth/munder_02.test \ mathml_nemeth/munder_03.test \ mathml_nemeth/munder_06.test \ mathml_nemeth/munder_07.test \ - mathml_nemeth/munderover_02.test \ mathml_nemeth/munderover_03.test \ nemeth_MathCAT/above_and_below_88_2.test \ nemeth_MathCAT/arrow_96_4.test \ diff --git a/tests/mathml_nemeth/mover_01.test/expected.txt b/tests/mathml_nemeth/mover_01.test/expected.txt index 9bcdfb5d..8ea5bb64 100755 --- a/tests/mathml_nemeth/mover_01.test/expected.txt +++ b/tests/mathml_nemeth/mover_01.test/expected.txt @@ -1 +1 @@ -"X%:] +"X+Y<:] diff --git a/tests/mathml_nemeth/mover_08.test/expected.txt b/tests/mathml_nemeth/mover_08.test/expected.txt index f755b640..1aad7bde 100755 --- a/tests/mathml_nemeth/mover_08.test/expected.txt +++ b/tests/mathml_nemeth/mover_08.test/expected.txt @@ -1 +1 @@ -"X+Y<:< Date: Tue, 27 Jun 2023 18:17:47 +0200 Subject: [PATCH 02/21] Update mathml_nemeth/msubsup_04 to correspond to the summation example in the Nemeth rulebook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note that image.png still reflects the previous input.xml. It does not correspond to the expected output and the title of the test case. Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- tests/mathml_nemeth/msubsup_04.test/input.xml | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/tests/mathml_nemeth/msubsup_04.test/input.xml b/tests/mathml_nemeth/msubsup_04.test/input.xml index 5c81c0f7..ad7c7d8a 100755 --- a/tests/mathml_nemeth/msubsup_04.test/input.xml +++ b/tests/mathml_nemeth/msubsup_04.test/input.xml @@ -1,16 +1,12 @@ - - - - - - a - k - - - 0 - n - - + + + 0 + n + + + a + k + From 79c361516688424439316d38c3de2bdc1ac81145 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Mon, 19 Jun 2023 12:10:41 +0200 Subject: [PATCH 03/21] Various updates to nemeth.ctb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The main translation table for Nemeth math content has undergone a number of changes to better comply with the Nemeth rules. The improvements are listed below: - The order of some character definitions and include statements have been changed so that the now updated Nemeth Braille dot patterns of mathematical symbols take precedence over the literary Braille patterns for the same Unicode characters. E.g. the horizontal ellipsis, and division sign are among those affected. - Now the caret symbol appears with its intended Nemeth Braille dot pattern. - The colon and semicolon as mathematical symbols appear with a punctuation prefix (dots 456-25 and dots 456-23) and a space is added after them. The space may be skipped depending on the context. - A number of rules have been disabled to give way to the now updated Nemeth Braille dot patterns of mathematical symbols in nemethdefs.cti. - The list of function names and abbreviations has been extended with items (e.g. two-letter abbreviations of function names and their combinations). - Indication of subscripts and superscripts has been improved and consolidated. E.g., numeric subscripts are now either indicated or not indicated by a subscript prefix as required. However, multilevel subscripts and superscripts are not (yet) covered as it requires keeping track of the current level. - A number sign is inserted before the first digit following a dot 5 or dots 56 (also in combinations with a minus sign) if that prefix is the first cell in the block or after a space. - Now a single digit or letter with overbar is handled correctly. Previously a two-step rule had the side-effect of deleting dot 5 from dots 5-13-156 even when this sequence appeared as part of signs of comparison (less than or equal to, etc). Now those signs of comparison, including those for sets are correctly displayed. The solution does not yet cover letters of another alphabet or type form. Such instances are displayed using the uncontracted five-step Nemeth rule. - Support for the contracted indication of a horizontal bar under a single digit or letter is added (dots 146-156 following the digit or letter) according to a [2013. BANA update to Nemeth Rule XIV.](https://www.brailleauthority.org/nemethupdates2013/rule-xiv86c.pdf). The solution does not yet cover letters of another alphabet or typeform. Such instances are displayed using the uncontracted five-step Nemeth rule. - Now a Nemeth rule for repeating decimals is observed. When a series of digits have each a dot above in print to mark a repeating period, it is sufficient to show a single dot in Braille. The modification block, however, applies to all the digits affected. - The decimal point now appears correctly (dots 46) even when preceding or following a dot five which indicates the beginning of a modification. - A space is inserted between the Braille representation of {} for the empty set. - The space is removed from between a grouping symbol and a horizontal ellipsis in various combinations. - The space between a function name/abbreviation and a superscript belonging to it is removed. In case of a log and colog, a subscript is expected. Note that the current solution is far from perfect as processing function names and their surroundings could better be done by an algorithm. - Any series of multiple spaces in the math blocks are reduced to a single space at that place. Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/nemeth.ctb | 186 +++++++++++++++++++++++++++++++++++++++---- tests/Makefile.am | 27 +------ 2 files changed, 172 insertions(+), 41 deletions(-) diff --git a/lbu_files/nemeth.ctb b/lbu_files/nemeth.ctb index 1a83daf6..d5867d24 100644 --- a/lbu_files/nemeth.ctb +++ b/lbu_files/nemeth.ctb @@ -5,6 +5,7 @@ # # Copyright (C) 2004-2008 ViewPlus Technologies, Inc. www.viewplus.com # Copyright (C) 2004-2006 JJB Software, Inc. www.jjb-software.com +# Expanded and modified by Norbert Márkus (hamilfonz at gmail dot com), Hungary, 2023. # # This file is part of liblouis. # @@ -22,8 +23,52 @@ # License along with liblouis. If not, see # . -include en-chardefs.cti All character definition opcodes +space \x001b 1b escape character for html back-translation +include loweredDigits6Dots.uti +include latinLetterDef6Dots.uti +include latinUppercaseComp6.uti +replace \x00AF \x2015 +punctuation ( 12356 +punctuation } 12456 +punctuation ] 124567 +punctuation ? 1456 +punctuation : 156 +punctuation ) 23456 +punctuation ! 2346 +punctuation { 246 +punctuation [ 2467 +punctuation ' 3 +punctuation - 36 +punctuation . 46 +punctuation " 5 +punctuation ; 56 +punctuation , 6 +sign & 12346 +sign $ 1246 +sign | 1256 +sign \\ 12567 +sign % 146 +sign * 16 +sign # 3456 +punctuation ` 4 +sign _ 456 +sign ^ 457 +sign @ 47 +math = 123456 +math < 126 +math / 34 +math > 345 +math + 346 +math ~ 45 +punctuation : 456-25-0 #Added in 2023 +punctuation ; 456-23-0 #Added in 2023 +#sign \x00F7 46-34 DIVISION SIGN #added then removed in 2023 +#math \x2026 0-3-3-3-0 HORIZONTAL ELLIPSIS 002E 002E 002E #Added then removed in 2023 + +#Reversed the order of the two include lines below to give priority to the math character definitions include nemethdefs.cti +include en-chardefs.cti All character definition opcodes +attribute mathdot \x00B7\x02D9\x22C5 # Braille indicators multind 56-6 letsign capsletter @@ -53,8 +98,8 @@ hyphen - 36 postpunc . 456-256 endnum . 456-256 always . 256 -postpunc ; 456-23 -postpunc : 456-25 +#postpunc ; 456-23 #Removed in 2023 +#postpunc : 456-25 #Removed in 2023 always ! 12346 factorial always < a-5-13-a always = a-46-13-a @@ -62,6 +107,7 @@ always > a-46-2-a postpunc ? 456-236 endnum % 4-356 always ~~ 4-156-5-4-156 +#always \x2248 a-4-156-4-156-a almost equals #Removed in 2023 always ~ 4-156 always & 456-12346 midnum * 4-16 @@ -73,10 +119,13 @@ always @ 4-1 always \\ 456-16 always | 1256 always $ 4-234 +#always \x27E8 46-46-12356 left angle bracket #Removed in 2023 +#always \x27E9 46-46-23456 right angle bracket #Removed in 2023 +always \x2015 156 horizontal bar above accented centered repeated \s 0 noback context ["\x25A1"]$d @1246-256-5 noback context ["\x25A0"]$d @1246-456-256-5 -always \x00b0 45-46-16 +always \x00b0 45-46-16 #This is not a simple symbol. It also implies a local superscript and may require a baseline suffix (2023) always \x00B1 346-36 # semantic character pairs @@ -96,6 +145,7 @@ math \xf321 45 replace \xf401\xf321 always \xf402\xf321 5 # Underscript and overscript +#Apparently no longer done this way (2023) math \xf322 146 always \xf401\xf322 5 always \xf402\xf322 12456 @@ -172,16 +222,17 @@ always ^| 1256 always ^/ 34 always ^* 16 repeated ^1 a +always ^ 456-126 #default the CARET character to its Nemeth Braille representation if it has not been consumed as a prefix in the lines above (2023) # Function names and abbreviations always acos 1-14-135-234-a -always antilog 1-1345-2345-24-123-135-1234-a +always antilog 1-1345-2345-24-123-135-1245-a always arc 1-1235-14-a always arccos 1-1235-14-14-135-234-a always arg 1-1235-1245-a always asin 1-234-24-1345-a always atan 1-2345-1-1345-a -always colog 14-123-135-1245-a +always colog 14-123-135-1245 #-a always cos 14-135-234-a always cosh 14-135-234-125-a always cot 14-135-2345-a @@ -192,7 +243,7 @@ always csch 14-234-14-125-a always erf 15-1235-124-a always inf 24-1345-124-a always ln 123-1345-a -always log 123-135-1234-a +always log 123-135-1245 #-a always max 134-1-1346-a always min 134-24-1345-a always sec 234-15-14-a @@ -202,8 +253,12 @@ always sinh 234-24-1345-125-a always tan 2345-1-1345-a always tanh 2345-1-135-125-a always vers 1236-15-1235-234-a - - +always sgn 234-1245-1345-a #Added in 2023 +always tg 2345-1245-a #Added in 2023 +always ctg 14-2345-1245-a #Added in 2023 +always lg 123-1245-a #Added in 2023 +always arcsin 1-1235-14-234-24-1345-a #Added in 2023 +always arctg 1-1235-14-2345-1245-a #Added in 2023 # computer braille character sequences compbrl :// URLs @@ -229,15 +284,42 @@ compbrl .zip # pass 2 corrections # get rid of base-line ind. after subscripts -noback pass2 @56[$d1-5]@5!$d * -# insert another superscript ind. on doube superscripts -noback pass2 @45[]$d@5-5 @45 +#noback pass2 @56[$d1-5]@5!$d * #removed in 2023. See the following lines below instead +#Handle stand-alone subscripts (2023) +noback pass2 @1b-12-56[]$d1-5@5-1b-15 @3456 #add number sign (2023) +noback pass2 @1b-12-56[]$d1-5@5$s @3456 #(2023) +noback pass2 $s@56[]$d1-5@5-1b-15 @3456 #(2023) +noback pass2 $s@56[]$d1-5@5$s @3456 #(2023) + +#handle prescribed subscripts +noback pass2 @1b-12-56$d1-5[@5]@45 ? #testing for a preceding letter won't work because the math start sign ends with letter b (2023) +noback pass2 @1b-12-56$d1-5[@5]@56 ? #(2023) +noback pass2 @1b-12-56$d1-5[@5] @5 #(2023) +noback pass3 @1b-12-56$d1-5[@5] @5 #(2023) + +#Preserve the subscript ind. and the base-line ind. if the subscript is not preceded by a letter +#but remove the base-line ind. if the subscript is either followed by a superscript or a subscript +##noback pass2 $l@56$d1-5[@5]@45 ? #(2023) +##noback pass3 $l@56$d1-5[@45] @45 #(2023) +##noback pass2 $l@56$d1-5[@5]@56 ? #(2023) +##noback pass3 $l@56$d1-5[@56] @56 #(2023) + +#Remove the subscript prefix if it is preceded by a letter. +#But after this numeric subscript, do not remove the base-line ind. if it is followed by a number +noback pass2 $l@56$d1-5[@5]!$d ? #added in 2023 +noback pass3 $l[@56]$d1-5 ? #added in 2023 + +# insert another superscript ind. on double superscripts +#noback pass2 @45[]$d@5-5 @45 #often it does not yield the expected output (2023) #get rid of extra baseline inds. noback pass2 @5-5 @5 noback pass2 @5-0 @0 +noback pass3 @5-0 @0 #(2023) noback pass2 @5-a @a +noback pass3 @5-a @a #(2023) noback pass2 @5-1b-15 @1b-15 -# get rid rid of superscript ind. on prime sign +noback pass3 @5-1b-15 @1b-15 #(2023) +# get rid of superscript ind. on prime sign noback pass2 @45-3-5 @3 # Put 456 in mixed numbers noback pass2 $d[]@1456 @456 @@ -254,11 +336,23 @@ noback pass2 @0-a @a # fix anomaly with superscripts noback pass2 @45-0-5 @45 noback pass2 @45-5 @45 + # Fix single letter and digit with overbar -noback pass2 @5$l[@126-12456] @156 -noback pass2 @5-6$l[@126-12456] @156 -noback pass2 [@5]!$s@156 @a +#noback pass2 @5$l[@126-12456] @156 +noback pass2 @5[$l]@126-156-12456 *@156 #(2023) +noback pass2 @5[@6$l]@126-156-12456 *@156 #(2023) +noback pass2 @5[$d]@126-156-12456 *@156 #(2023) + +# Fix single letter and digit with bar directly under +noback pass2 @5[$l]@146-156-12456 *@146-156 #(2023) +noback pass2 @5[@6$l]@146-156-12456 *@146-156 #(2023) +noback pass2 @5[$d]@146-156-12456 *@146-156 #(2023) + +#It is sufficient to indicate one dot above a series of digits if two or more consecutive digits each have a dot above +noback pass2 @5$d2-100@126[%mathdot2-100]@12456 @16 #(2023) +#noback pass2 [@5]!$s@156 @a noback pass2 @46-a @456-256 +noback pass2 [@456-256]@5$d @46 #(2023) # get rid of space for overscripts noback pass2 @126-a @126 noback pass2 @146-a @146 @@ -276,9 +370,69 @@ noback pass2 @1256-4-6-12356 @4-6-12356 # take off baseline ind. comma space noback pass2 [@5-6]!$l @6 noback pass2 @1b-12[]$d @3456 number sign before digit at beginning +noback pass2 @1b-12[]@5$d @3456 #(2023) +noback pass2 $s[]@5$d @3456 #(2023) +noback pass3 @1b-12[]$d @3456 #(2023) noback pass2 @1b-12-36[]$d @3456 number sign before minus before digit at beginning +noback pass2 @1b-12-5-36[]$d @3456 #(2023) +noback pass2 @1b-12-36[]@5$d @3456 #(2023) +noback pass2 $s@5-36[]$d @3456 #(2023) +noback pass2 $s@36[]@5$d @3456 #(2023) +noback pass3 @1b-12-36[]$d @3456 #(2023) noback pass2 [@12e]$d @3456 noback pass2 [@12e-36]$d @36-3456 noback pass2 [@12e-46]$d @3456-46 noback pass2 @12e ? noback pass2 @15e ? +#Remove space from behind colon or semicolon when followed by other than a number #Added in 2023 +noback pass2 @456-25[@0]!$d ? #Added in 2023 +noback pass2 @456-23[@0]!$d ? #Added in 2023 +#Insert space between {} for the empty set #Added in 2023 +noback pass2 @46-12356[]@46-23456 @a #Added in 2023 +#Remove space between a grouping symbol and a horizontal ellipsis #Added in 2023 +noback pass2 @46-46-12356[@0]@3-3-3 ? #Added in 2023 +noback pass2 @46-12356[@0]@3-3-3 ? #Added in 2023 +noback pass2 @4-12356[@0]@3-3-3 ? #Added in 2023 +noback pass2 @12356[@0]@3-3-3 ? #Added in 2023 +noback pass2 @3-3-3[@0]@46-46-23456 ? #Added in 2023 +noback pass2 @3-3-3[@0]@46-23456 ? #Added in 2023 +noback pass2 @3-3-3[@0]@4-23456 ? #Added in 2023 +noback pass2 @3-3-3[@0]@23456 ? #Added in 2023 + +#function names with superscript, remove the space from before the superscript prefix +noback pass2 @1-14-135-234[@a]@45 ? #acos. 2023 +noback pass2 @1-1345-2345-24-123-135-1245[@a]@45 ? #antilog. 2023 +noback pass2 @1-1235-14[@a]@45 ? #arc. 2023 +noback pass2 @1-1235-14-14-135-234[@a]@45 ? #arccos. 2023 +noback pass2 @1-1235-1245[@a]@45 ? #arg. 2023 +noback pass2 @1-234-24-1345[@a]@45 ? #asin. 2023 +noback pass2 @1-2345-1-1345[@a]@45 ? #atan. 2023 +noback pass2 @14-135-123-135-1245[@a]@45 ? #colog. 2023 +noback pass2 @14-135-234[@a]@45 ? #cos. 2023 +noback pass2 @14-135-234-125[@a]@45 ? #cosh. 2023 +noback pass2 @14-135-2345[@a]@45 ? #cot. 2023 +noback pass2 @14-135-2345-125[@a]@45 ? #coth. 2023 +noback pass2 @14-135-1236-15-1235-234[@a]@45 ? #covers. 2023 +noback pass2 @14-234-14[@a]@45 ? #csc. 2023 +noback pass2 @14-234-14-125[@a]@45 ? #csch. 2023 +noback pass2 @15-1235-124[@a]@45 ? #erf. 2023 +noback pass2 @24-1345-124[@a]@45 ? #inf. 2023 +noback pass2 @123-1345[@a]@45 ? #ln. 2023 +noback pass2 @123-135-1245[@a]@45 ? #log. 2023. +noback pass2 @134-1-1346[@a]@45 ? #max. 2023 +noback pass2 @134-24-1345[@a]@45 ? #min. 2023 +noback pass2 @234-15-14[@a]@45 ? #sec. 2023 +noback pass2 @234-15-14-125[@a]@45 ? #sech. 2023. +noback pass2 @234-24-1345[@a]@45 ? #sin. 2023. +noback pass2 @234-24-1345-125[@a]@45 ? #sinh. 2023 +noback pass2 @2345-1-1345[@a]@45 ? #tan. 2023 +noback pass2 @2345-1-1345-125[@a]@45 ? #tanh. 2023 +noback pass2 @1236-15-1235-234[@a]@45 ? #vers. 2023 +noback pass2 @234-1245-1345[@a]@45 ? #sgn. 2023. +noback pass2 @123-1245[@a]@45 ? #lg. 2023 +noback pass2 @2345-1245[@a]@45 ? #tg with superscript. Added in 2023 +noback pass2 @14-2345-1245[@a]@45 ? #ctg with superscript. Added in 2023 +noback pass2 @1-1235-14-234-24-1345[@a]@45 ? #arcsin with superscript. Added in 2023 +noback pass2 @1-1235-14-2345-1245[@a]@45 ? #arctg with superscript. Added in 2023 + +noback pass4 [$s]$s ? diff --git a/tests/Makefile.am b/tests/Makefile.am index 18b3a789..497fe548 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -439,7 +439,6 @@ XFAIL_TESTS += \ firstLineIndent.test \ mixed_content.test \ printPageNumberRange_03.test \ - mathml_nemeth/general_001.test \ mathml_nemeth/general_002.test \ mathml_nemeth/general_003.test \ mathml_nemeth/mfrac_02.test \ @@ -456,20 +455,16 @@ XFAIL_TESTS += \ mathml_nemeth/mixed_scripts_07.test \ mathml_nemeth/msub_02.test \ mathml_nemeth/msub_03.test \ - mathml_nemeth/msub_04.test \ mathml_nemeth/msub_05.test \ - mathml_nemeth/msub_06.test \ - mathml_nemeth/msub_07.test \ mathml_nemeth/msub_08.test \ mathml_nemeth/msub_09.test \ mathml_nemeth/msub_10.test \ - mathml_nemeth/msubsup_02.test \ mathml_nemeth/msubsup_03.test \ - mathml_nemeth/msubsup_04.test \ mathml_nemeth/msubsup_05.test \ mathml_nemeth/msubsup_06.test \ mathml_nemeth/msubsup_07.test \ mathml_nemeth/msup_02.test \ + mathml_nemeth/msup_03.test \ mathml_nemeth/msup_06.test \ mathml_nemeth/msup_09.test \ mathml_nemeth/msup_10.test \ @@ -481,16 +476,12 @@ XFAIL_TESTS += \ mathml_nemeth/mmultiscripts_05.test \ mathml_nemeth/mmultiscripts_06.test \ mathml_nemeth/mmultiscripts_07.test \ - mathml_nemeth/mover_02.test \ - mathml_nemeth/mover_03.test \ mathml_nemeth/mover_04.test \ mathml_nemeth/mover_05.test \ mathml_nemeth/mover_06.test \ mathml_nemeth/mover_07.test \ mathml_nemeth/mover_13.test \ - mathml_nemeth/mover_14.test \ mathml_nemeth/mover_15.test \ - mathml_nemeth/munder_01.test \ mathml_nemeth/munder_02.test \ mathml_nemeth/munder_03.test \ mathml_nemeth/munder_06.test \ @@ -506,14 +497,12 @@ XFAIL_TESTS += \ nemeth_MathCAT/boldface_32_b_6.test \ nemeth_MathCAT/cap_22_a_1.test \ nemeth_MathCAT/cap_roman_numeral_18_a_3.test \ - nemeth_MathCAT/carrot_98_1.test \ nemeth_MathCAT/comma_78_2.test \ nemeth_MathCAT/comma_78_2_invisible.test \ nemeth_MathCAT/comma_78_3.test \ nemeth_MathCAT/comma_78_6.test \ nemeth_MathCAT/comma_ellipsis_in_sub_79_b_5.test \ nemeth_MathCAT/comma_in_sup_79_b_4.test \ - nemeth_MathCAT/comma_number_77_4_20.test \ nemeth_MathCAT/comma_space_78_1.test \ nemeth_MathCAT/comparison_79_g_2.test \ nemeth_MathCAT/complex_frac_66_1.test \ @@ -571,13 +560,10 @@ XFAIL_TESTS += \ nemeth_MathCAT/mmultiscripts_82_b_6.test \ nemeth_MathCAT/ms.test \ nemeth_MathCAT/ms_38_4_8.test \ - nemeth_MathCAT/msubsup_82_a_3.test \ nemeth_MathCAT/multipurpose_177_2_1.test \ nemeth_MathCAT/multipurpose_177_2_2.test \ - nemeth_MathCAT/multipurpose_177_3_1.test \ nemeth_MathCAT/multipurpose_177_5_1.test \ nemeth_MathCAT/multipurpose_177_7_1.test \ - nemeth_MathCAT/munder_lesson_12_5_5_5.test \ nemeth_MathCAT/nested_root_105_2.test \ nemeth_MathCAT/nested_sqrt_105_1.test \ nemeth_MathCAT/nested_sqrt_105_3.test \ @@ -587,20 +573,15 @@ XFAIL_TESTS += \ nemeth_MathCAT/nested_sup_74_b_4.test \ nemeth_MathCAT/nested_sup_mmultiscripts_74_b_1.test \ nemeth_MathCAT/nested_sup_sup_space_79_d_9.test \ + nemeth_MathCAT/nested_super_79_a_3.test \ nemeth_MathCAT/nested_super_space_79_d_3.test \ nemeth_MathCAT/nested_super_space_79_d_7.test \ nemeth_MathCAT/non_hyper_complex_frac_67_1.test \ nemeth_MathCAT/non_list_10_4.test \ nemeth_MathCAT/number_space_before.test \ nemeth_MathCAT/number_space_before_and_after.test \ - nemeth_MathCAT/numeric_sub_81_a_1.test \ nemeth_MathCAT/order2_overbar_87_a_1.test \ - nemeth_MathCAT/overbar_86_a_4.test \ - nemeth_MathCAT/overbar_86_a_5.test \ - nemeth_MathCAT/overbar_86_b_1.test \ - nemeth_MathCAT/overbar_86_b_10.test \ nemeth_MathCAT/overbar_86_b_11.test \ - nemeth_MathCAT/prescript_77_4_18.test \ nemeth_MathCAT/prescript_77_4_6.test \ nemeth_MathCAT/prescript_77_4_7.test \ nemeth_MathCAT/prime_172_5.test \ @@ -618,8 +599,6 @@ XFAIL_TESTS += \ nemeth_MathCAT/prime_mmultiscripts_83_b_2.test \ nemeth_MathCAT/prime_mmultiscripts_83_b_4.test \ nemeth_MathCAT/prime_wiris_83_b_2.test \ - nemeth_MathCAT/primed_86_b_6.test \ - nemeth_MathCAT/product_77_4_24.test \ nemeth_MathCAT/punct_37_1_2.test \ nemeth_MathCAT/punct_37_2_2.test \ nemeth_MathCAT/punct_37_7_1.test \ @@ -632,14 +611,12 @@ XFAIL_TESTS += \ nemeth_MathCAT/sub_ind_80_b_3.test \ nemeth_MathCAT/sub_ind_80_b_4.test \ nemeth_MathCAT/sub_ind_mmultiscripts_80_b_3.test \ - nemeth_MathCAT/sum_77_4_23.test \ nemeth_MathCAT/superscript_80_a_2.test \ nemeth_MathCAT/tensor_from_mathml_spec.test \ nemeth_MathCAT/test_9_d_2.test \ nemeth_MathCAT/test_9_d_3.test \ nemeth_MathCAT/text_after_sup_79_c_3.test \ nemeth_MathCAT/trilinear_not_ratio_151_11.test \ - nemeth_MathCAT/underbar_86_a_1.test \ nemeth_MathCAT/vertical_bar_145_4.test \ nemeth_MathCAT/whitespace_in_sup_79_e_1.test \ nemeth_MathCAT/word_77_4_12.test \ From 2039dd194faba240545bf642908c5a4b05c6de7b Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Sat, 24 Jun 2023 12:45:01 +0200 Subject: [PATCH 04/21] Fix mathml_nemeth/mover_06: added a missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- tests/mathml_nemeth/mover_06.test/input.xml | 28 +++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tests/mathml_nemeth/mover_06.test/input.xml b/tests/mathml_nemeth/mover_06.test/input.xml index d1e79d33..cd8d486e 100755 --- a/tests/mathml_nemeth/mover_06.test/input.xml +++ b/tests/mathml_nemeth/mover_06.test/input.xml @@ -1,19 +1,21 @@ - - - a - ¯ - - A - + - - b - ¯ - - B - + + + + a + ¯ + + A + + + + b + ¯ + + B + + ¯ From 5261cd88637920d9f4671fe5eb75aa2291eec25c Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Mon, 19 Jun 2023 12:29:24 +0200 Subject: [PATCH 05/21] Add nemeth_edit_with_switch_indicators.ctb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This editTable introduces switch indicators (opening Nemeth Code indicator: dots 456-146-0, and Nemeth Code terminator: dots 0-456-156) to mark the beginning and end of any Nemeth math blocks within the literary text. This table also takes care of punctuation and other symbols directly following or preceding the Nemeth blocks. This file as editTable is best used with en-us-g1.ctb or en-us-g2.ctb as mathtextTable. Another file, nemeth_edit_UEB_with_Nemeth.ctb is under preparation to provide full support for Nemeth blocks to appear within UEB texts according to an April 2018 revision of BANA's Guidance to Transcription (http://www.brailleauthority.org/ueb/nemeth-guidance/Nemeth%20Guidance%20Final.pdf). Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/Makefile.am | 1 + .../nemeth_edit_with_switch_indicators.ctb | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 lbu_files/nemeth_edit_with_switch_indicators.ctb diff --git a/lbu_files/Makefile.am b/lbu_files/Makefile.am index 36299352..d65c674b 100644 --- a/lbu_files/Makefile.am +++ b/lbu_files/Makefile.am @@ -24,6 +24,7 @@ lbu_files_DATA = \ nemeth.ctb \ nemeth.sem \ nemeth_edit.ctb \ + nemeth_edit_with_switch_indicators.ctb \ nimas.cfg \ nimas.sem \ package.sem \ diff --git a/lbu_files/nemeth_edit_with_switch_indicators.ctb b/lbu_files/nemeth_edit_with_switch_indicators.ctb new file mode 100644 index 00000000..9b447c2b --- /dev/null +++ b/lbu_files/nemeth_edit_with_switch_indicators.ctb @@ -0,0 +1,57 @@ +# liblouis Table for Post-Translation Editing +#Complying with BANA's 2018 Nemeth rules +# +# 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 +# . + +include en-chardefs.cti +repeated \s 0 +always \ee\s`4 1b-15-256 (2023) +always \ee\s`6 1b-15-235 (2023) +always \ee\s`8 1b-15-236 (2023) +always \ee\s`1 1b-15-2 (2023) +always \ee\s`3p 1b-15-4-25-1234 (2023) +always \ee\s`3 1b-15-25 (2023) +always \ee\s`2 1b-15-23 (2023) +always \ee\s`' 1b-15-3 (2023) +always \ee\s- 1b-15-36 (2023) +always \ee\s_/ 1b-15-456-34 (2023) +always \ee\s99 1b-15-35-35 (2023) +always `7\s\eb 2356-1b-12 (2023) +always \ee\s`7 1b-15-2356 (2023) +always `8\s\eb 236-1b-12 (2023) +#always "\s 0 (2023) +#always \s,\s 6-0 (2023) +noback correct "\eb\s" "\eb" +noback context "\eb"[]$l"\ee" @56 +noback context "\eb"[]","$l"\ee" @56 +#noback pass2 @1b-12 ? +noback pass2 @1b-12 @456-146-0 #Nemeth block start indicator (2023) +#noback pass2 @1b-15 ? +noback pass2 @1b-15 @0-456-156 Nemeth block end indicator (2023) + +#Trying to detect whether the math excerpt is preceded and followed by quotes and then restoring the ending quotation mark. +noback pass2 [@236-1b-12] #1=1@236-456-146-0 #(2023) +noback pass2 #1=1[@1b-15-236] #1=0@0-456-156-356 #(2023) +noback pass2 @1b-12-4-4 @456-146-0-4 (2023) From 468ad0575640119120b0f1eef3dbe37ad5da0c89 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Mon, 19 Jun 2023 12:37:47 +0200 Subject: [PATCH 06/21] nemeth.sem: single-word switch indicator for text items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Text items appearing in Nemeth math blocks are now preceded and followed by a space and the text itself receives a so-called single-word switch indicator (dots 6-3) as a prefix according to an April 2018 revision of BANA's Guidance for Transcription (http://www.brailleauthority.org/ueb/nemeth-guidance/Nemeth%20Guidance%20Final.pdf). Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/nemeth.sem | 4 +++- tests/Makefile.am | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lbu_files/nemeth.sem b/lbu_files/nemeth.sem index 8abeff18..accbb070 100644 --- a/lbu_files/nemeth.sem +++ b/lbu_files/nemeth.sem @@ -1,6 +1,7 @@ # Licensed under LGPL # Updated 6-18-08 by Mike Sivill +# Updated and modified by Norbert Márkus (hamilfonz at gmail dot com), Hungary, 2023. # You must edit this file as explained in the documentation to get # proper output. @@ -33,7 +34,8 @@ msubsup msubsup ,^;,^~,^" msup msup ,^~,^" matrix mtable mtd mtd \*\ec -mtext mtext +#text items are surrounded by a preceding and a trailing space and receive a single-word switch indicator +mtext mtext \s^\,^',\s mtr mtr ^`^\,^(,\*^`^\,^)\er munder munder ^",^%,^} munderover munderover ^",^%,^<,^} diff --git a/tests/Makefile.am b/tests/Makefile.am index 497fe548..21e0294f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -578,6 +578,7 @@ XFAIL_TESTS += \ nemeth_MathCAT/nested_super_space_79_d_7.test \ nemeth_MathCAT/non_hyper_complex_frac_67_1.test \ nemeth_MathCAT/non_list_10_4.test \ + nemeth_MathCAT/number_space_after.test \ nemeth_MathCAT/number_space_before.test \ nemeth_MathCAT/number_space_before_and_after.test \ nemeth_MathCAT/order2_overbar_87_a_1.test \ From 1461a8ebbff9c6e6b3a2e205165072c9be6f0fc5 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Tue, 20 Jun 2023 14:05:52 +0200 Subject: [PATCH 07/21] Define matrix style in tests/mathml_nemeth/style.cfg Signed-off-by: Attila Hammer --- tests/mathml_nemeth/styles.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/mathml_nemeth/styles.cfg b/tests/mathml_nemeth/styles.cfg index e69de29b..ba0a0661 100644 --- a/tests/mathml_nemeth/styles.cfg +++ b/tests/mathml_nemeth/styles.cfg @@ -0,0 +1,2 @@ +style matrix + format alignColumnsLeft From efd1f3e30912ce7db6439080d7a79018bd75fdf5 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Wed, 21 Jun 2023 11:43:42 +0200 Subject: [PATCH 08/21] Handle bevelled fraction lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/nemeth.sem | 1 + tests/Makefile.am | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lbu_files/nemeth.sem b/lbu_files/nemeth.sem index accbb070..6f22a9f2 100644 --- a/lbu_files/nemeth.sem +++ b/lbu_files/nemeth.sem @@ -11,6 +11,7 @@ maligngroup maligngroup malignmark malignmark math math \eb,\*\ee menclose menclose +mfrac mfrac,bevelled,true ^?,^_/,^# mfrac mfrac ^?,/,^# mfenced mfenced ^(,^) mfenced mfenced,open,{ ^{,^} diff --git a/tests/Makefile.am b/tests/Makefile.am index 21e0294f..ccd3de6c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -441,7 +441,6 @@ XFAIL_TESTS += \ printPageNumberRange_03.test \ mathml_nemeth/general_002.test \ mathml_nemeth/general_003.test \ - mathml_nemeth/mfrac_02.test \ mathml_nemeth/mfrac_03.test \ mathml_nemeth/mfrac_04.test \ mathml_nemeth/mfrac_06.test \ @@ -491,7 +490,6 @@ XFAIL_TESTS += \ nemeth_MathCAT/arrow_96_4.test \ nemeth_MathCAT/as_multiscript_nested_sub_sup_74_c_5.test \ nemeth_MathCAT/bar_97_b_1.test \ - nemeth_MathCAT/beveled_frac_62_b_1.test \ nemeth_MathCAT/binomial_90_1.test \ nemeth_MathCAT/boldface_32_b_3.test \ nemeth_MathCAT/boldface_32_b_6.test \ From bc6e89f445eb8526b004c0e050202f3d6e8a464d Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Wed, 21 Jun 2023 12:08:12 +0200 Subject: [PATCH 09/21] Fix termination of mixed numbers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/nemeth.ctb | 5 +++-- tests/Makefile.am | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lbu_files/nemeth.ctb b/lbu_files/nemeth.ctb index d5867d24..ca3ad714 100644 --- a/lbu_files/nemeth.ctb +++ b/lbu_files/nemeth.ctb @@ -322,8 +322,9 @@ noback pass3 @5-1b-15 @1b-15 #(2023) # get rid of superscript ind. on prime sign noback pass2 @45-3-5 @3 # Put 456 in mixed numbers -noback pass2 $d[]@1456 @456 -noback pass2 @456-1456!$s3-8[]@3456 @456 +noback pass2 $d[]@1456 @456#1=1 #(2023) +#noback pass2 @456-1456!$s3-8[]@3456 @456 +noback pass2 #1=1[]@3456 @456#1=0 #(2023) # Put number sign on numbers after spaces noback pass2 @a[]$d @3456 noback pass2 [@a-0]$d @a-3456 diff --git a/tests/Makefile.am b/tests/Makefile.am index ccd3de6c..d9d3a666 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -441,7 +441,6 @@ XFAIL_TESTS += \ printPageNumberRange_03.test \ mathml_nemeth/general_002.test \ mathml_nemeth/general_003.test \ - mathml_nemeth/mfrac_03.test \ mathml_nemeth/mfrac_04.test \ mathml_nemeth/mfrac_06.test \ mathml_nemeth/mfrac_07.test \ @@ -543,7 +542,6 @@ XFAIL_TESTS += \ nemeth_MathCAT/menclose_lesson_12_5_5_5.test \ nemeth_MathCAT/menclose_primed_86_b_6.test \ nemeth_MathCAT/menclose_top_bottom_88_1.test \ - nemeth_MathCAT/mixed_frac_63_a_1.test \ nemeth_MathCAT/mixed_frac_64_2.test \ nemeth_MathCAT/mmultiscripts_77_4_10.test \ nemeth_MathCAT/mmultiscripts_77_4_18.test \ From 23001fde23c74475d1c8ab7d06e83d8635435904 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Thu, 22 Jun 2023 08:17:14 +0200 Subject: [PATCH 10/21] Make the prefix of numeric subscripts remain absent when preceded by letter with prime(s) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/nemeth.ctb | 11 ++++++++--- tests/Makefile.am | 7 ------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lbu_files/nemeth.ctb b/lbu_files/nemeth.ctb index ca3ad714..26d7c66d 100644 --- a/lbu_files/nemeth.ctb +++ b/lbu_files/nemeth.ctb @@ -88,8 +88,8 @@ endcomp 456-156 prepunc " 236 postpunc " 356 -prepunc ' 6-236 -postpunc ' 356-3 +#prepunc ' 6-236 #(2023) +#postpunc ' 356-3 #(2023) postpunc , 6 always , 6-a always # 35-2345 print number sign before number @@ -304,10 +304,14 @@ noback pass3 @1b-12-56$d1-5[@5] @5 #(2023) ##noback pass2 $l@56$d1-5[@5]@56 ? #(2023) ##noback pass3 $l@56$d1-5[@56] @56 #(2023) -#Remove the subscript prefix if it is preceded by a letter. +#Remove the subscript prefix if it is preceded by a letter or a letter and prime(s). #But after this numeric subscript, do not remove the base-line ind. if it is followed by a number noback pass2 $l@56$d1-5[@5]!$d ? #added in 2023 +noback pass2 $l@3-56$d1-5[@5]!$d ? #added in 2023 +noback pass2 $l@3-3-56$d1-5[@5]!$d ? #added in 2023 noback pass3 $l[@56]$d1-5 ? #added in 2023 +noback pass3 $l@3[@56]$d1-5 ? #added in 2023 +noback pass3 $l@3-3[@56]$d1-5 ? #added in 2023 # insert another superscript ind. on double superscripts #noback pass2 @45[]$d@5-5 @45 #often it does not yield the expected output (2023) @@ -321,6 +325,7 @@ noback pass2 @5-1b-15 @1b-15 noback pass3 @5-1b-15 @1b-15 #(2023) # get rid of superscript ind. on prime sign noback pass2 @45-3-5 @3 +noback pass2 @45-3-3-5 @3-3 #(2023) # Put 456 in mixed numbers noback pass2 $d[]@1456 @456#1=1 #(2023) #noback pass2 @456-1456!$s3-8[]@3456 @456 diff --git a/tests/Makefile.am b/tests/Makefile.am index d9d3a666..7c9de4ba 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -447,7 +447,6 @@ XFAIL_TESTS += \ mathml_nemeth/mixed_scripts_01.test \ mathml_nemeth/mixed_scripts_02.test \ mathml_nemeth/mixed_scripts_03.test \ - mathml_nemeth/mixed_scripts_04.test \ mathml_nemeth/mixed_scripts_05.test \ mathml_nemeth/mixed_scripts_06.test \ mathml_nemeth/mixed_scripts_07.test \ @@ -465,7 +464,6 @@ XFAIL_TESTS += \ mathml_nemeth/msup_03.test \ mathml_nemeth/msup_06.test \ mathml_nemeth/msup_09.test \ - mathml_nemeth/msup_10.test \ mathml_nemeth/msqrt_03.test \ mathml_nemeth/mmultiscripts_01.test \ mathml_nemeth/mmultiscripts_02.test \ @@ -583,16 +581,11 @@ XFAIL_TESTS += \ nemeth_MathCAT/prescript_77_4_7.test \ nemeth_MathCAT/prime_172_5.test \ nemeth_MathCAT/prime_172_6.test \ - nemeth_MathCAT/prime_172_8.test \ - nemeth_MathCAT/prime_172_9.test \ - nemeth_MathCAT/prime_77_4_4.test \ nemeth_MathCAT/prime_83_b_1.test \ nemeth_MathCAT/prime_83_b_3.test \ - nemeth_MathCAT/prime_83_b_4.test \ nemeth_MathCAT/prime_83_b_5.test \ nemeth_MathCAT/prime_83_b_6.test \ nemeth_MathCAT/prime_83_b_8.test \ - nemeth_MathCAT/prime_mathjax_83_b_2.test \ nemeth_MathCAT/prime_mmultiscripts_83_b_2.test \ nemeth_MathCAT/prime_mmultiscripts_83_b_4.test \ nemeth_MathCAT/prime_wiris_83_b_2.test \ From 4824a97d558e9daec41e4ba696e05dbbdb54962c Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Fri, 23 Jun 2023 10:40:43 +0200 Subject: [PATCH 11/21] Fix boldface indicator with English and Greek letters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If an English lowercase or capital letter, or a Greek lowercase, math variant or capital letter appears within a letter element, now it is preceded by a Nemeth boldface indicator. Moreover, the contracted form of a horizontal bar over or under a single letter is extended to Greek letters and boldface English and Greek letters. Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/nemeth.ctb | 37 ++++++++++++++++++++++++++++++++----- lbu_files/nemeth.sem | 2 +- tests/Makefile.am | 3 --- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/lbu_files/nemeth.ctb b/lbu_files/nemeth.ctb index 26d7c66d..10db00a9 100644 --- a/lbu_files/nemeth.ctb +++ b/lbu_files/nemeth.ctb @@ -69,6 +69,7 @@ punctuation ; 456-23-0 #Added in 2023 include nemethdefs.cti include en-chardefs.cti All character definition opcodes attribute mathdot \x00B7\x02D9\x22C5 +attribute greekletter abgdez:?jklmnxoprstuf&yw3 # Braille indicators multind 56-6 letsign capsletter @@ -343,15 +344,41 @@ noback pass2 @0-a @a noback pass2 @45-0-5 @45 noback pass2 @45-5 @45 +#Handle bold prefix on English and Greek lower-case and capital letters +#noback pass2 @456-56-46 @456-46 #remove English letter sign from before Greek letters (2023) +noback pass2 @456-56-46-6[%greekletter] @456-46-6* #remove the unnecessary English letter sign (2023) +noback pass2 @456-56-46-4[%greekletter] @456-46-4* #remove the unnecessary English letter sign (2023) +noback pass2 @456-56-46[%greekletter] @456-46* #remove the unnecessary English letter sign (2023) +noback pass2 @456-56-6$l * #English capital letter with bold prefix must remain unchanged (2023) +noback pass2 @456-56$l * #English lower-case letter must remain unchanged (2023) +noback pass2 @456-56 ? #Otherwise the prefix is removed (2023) + # Fix single letter and digit with overbar #noback pass2 @5$l[@126-12456] @156 -noback pass2 @5[$l]@126-156-12456 *@156 #(2023) -noback pass2 @5[@6$l]@126-156-12456 *@156 #(2023) -noback pass2 @5[$d]@126-156-12456 *@156 #(2023) +noback pass2 @5[$l]@126-156-12456 *@156 #English small letter (2023) +noback pass2 @5[@6$l]@126-156-12456 *@156 #English capital letter (2023) +noback pass2 @5[@456-56$l]@126-156-12456 *@156 #boldface English small letter (2023) +noback pass2 @5[@456-56-6$l]@126-156-12456 *@156 #boldface English capital letter (2023) +noback pass2 @5[@46%greekletter]@126-156-12456 *@156 #Greek small letter (2023) +noback pass2 @5[@46-4%greekletter]@126-156-12456 *@156 #Greek small letter math variant (2023) +noback pass2 @5[@46-6%greekletter]@126-156-12456 *@156 #Greek capital letter (2023) +noback pass2 @5-456-56[@46%greekletter]@126-156-12456 @456*@156 #boldface Greek small letter (2023) +noback pass2 @5-456-56[@46-4%greekletter]@126-156-12456 @456*@156 #boldface Greek small letter math variant (2023) +noback pass2 @5-456-56[@46-6%greekletter]@126-156-12456 @456*@156 #boldface Greek capital letter (2023) +noback pass2 @5[$d]@126-156-12456 *@156 #digit (2023) # Fix single letter and digit with bar directly under -noback pass2 @5[$l]@146-156-12456 *@146-156 #(2023) -noback pass2 @5[@6$l]@146-156-12456 *@146-156 #(2023) +noback pass2 @5[$l]@146-156-12456 *@146-156 #English small letter (2023) +noback pass2 @5[@6$l]@146-156-12456 *@146-156 #English capital letter (2023) + +noback pass2 @5[@456-56$l]@146-156-12456 *@146-156 #boldface English small letter (2023) +noback pass2 @5[@456-56-6$l]@146-156-12456 *@146-156 #boldface English capital letter (2023) +noback pass2 @5[@46%greekletter]@146-156-12456 *@146-156 #Greek small letter (2023) +noback pass2 @5[@46-4%greekletter]@146-156-12456 *@146-156 #Greek small letter math variant (2023) +noback pass2 @5[@46-6%greekletter]@146-156-12456 *@146-156 #Greek capital letter (2023) +noback pass2 @5-456-56[@46%greekletter]@146-156-12456 @456*@146-156 #boldface Greek small letter (2023) +noback pass2 @5-456-56[@46-4%greekletter]@146-156-12456 @456*@146-156 #boldface Greek small letter math variant (2023) +noback pass2 @5-456-56[@46-6%greekletter]@146-156-12456 @456*@146-156 #boldface Greek capital letter (2023) noback pass2 @5[$d]@146-156-12456 *@146-156 #(2023) #It is sufficient to indicate one dot above a series of digits if two or more consecutive digits each have a dot above diff --git a/lbu_files/nemeth.sem b/lbu_files/nemeth.sem index 6f22a9f2..c8290d03 100644 --- a/lbu_files/nemeth.sem +++ b/lbu_files/nemeth.sem @@ -104,7 +104,7 @@ skip mphantom no mo,maxsize no mo,maxsize,3 no mo,mathsize -no mi,mathvariant +mi mi,mathvariant,bold ^_^; no mo,mathvariant no munder,accentunder no mn,mathvariant diff --git a/tests/Makefile.am b/tests/Makefile.am index 7c9de4ba..95034ca0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -472,9 +472,7 @@ XFAIL_TESTS += \ mathml_nemeth/mmultiscripts_05.test \ mathml_nemeth/mmultiscripts_06.test \ mathml_nemeth/mmultiscripts_07.test \ - mathml_nemeth/mover_04.test \ mathml_nemeth/mover_05.test \ - mathml_nemeth/mover_06.test \ mathml_nemeth/mover_07.test \ mathml_nemeth/mover_13.test \ mathml_nemeth/mover_15.test \ @@ -576,7 +574,6 @@ XFAIL_TESTS += \ nemeth_MathCAT/number_space_before.test \ nemeth_MathCAT/number_space_before_and_after.test \ nemeth_MathCAT/order2_overbar_87_a_1.test \ - nemeth_MathCAT/overbar_86_b_11.test \ nemeth_MathCAT/prescript_77_4_6.test \ nemeth_MathCAT/prescript_77_4_7.test \ nemeth_MathCAT/prime_172_5.test \ From 42b5d9bedb3f8117605f65c198fc14195289fbe8 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Sat, 24 Jun 2023 12:37:51 +0200 Subject: [PATCH 12/21] Fix the priority of a rule which removed a dot 5 too soon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Formerly it was a pass2 rule which executed too soon preventing a contracted notation of a bar over or under a letter at the beginning of a nesting mover or under. Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/nemeth.ctb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbu_files/nemeth.ctb b/lbu_files/nemeth.ctb index 10db00a9..0091b657 100644 --- a/lbu_files/nemeth.ctb +++ b/lbu_files/nemeth.ctb @@ -317,7 +317,7 @@ noback pass3 $l@3-3[@56]$d1-5 ? #added in 2023 # insert another superscript ind. on double superscripts #noback pass2 @45[]$d@5-5 @45 #often it does not yield the expected output (2023) #get rid of extra baseline inds. -noback pass2 @5-5 @5 +noback pass4 @5-5 @5 noback pass2 @5-0 @0 noback pass3 @5-0 @0 #(2023) noback pass2 @5-a @a From 5e7b5d449ad4b13f8446d0d0d5249fb4fbdfd0a4 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Mon, 26 Jun 2023 15:27:16 +0200 Subject: [PATCH 13/21] Add missing character definition for \x00A8 (DIAERESIS/DOUBLE DOTS) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit to appear as two consecutive math dots in math expressions. Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/nemeth.ctb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lbu_files/nemeth.ctb b/lbu_files/nemeth.ctb index 0091b657..d36f7ddf 100644 --- a/lbu_files/nemeth.ctb +++ b/lbu_files/nemeth.ctb @@ -71,6 +71,8 @@ include en-chardefs.cti All character definition opcodes attribute mathdot \x00B7\x02D9\x22C5 attribute greekletter abgdez:?jklmnxoprstuf&yw3 +math \x00a8 16-16 DIAERESIS (double dots) in math expressions #(2023) + # Braille indicators multind 56-6 letsign capsletter capsletter 6 From 137d7b39f2e7fb81543452b41a5ace91206ef17a Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Mon, 26 Jun 2023 21:14:12 +0200 Subject: [PATCH 14/21] Introduce a space following the subscript or superscript of the log function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Later it may be extended to other function names. Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/nemeth.ctb | 4 ++++ tests/Makefile.am | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lbu_files/nemeth.ctb b/lbu_files/nemeth.ctb index d36f7ddf..2755c279 100644 --- a/lbu_files/nemeth.ctb +++ b/lbu_files/nemeth.ctb @@ -70,6 +70,7 @@ include nemethdefs.cti include en-chardefs.cti All character definition opcodes attribute mathdot \x00B7\x02D9\x22C5 attribute greekletter abgdez:?jklmnxoprstuf&yw3 +attribute notadotfiveorspaceorescape abcdefghijklmnopqrstuvwxyz1234567890'+!%/=(),.-?:_<>&@{};*~^`[]$|\x0023\x005C math \x00a8 16-16 DIAERESIS (double dots) in math expressions #(2023) @@ -309,6 +310,9 @@ noback pass3 @1b-12-56$d1-5[@5] @5 #(2023) #Remove the subscript prefix if it is preceded by a letter or a letter and prime(s). #But after this numeric subscript, do not remove the base-line ind. if it is followed by a number +noback pass2 @123-135-1245-56$d1-5[@5] @a #following the subscript, introduce a space required for the function abbreviation (log) (2023) +noback pass2 @123-135-1245-56%notadotfiveorspaceorescape1-100[@5] @a #following the subscript, introduce a space required for the function abbreviation (log) (2023) +noback pass2 @123-135-1245-45%notadotfiveorspaceorescape1-100[@5] @a #following the subscript, introduce a space required for the function abbreviation (log) (2023) noback pass2 $l@56$d1-5[@5]!$d ? #added in 2023 noback pass2 $l@3-56$d1-5[@5]!$d ? #added in 2023 noback pass2 $l@3-3-56$d1-5[@5]!$d ? #added in 2023 diff --git a/tests/Makefile.am b/tests/Makefile.am index 95034ca0..ff056b76 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -452,7 +452,6 @@ XFAIL_TESTS += \ mathml_nemeth/mixed_scripts_07.test \ mathml_nemeth/msub_02.test \ mathml_nemeth/msub_03.test \ - mathml_nemeth/msub_05.test \ mathml_nemeth/msub_08.test \ mathml_nemeth/msub_09.test \ mathml_nemeth/msub_10.test \ From c1bdde9e44516e3a072388c9f753e821b5f6184a Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Wed, 28 Jun 2023 18:05:40 +0200 Subject: [PATCH 15/21] Remove unnecessary comments Signed-off-by: Attila Hammer --- lbu_files/nemeth.ctb | 262 ++++++++---------- .../nemeth_edit_with_switch_indicators.ctb | 40 ++- 2 files changed, 141 insertions(+), 161 deletions(-) diff --git a/lbu_files/nemeth.ctb b/lbu_files/nemeth.ctb index 2755c279..a7f6b201 100644 --- a/lbu_files/nemeth.ctb +++ b/lbu_files/nemeth.ctb @@ -60,10 +60,8 @@ math / 34 math > 345 math + 346 math ~ 45 -punctuation : 456-25-0 #Added in 2023 -punctuation ; 456-23-0 #Added in 2023 -#sign \x00F7 46-34 DIVISION SIGN #added then removed in 2023 -#math \x2026 0-3-3-3-0 HORIZONTAL ELLIPSIS 002E 002E 002E #Added then removed in 2023 +punctuation : 456-25-0 +punctuation ; 456-23-0 #Reversed the order of the two include lines below to give priority to the math character definitions include nemethdefs.cti @@ -72,7 +70,7 @@ attribute mathdot \x00B7\x02D9\x22C5 attribute greekletter abgdez:?jklmnxoprstuf&yw3 attribute notadotfiveorspaceorescape abcdefghijklmnopqrstuvwxyz1234567890'+!%/=(),.-?:_<>&@{};*~^`[]$|\x0023\x005C -math \x00a8 16-16 DIAERESIS (double dots) in math expressions #(2023) +math \x00a8 16-16 DIAERESIS (double dots) in math expressions # Braille indicators multind 56-6 letsign capsletter @@ -92,8 +90,6 @@ endcomp 456-156 prepunc " 236 postpunc " 356 -#prepunc ' 6-236 #(2023) -#postpunc ' 356-3 #(2023) postpunc , 6 always , 6-a always # 35-2345 print number sign before number @@ -102,8 +98,6 @@ hyphen - 36 postpunc . 456-256 endnum . 456-256 always . 256 -#postpunc ; 456-23 #Removed in 2023 -#postpunc : 456-25 #Removed in 2023 always ! 12346 factorial always < a-5-13-a always = a-46-13-a @@ -111,7 +105,6 @@ always > a-46-2-a postpunc ? 456-236 endnum % 4-356 always ~~ 4-156-5-4-156 -#always \x2248 a-4-156-4-156-a almost equals #Removed in 2023 always ~ 4-156 always & 456-12346 midnum * 4-16 @@ -123,13 +116,11 @@ always @ 4-1 always \\ 456-16 always | 1256 always $ 4-234 -#always \x27E8 46-46-12356 left angle bracket #Removed in 2023 -#always \x27E9 46-46-23456 right angle bracket #Removed in 2023 always \x2015 156 horizontal bar above accented centered repeated \s 0 noback context ["\x25A1"]$d @1246-256-5 noback context ["\x25A0"]$d @1246-456-256-5 -always \x00b0 45-46-16 #This is not a simple symbol. It also implies a local superscript and may require a baseline suffix (2023) +always \x00b0 45-46-16 #This is not a simple symbol. It also implies a local superscript and may require a baseline suffix always \x00B1 346-36 # semantic character pairs @@ -149,7 +140,6 @@ math \xf321 45 replace \xf401\xf321 always \xf402\xf321 5 # Underscript and overscript -#Apparently no longer done this way (2023) math \xf322 146 always \xf401\xf322 5 always \xf402\xf322 12456 @@ -226,7 +216,7 @@ always ^| 1256 always ^/ 34 always ^* 16 repeated ^1 a -always ^ 456-126 #default the CARET character to its Nemeth Braille representation if it has not been consumed as a prefix in the lines above (2023) +always ^ 456-126 #default the CARET character to its Nemeth Braille representation if it has not been consumed as a prefix in the lines above # Function names and abbreviations always acos 1-14-135-234-a @@ -257,12 +247,12 @@ always sinh 234-24-1345-125-a always tan 2345-1-1345-a always tanh 2345-1-135-125-a always vers 1236-15-1235-234-a -always sgn 234-1245-1345-a #Added in 2023 -always tg 2345-1245-a #Added in 2023 -always ctg 14-2345-1245-a #Added in 2023 -always lg 123-1245-a #Added in 2023 -always arcsin 1-1235-14-234-24-1345-a #Added in 2023 -always arctg 1-1235-14-2345-1245-a #Added in 2023 +always sgn 234-1245-1345-a +always tg 2345-1245-a +always ctg 14-2345-1245-a +always lg 123-1245-a +always arcsin 1-1235-14-234-24-1345-a +always arctg 1-1235-14-2345-1245-a # computer braille character sequences compbrl :// URLs @@ -288,55 +278,47 @@ compbrl .zip # pass 2 corrections # get rid of base-line ind. after subscripts -#noback pass2 @56[$d1-5]@5!$d * #removed in 2023. See the following lines below instead -#Handle stand-alone subscripts (2023) -noback pass2 @1b-12-56[]$d1-5@5-1b-15 @3456 #add number sign (2023) -noback pass2 @1b-12-56[]$d1-5@5$s @3456 #(2023) -noback pass2 $s@56[]$d1-5@5-1b-15 @3456 #(2023) -noback pass2 $s@56[]$d1-5@5$s @3456 #(2023) +#Handle stand-alone subscripts +noback pass2 @1b-12-56[]$d1-5@5-1b-15 @3456 +noback pass2 @1b-12-56[]$d1-5@5$s @3456 +noback pass2 $s@56[]$d1-5@5-1b-15 @3456 +noback pass2 $s@56[]$d1-5@5$s @3456 #handle prescribed subscripts -noback pass2 @1b-12-56$d1-5[@5]@45 ? #testing for a preceding letter won't work because the math start sign ends with letter b (2023) -noback pass2 @1b-12-56$d1-5[@5]@56 ? #(2023) -noback pass2 @1b-12-56$d1-5[@5] @5 #(2023) -noback pass3 @1b-12-56$d1-5[@5] @5 #(2023) +noback pass2 @1b-12-56$d1-5[@5]@45 ? #testing for a preceding letter won't work because the math start sign ends with letter b +noback pass2 @1b-12-56$d1-5[@5]@56 ? +noback pass2 @1b-12-56$d1-5[@5] @5 +noback pass3 @1b-12-56$d1-5[@5] @5 #Preserve the subscript ind. and the base-line ind. if the subscript is not preceded by a letter #but remove the base-line ind. if the subscript is either followed by a superscript or a subscript -##noback pass2 $l@56$d1-5[@5]@45 ? #(2023) -##noback pass3 $l@56$d1-5[@45] @45 #(2023) -##noback pass2 $l@56$d1-5[@5]@56 ? #(2023) -##noback pass3 $l@56$d1-5[@56] @56 #(2023) - #Remove the subscript prefix if it is preceded by a letter or a letter and prime(s). #But after this numeric subscript, do not remove the base-line ind. if it is followed by a number -noback pass2 @123-135-1245-56$d1-5[@5] @a #following the subscript, introduce a space required for the function abbreviation (log) (2023) -noback pass2 @123-135-1245-56%notadotfiveorspaceorescape1-100[@5] @a #following the subscript, introduce a space required for the function abbreviation (log) (2023) -noback pass2 @123-135-1245-45%notadotfiveorspaceorescape1-100[@5] @a #following the subscript, introduce a space required for the function abbreviation (log) (2023) -noback pass2 $l@56$d1-5[@5]!$d ? #added in 2023 -noback pass2 $l@3-56$d1-5[@5]!$d ? #added in 2023 -noback pass2 $l@3-3-56$d1-5[@5]!$d ? #added in 2023 -noback pass3 $l[@56]$d1-5 ? #added in 2023 -noback pass3 $l@3[@56]$d1-5 ? #added in 2023 -noback pass3 $l@3-3[@56]$d1-5 ? #added in 2023 +noback pass2 @123-135-1245-56$d1-5[@5] @a #following the subscript, introduce a space required for the function abbreviation (log) +noback pass2 @123-135-1245-56%notadotfiveorspaceorescape1-100[@5] @a #following the subscript, introduce a space required for the function abbreviation (log) +noback pass2 @123-135-1245-45%notadotfiveorspaceorescape1-100[@5] @a #following the subscript, introduce a space required for the function abbreviation (log) +noback pass2 $l@56$d1-5[@5]!$d ? +noback pass2 $l@3-56$d1-5[@5]!$d ? +noback pass2 $l@3-3-56$d1-5[@5]!$d ? +noback pass3 $l[@56]$d1-5 ? +noback pass3 $l@3[@56]$d1-5 ? +noback pass3 $l@3-3[@56]$d1-5 ? # insert another superscript ind. on double superscripts -#noback pass2 @45[]$d@5-5 @45 #often it does not yield the expected output (2023) #get rid of extra baseline inds. noback pass4 @5-5 @5 noback pass2 @5-0 @0 -noback pass3 @5-0 @0 #(2023) +noback pass3 @5-0 @0 noback pass2 @5-a @a -noback pass3 @5-a @a #(2023) +noback pass3 @5-a @a noback pass2 @5-1b-15 @1b-15 -noback pass3 @5-1b-15 @1b-15 #(2023) +noback pass3 @5-1b-15 @1b-15 # get rid of superscript ind. on prime sign noback pass2 @45-3-5 @3 -noback pass2 @45-3-3-5 @3-3 #(2023) +noback pass2 @45-3-3-5 @3-3 # Put 456 in mixed numbers -noback pass2 $d[]@1456 @456#1=1 #(2023) -#noback pass2 @456-1456!$s3-8[]@3456 @456 -noback pass2 #1=1[]@3456 @456#1=0 #(2023) +noback pass2 $d[]@1456 @456#1=1 +noback pass2 #1=1[]@3456 @456#1=0 # # Put number sign on numbers after spaces noback pass2 @a[]$d @3456 noback pass2 [@a-0]$d @a-3456 @@ -351,47 +333,47 @@ noback pass2 @45-0-5 @45 noback pass2 @45-5 @45 #Handle bold prefix on English and Greek lower-case and capital letters -#noback pass2 @456-56-46 @456-46 #remove English letter sign from before Greek letters (2023) -noback pass2 @456-56-46-6[%greekletter] @456-46-6* #remove the unnecessary English letter sign (2023) -noback pass2 @456-56-46-4[%greekletter] @456-46-4* #remove the unnecessary English letter sign (2023) -noback pass2 @456-56-46[%greekletter] @456-46* #remove the unnecessary English letter sign (2023) -noback pass2 @456-56-6$l * #English capital letter with bold prefix must remain unchanged (2023) -noback pass2 @456-56$l * #English lower-case letter must remain unchanged (2023) -noback pass2 @456-56 ? #Otherwise the prefix is removed (2023) +#noback pass2 @456-56-46 @456-46 #remove English letter sign from before Greek letters +noback pass2 @456-56-46-6[%greekletter] @456-46-6* #remove the unnecessary English letter sign +noback pass2 @456-56-46-4[%greekletter] @456-46-4* #remove the unnecessary English letter sign +noback pass2 @456-56-46[%greekletter] @456-46* #remove the unnecessary English letter sign +noback pass2 @456-56-6$l * #English capital letter with bold prefix must remain unchanged +noback pass2 @456-56$l * #English lower-case letter must remain unchanged +noback pass2 @456-56 ? #Otherwise the prefix is removed # Fix single letter and digit with overbar #noback pass2 @5$l[@126-12456] @156 -noback pass2 @5[$l]@126-156-12456 *@156 #English small letter (2023) -noback pass2 @5[@6$l]@126-156-12456 *@156 #English capital letter (2023) -noback pass2 @5[@456-56$l]@126-156-12456 *@156 #boldface English small letter (2023) -noback pass2 @5[@456-56-6$l]@126-156-12456 *@156 #boldface English capital letter (2023) -noback pass2 @5[@46%greekletter]@126-156-12456 *@156 #Greek small letter (2023) -noback pass2 @5[@46-4%greekletter]@126-156-12456 *@156 #Greek small letter math variant (2023) -noback pass2 @5[@46-6%greekletter]@126-156-12456 *@156 #Greek capital letter (2023) -noback pass2 @5-456-56[@46%greekletter]@126-156-12456 @456*@156 #boldface Greek small letter (2023) -noback pass2 @5-456-56[@46-4%greekletter]@126-156-12456 @456*@156 #boldface Greek small letter math variant (2023) -noback pass2 @5-456-56[@46-6%greekletter]@126-156-12456 @456*@156 #boldface Greek capital letter (2023) -noback pass2 @5[$d]@126-156-12456 *@156 #digit (2023) +noback pass2 @5[$l]@126-156-12456 *@156 #English small letter +noback pass2 @5[@6$l]@126-156-12456 *@156 #English capital letter +noback pass2 @5[@456-56$l]@126-156-12456 *@156 #boldface English small letter +noback pass2 @5[@456-56-6$l]@126-156-12456 *@156 #boldface English capital letter +noback pass2 @5[@46%greekletter]@126-156-12456 *@156 #Greek small letter +noback pass2 @5[@46-4%greekletter]@126-156-12456 *@156 #Greek small letter math variant +noback pass2 @5[@46-6%greekletter]@126-156-12456 *@156 #Greek capital letter +noback pass2 @5-456-56[@46%greekletter]@126-156-12456 @456*@156 #boldface Greek small letter +noback pass2 @5-456-56[@46-4%greekletter]@126-156-12456 @456*@156 #boldface Greek small letter math variant +noback pass2 @5-456-56[@46-6%greekletter]@126-156-12456 @456*@156 #boldface Greek capital letter +noback pass2 @5[$d]@126-156-12456 *@156 #digit # Fix single letter and digit with bar directly under -noback pass2 @5[$l]@146-156-12456 *@146-156 #English small letter (2023) -noback pass2 @5[@6$l]@146-156-12456 *@146-156 #English capital letter (2023) +noback pass2 @5[$l]@146-156-12456 *@146-156 #English small letter +noback pass2 @5[@6$l]@146-156-12456 *@146-156 #English capital letter -noback pass2 @5[@456-56$l]@146-156-12456 *@146-156 #boldface English small letter (2023) -noback pass2 @5[@456-56-6$l]@146-156-12456 *@146-156 #boldface English capital letter (2023) -noback pass2 @5[@46%greekletter]@146-156-12456 *@146-156 #Greek small letter (2023) -noback pass2 @5[@46-4%greekletter]@146-156-12456 *@146-156 #Greek small letter math variant (2023) -noback pass2 @5[@46-6%greekletter]@146-156-12456 *@146-156 #Greek capital letter (2023) -noback pass2 @5-456-56[@46%greekletter]@146-156-12456 @456*@146-156 #boldface Greek small letter (2023) -noback pass2 @5-456-56[@46-4%greekletter]@146-156-12456 @456*@146-156 #boldface Greek small letter math variant (2023) -noback pass2 @5-456-56[@46-6%greekletter]@146-156-12456 @456*@146-156 #boldface Greek capital letter (2023) -noback pass2 @5[$d]@146-156-12456 *@146-156 #(2023) +noback pass2 @5[@456-56$l]@146-156-12456 *@146-156 #boldface English small letter +noback pass2 @5[@456-56-6$l]@146-156-12456 *@146-156 #boldface English capital letter +noback pass2 @5[@46%greekletter]@146-156-12456 *@146-156 #Greek small letter +noback pass2 @5[@46-4%greekletter]@146-156-12456 *@146-156 #Greek small letter math variant +noback pass2 @5[@46-6%greekletter]@146-156-12456 *@146-156 #Greek capital letter +noback pass2 @5-456-56[@46%greekletter]@146-156-12456 @456*@146-156 #boldface Greek small letter +noback pass2 @5-456-56[@46-4%greekletter]@146-156-12456 @456*@146-156 #boldface Greek small letter math variant +noback pass2 @5-456-56[@46-6%greekletter]@146-156-12456 @456*@146-156 #boldface Greek capital letter +noback pass2 @5[$d]@146-156-12456 *@146-156 #It is sufficient to indicate one dot above a series of digits if two or more consecutive digits each have a dot above -noback pass2 @5$d2-100@126[%mathdot2-100]@12456 @16 #(2023) +noback pass2 @5$d2-100@126[%mathdot2-100]@12456 @16 #noback pass2 [@5]!$s@156 @a noback pass2 @46-a @456-256 -noback pass2 [@456-256]@5$d @46 #(2023) +noback pass2 [@456-256]@5$d @46 # get rid of space for overscripts noback pass2 @126-a @126 noback pass2 @146-a @146 @@ -409,69 +391,69 @@ noback pass2 @1256-4-6-12356 @4-6-12356 # take off baseline ind. comma space noback pass2 [@5-6]!$l @6 noback pass2 @1b-12[]$d @3456 number sign before digit at beginning -noback pass2 @1b-12[]@5$d @3456 #(2023) -noback pass2 $s[]@5$d @3456 #(2023) -noback pass3 @1b-12[]$d @3456 #(2023) +noback pass2 @1b-12[]@5$d @3456 +noback pass2 $s[]@5$d @3456 +noback pass3 @1b-12[]$d @3456 noback pass2 @1b-12-36[]$d @3456 number sign before minus before digit at beginning -noback pass2 @1b-12-5-36[]$d @3456 #(2023) -noback pass2 @1b-12-36[]@5$d @3456 #(2023) -noback pass2 $s@5-36[]$d @3456 #(2023) -noback pass2 $s@36[]@5$d @3456 #(2023) -noback pass3 @1b-12-36[]$d @3456 #(2023) +noback pass2 @1b-12-5-36[]$d @3456 +noback pass2 @1b-12-36[]@5$d @3456 +noback pass2 $s@5-36[]$d @3456 +noback pass2 $s@36[]@5$d @3456 +noback pass3 @1b-12-36[]$d @3456 noback pass2 [@12e]$d @3456 noback pass2 [@12e-36]$d @36-3456 noback pass2 [@12e-46]$d @3456-46 noback pass2 @12e ? noback pass2 @15e ? -#Remove space from behind colon or semicolon when followed by other than a number #Added in 2023 -noback pass2 @456-25[@0]!$d ? #Added in 2023 -noback pass2 @456-23[@0]!$d ? #Added in 2023 -#Insert space between {} for the empty set #Added in 2023 -noback pass2 @46-12356[]@46-23456 @a #Added in 2023 -#Remove space between a grouping symbol and a horizontal ellipsis #Added in 2023 -noback pass2 @46-46-12356[@0]@3-3-3 ? #Added in 2023 -noback pass2 @46-12356[@0]@3-3-3 ? #Added in 2023 -noback pass2 @4-12356[@0]@3-3-3 ? #Added in 2023 -noback pass2 @12356[@0]@3-3-3 ? #Added in 2023 -noback pass2 @3-3-3[@0]@46-46-23456 ? #Added in 2023 -noback pass2 @3-3-3[@0]@46-23456 ? #Added in 2023 -noback pass2 @3-3-3[@0]@4-23456 ? #Added in 2023 -noback pass2 @3-3-3[@0]@23456 ? #Added in 2023 +#Remove space from behind colon or semicolon when followed by other than a number +noback pass2 @456-25[@0]!$d ? +noback pass2 @456-23[@0]!$d ? +#Insert space between {} for the empty set +noback pass2 @46-12356[]@46-23456 @a +#Remove space between a grouping symbol and a horizontal ellipsis +noback pass2 @46-46-12356[@0]@3-3-3 ? +noback pass2 @46-12356[@0]@3-3-3 ? +noback pass2 @4-12356[@0]@3-3-3 ? +noback pass2 @12356[@0]@3-3-3 ? +noback pass2 @3-3-3[@0]@46-46-23456 ? +noback pass2 @3-3-3[@0]@46-23456 ? +noback pass2 @3-3-3[@0]@4-23456 ? +noback pass2 @3-3-3[@0]@23456 ? #function names with superscript, remove the space from before the superscript prefix -noback pass2 @1-14-135-234[@a]@45 ? #acos. 2023 -noback pass2 @1-1345-2345-24-123-135-1245[@a]@45 ? #antilog. 2023 -noback pass2 @1-1235-14[@a]@45 ? #arc. 2023 -noback pass2 @1-1235-14-14-135-234[@a]@45 ? #arccos. 2023 -noback pass2 @1-1235-1245[@a]@45 ? #arg. 2023 -noback pass2 @1-234-24-1345[@a]@45 ? #asin. 2023 -noback pass2 @1-2345-1-1345[@a]@45 ? #atan. 2023 -noback pass2 @14-135-123-135-1245[@a]@45 ? #colog. 2023 -noback pass2 @14-135-234[@a]@45 ? #cos. 2023 -noback pass2 @14-135-234-125[@a]@45 ? #cosh. 2023 -noback pass2 @14-135-2345[@a]@45 ? #cot. 2023 -noback pass2 @14-135-2345-125[@a]@45 ? #coth. 2023 -noback pass2 @14-135-1236-15-1235-234[@a]@45 ? #covers. 2023 -noback pass2 @14-234-14[@a]@45 ? #csc. 2023 -noback pass2 @14-234-14-125[@a]@45 ? #csch. 2023 -noback pass2 @15-1235-124[@a]@45 ? #erf. 2023 -noback pass2 @24-1345-124[@a]@45 ? #inf. 2023 -noback pass2 @123-1345[@a]@45 ? #ln. 2023 -noback pass2 @123-135-1245[@a]@45 ? #log. 2023. -noback pass2 @134-1-1346[@a]@45 ? #max. 2023 -noback pass2 @134-24-1345[@a]@45 ? #min. 2023 -noback pass2 @234-15-14[@a]@45 ? #sec. 2023 -noback pass2 @234-15-14-125[@a]@45 ? #sech. 2023. -noback pass2 @234-24-1345[@a]@45 ? #sin. 2023. -noback pass2 @234-24-1345-125[@a]@45 ? #sinh. 2023 -noback pass2 @2345-1-1345[@a]@45 ? #tan. 2023 -noback pass2 @2345-1-1345-125[@a]@45 ? #tanh. 2023 -noback pass2 @1236-15-1235-234[@a]@45 ? #vers. 2023 -noback pass2 @234-1245-1345[@a]@45 ? #sgn. 2023. -noback pass2 @123-1245[@a]@45 ? #lg. 2023 -noback pass2 @2345-1245[@a]@45 ? #tg with superscript. Added in 2023 -noback pass2 @14-2345-1245[@a]@45 ? #ctg with superscript. Added in 2023 -noback pass2 @1-1235-14-234-24-1345[@a]@45 ? #arcsin with superscript. Added in 2023 -noback pass2 @1-1235-14-2345-1245[@a]@45 ? #arctg with superscript. Added in 2023 +noback pass2 @1-14-135-234[@a]@45 ? #acos +noback pass2 @1-1345-2345-24-123-135-1245[@a]@45 ? #antilog +noback pass2 @1-1235-14[@a]@45 ? #arc +noback pass2 @1-1235-14-14-135-234[@a]@45 ? #arccos +noback pass2 @1-1235-1245[@a]@45 ? #arg +noback pass2 @1-234-24-1345[@a]@45 ? #asin +noback pass2 @1-2345-1-1345[@a]@45 ? #atan +noback pass2 @14-135-123-135-1245[@a]@45 ? #colog +noback pass2 @14-135-234[@a]@45 ? #cos +noback pass2 @14-135-234-125[@a]@45 ? #cosh +noback pass2 @14-135-2345[@a]@45 ? #cot +noback pass2 @14-135-2345-125[@a]@45 ? #coth +noback pass2 @14-135-1236-15-1235-234[@a]@45 ? #covers +noback pass2 @14-234-14[@a]@45 ? #csc +noback pass2 @14-234-14-125[@a]@45 ? #csch +noback pass2 @15-1235-124[@a]@45 ? #erf +noback pass2 @24-1345-124[@a]@45 ? #inf +noback pass2 @123-1345[@a]@45 ? #ln +noback pass2 @123-135-1245[@a]@45 ? #log +noback pass2 @134-1-1346[@a]@45 ? #max +noback pass2 @134-24-1345[@a]@45 ? #min +noback pass2 @234-15-14[@a]@45 ? #sec +noback pass2 @234-15-14-125[@a]@45 ? #sech +noback pass2 @234-24-1345[@a]@45 ? #sin +noback pass2 @234-24-1345-125[@a]@45 ? #sinh +noback pass2 @2345-1-1345[@a]@45 ? #tan +noback pass2 @2345-1-1345-125[@a]@45 ? #tanh +noback pass2 @1236-15-1235-234[@a]@45 ? #vers +noback pass2 @234-1245-1345[@a]@45 ? #sgn +noback pass2 @123-1245[@a]@45 ? #lg +noback pass2 @2345-1245[@a]@45 ? #tg with superscript +noback pass2 @14-2345-1245[@a]@45 ? #ctg with superscript +noback pass2 @1-1235-14-234-24-1345[@a]@45 ? #arcsin with superscript +noback pass2 @1-1235-14-2345-1245[@a]@45 ? #arctg with superscript noback pass4 [$s]$s ? diff --git a/lbu_files/nemeth_edit_with_switch_indicators.ctb b/lbu_files/nemeth_edit_with_switch_indicators.ctb index 9b447c2b..1f024049 100644 --- a/lbu_files/nemeth_edit_with_switch_indicators.ctb +++ b/lbu_files/nemeth_edit_with_switch_indicators.ctb @@ -27,31 +27,29 @@ include en-chardefs.cti repeated \s 0 -always \ee\s`4 1b-15-256 (2023) -always \ee\s`6 1b-15-235 (2023) -always \ee\s`8 1b-15-236 (2023) -always \ee\s`1 1b-15-2 (2023) -always \ee\s`3p 1b-15-4-25-1234 (2023) -always \ee\s`3 1b-15-25 (2023) -always \ee\s`2 1b-15-23 (2023) -always \ee\s`' 1b-15-3 (2023) -always \ee\s- 1b-15-36 (2023) -always \ee\s_/ 1b-15-456-34 (2023) -always \ee\s99 1b-15-35-35 (2023) -always `7\s\eb 2356-1b-12 (2023) -always \ee\s`7 1b-15-2356 (2023) -always `8\s\eb 236-1b-12 (2023) -#always "\s 0 (2023) -#always \s,\s 6-0 (2023) +always \ee\s`4 1b-15-256 +always \ee\s`6 1b-15-235 +always \ee\s`8 1b-15-236 +always \ee\s`1 1b-15-2 +always \ee\s`3p 1b-15-4-25-1234 +always \ee\s`3 1b-15-25 +always \ee\s`2 1b-15-23 +always \ee\s`' 1b-15-3 +always \ee\s- 1b-15-36 +always \ee\s_/ 1b-15-456-34 +always \ee\s99 1b-15-35-35 +always `7\s\eb 2356-1b-12 +always \ee\s`7 1b-15-2356 +always `8\s\eb 236-1b-12 noback correct "\eb\s" "\eb" noback context "\eb"[]$l"\ee" @56 noback context "\eb"[]","$l"\ee" @56 #noback pass2 @1b-12 ? -noback pass2 @1b-12 @456-146-0 #Nemeth block start indicator (2023) +noback pass2 @1b-12 @456-146-0 #Nemeth block start indicator #noback pass2 @1b-15 ? -noback pass2 @1b-15 @0-456-156 Nemeth block end indicator (2023) +noback pass2 @1b-15 @0-456-156 Nemeth block end indicator #Trying to detect whether the math excerpt is preceded and followed by quotes and then restoring the ending quotation mark. -noback pass2 [@236-1b-12] #1=1@236-456-146-0 #(2023) -noback pass2 #1=1[@1b-15-236] #1=0@0-456-156-356 #(2023) -noback pass2 @1b-12-4-4 @456-146-0-4 (2023) +noback pass2 [@236-1b-12] #1=1@236-456-146-0 +noback pass2 #1=1[@1b-15-236] #1=0@0-456-156-356 +noback pass2 @1b-12-4-4 @456-146-0-4 From af2992356d37df04d254a810208dc10805acecb5 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Mon, 3 Jul 2023 11:13:20 +0200 Subject: [PATCH 16/21] Various improvements to Nemeth Improvements based on 11 of the last 20 mathml_nemeth test cases: - More flexible processing of subscripts, superscripts and prime signs. - Improved spacing of some functions and modified expressions. - Improved the appearance of certain braille symbols, and added or corrected character definitions. - Reworked the fix for msub_05 to insert space after the subscript/superscript of the log function, so that now the multipass rules can be executed within the parts in non-numeral subscripts and superscripts. Later this method may be further refined and extended to cover functions other than log. - Fix the braille appearance of a letter or something else having nearly anything in subscript and a single or double prime sign in superscript written in various ways. - Fixed to insert a space required following the material written directly under the lim function. - Added definitions for the concave downward arc (smile) and concave upward arc (frown) characters with their Nemeth braille dot patterns. - Fixed to use the full form of the right arrow when appearing in a modification, and moved the mandatory spaces to surround the entire modification rather than the arrow itself. - Modified the dot pattern of the hollow dot (\x2218). It is often used as a degree sign without being raised to the superscript level, although on the base-line level it signifies a composit function (ring operator). The modified dot pattern addresses this frequent incorrect usage. The required space is inserted between the degree sign and the capital letter for Fahrenheit or Celsius. The ring symbol appears without superscript indication when it is used as a ring operator. - Fix the braille appearance of double dots when ordinary dot characters are used in overscript or underscript. Signed-off-by: Attila Hammer --- lbu_files/nemeth.ctb | 54 +++++++++++++++++++++++++++++++++++++------- lbu_files/nemeth.sem | 6 +++-- tests/Makefile.am | 8 ------- 3 files changed, 50 insertions(+), 18 deletions(-) diff --git a/lbu_files/nemeth.ctb b/lbu_files/nemeth.ctb index a7f6b201..28a4013a 100644 --- a/lbu_files/nemeth.ctb +++ b/lbu_files/nemeth.ctb @@ -63,14 +63,19 @@ math ~ 45 punctuation : 456-25-0 punctuation ; 456-23-0 +math \x2218 45-46-16-5 degrees sign (actually a composit sign, in Braille shown in superscript) + #Reversed the order of the two include lines below to give priority to the math character definitions include nemethdefs.cti include en-chardefs.cti All character definition opcodes +attribute spacetildedotfive \x0020\x00A0~\x0022 +attribute rightbrace } attribute mathdot \x00B7\x02D9\x22C5 attribute greekletter abgdez:?jklmnxoprstuf&yw3 -attribute notadotfiveorspaceorescape abcdefghijklmnopqrstuvwxyz1234567890'+!%/=(),.-?:_<>&@{};*~^`[]$|\x0023\x005C math \x00a8 16-16 DIAERESIS (double dots) in math expressions +math \x2322 1246-1 FROWN (CONCAVE UPWARD ARC) +math \x2323 1246-3 SMILE (CONCAVE DOWNWARD ARC) # Braille indicators multind 56-6 letsign capsletter @@ -91,6 +96,7 @@ endcomp 456-156 prepunc " 236 postpunc " 356 postpunc , 6 +always \e0 5 always , 6-a always # 35-2345 print number sign before number decpoint . 46 @@ -120,7 +126,7 @@ always \x2015 156 horizontal bar above accented centered repeated \s 0 noback context ["\x25A1"]$d @1246-256-5 noback context ["\x25A0"]$d @1246-456-256-5 -always \x00b0 45-46-16 #This is not a simple symbol. It also implies a local superscript and may require a baseline suffix +always \x00b0 45-46-16-5 #This is not a simple symbol. It contains a local superscript and a base-line suffix that may get removed if it is not needed always \x00B1 346-36 # semantic character pairs @@ -275,8 +281,13 @@ compbrl .wav compbrl .tar compbrl .zip -# pass 2 corrections +# multipass corrections +#Fix the context of the hollow dot for its uses as degrees sign or composit operator +noback pass2 @45[@45-46-16-5]@5 * #remove the nesting superscript in cases the degrees sign happens to be in the correct syntax +noback pass3 $d@45-46-16[@5]@6-124 @a #insert space before the F for Fahrenheit +noback pass3 $d@45-46-16[@5]@6-14 @a #insert space before the C for Celsius +noback pass2 $l[@45-46-16-5]$l @46-16 #composit sign between two functions like f ring g # get rid of base-line ind. after subscripts #Handle stand-alone subscripts noback pass2 @1b-12-56[]$d1-5@5-1b-15 @3456 @@ -294,9 +305,26 @@ noback pass3 @1b-12-56$d1-5[@5] @5 #but remove the base-line ind. if the subscript is either followed by a superscript or a subscript #Remove the subscript prefix if it is preceded by a letter or a letter and prime(s). #But after this numeric subscript, do not remove the base-line ind. if it is followed by a number -noback pass2 @123-135-1245-56$d1-5[@5] @a #following the subscript, introduce a space required for the function abbreviation (log) -noback pass2 @123-135-1245-56%notadotfiveorspaceorescape1-100[@5] @a #following the subscript, introduce a space required for the function abbreviation (log) -noback pass2 @123-135-1245-45%notadotfiveorspaceorescape1-100[@5] @a #following the subscript, introduce a space required for the function abbreviation (log) +noback pass2 @123-135-1245-56$d1-5[@5] @a #following a numeric subscript, introduce a space required for the function abbreviation (log) +#If the function "log" has a subscript or superscript, find the indication of its end (\e0 or quotation mark" and replace it with a dot 5 followed by a space +noback context "log"["^;"] @56#11=1 +noback context "log"["^~"] @45#11=1 +noback context #11=1["\e0"] #11=0@5-a +noback context #11=1["\""] #11=0@5-a + +#Handle when a letter has a prime or a double prime in superscript and something else in subscript (needs to be shown in reverse order in Nemeth) +noback context $l[]"^;"!$w1-100"~'^\"" #19=1@3 +noback context $l[]"^;"!$w1-100"~\x2032^\"" #19=1@3 +noback context $l[]"^;"!$w1-100"~''^\"" #18=1@3-3 +noback context $l[]"^;"!$w1-100"~\"^\"" #18=1@3-3 +noback context $l[]"^;"!$w1-100"~\x2033^\"" #18=1@3-3 +noback context #19=1["^~'^\""] #19=0@5 +noback context #19=1["^~\x2032^\""] #19=0@5 +noback context #18=1["^~''^\""] #18=0@5 +noback context #18=1["^~\"^\""] #18=0@5 +noback context #18=1["^~\x2033^\""] #18=0@5 +#Else replace \e0 with a dot 5 unconditionally +noback context "\e0" @5 noback pass2 $l@56$d1-5[@5]!$d ? noback pass2 $l@3-56$d1-5[@5]!$d ? noback pass2 $l@3-3-56$d1-5[@5]!$d ? @@ -304,7 +332,6 @@ noback pass3 $l[@56]$d1-5 ? noback pass3 $l@3[@56]$d1-5 ? noback pass3 $l@3-3[@56]$d1-5 ? -# insert another superscript ind. on double superscripts #get rid of extra baseline inds. noback pass4 @5-5 @5 noback pass2 @5-0 @0 @@ -371,7 +398,10 @@ noback pass2 @5[$d]@146-156-12456 *@146-156 #It is sufficient to indicate one dot above a series of digits if two or more consecutive digits each have a dot above noback pass2 @5$d2-100@126[%mathdot2-100]@12456 @16 -#noback pass2 [@5]!$s@156 @a +#Fix the appearance of double dots in overscript or underscript +noback pass2 @126[@456-256-456-256]@12456 @16-16 +noback pass2 @146[@456-256-456-256]@12456 @16-16 + noback pass2 @46-a @456-256 noback pass2 [@456-256]@5$d @46 # get rid of space for overscripts @@ -383,8 +413,16 @@ noback pass2 @a-12456 @12456 # fix complex fraction begin and end (not perfectly) noback pass2 @1456-1456 @6-1456-1456 noback pass2 @3456-3456 @3456-6-3456 + +#Insert the missing space for "lim" after the termination of the "directly under" passage +noback context []"^\"lim^%"!$x1-100"}" #20=1 +noback context #20=1["^}"] #20=0@12456-a # Fix lim with overbar sign noback pass2 @5-123-24-134-126-12456 @126-123-24-134 +#Fix the modified right arrow: use the full form of the arrow and move its surrounding spaces outside the five-step modification structure +noback context ["^\"\x2192^<"] #21=1@a-5-1246-25-25-135-126 #when something is placed over the arrow +noback context ["^\"\x2192^%"] #21=1@a-5-1246-25-25-135-146 #when something is placed under the arrow +noback context #21=1["^}"] #21=0@12456-a #the space is moved beyond the termination of the modification # Get rid of open paren before matrices noback pass2 @12356-4-6-12356 @4-6-12356 noback pass2 @1256-4-6-12356 @4-6-12356 diff --git a/lbu_files/nemeth.sem b/lbu_files/nemeth.sem index c8290d03..8fbff3f8 100644 --- a/lbu_files/nemeth.sem +++ b/lbu_files/nemeth.sem @@ -29,10 +29,12 @@ ms ms mspace mspace msqrt msqrt ^>,\*^} mstyle mstyle -msub msub ,^;,^" +#There is an escape sequence instead of The dot 5 at the end +msub msub ,^;,\e0 msubsup msupsup ,^~,^~^~,^" msubsup msubsup ,^;,^~,^" -msup msup ,^~,^" +#There is an escape sequence instead of The dot 5 at the end +msup msup ,^~,\e0 matrix mtable mtd mtd \*\ec #text items are surrounded by a preceding and a trailing space and receive a single-word switch indicator diff --git a/tests/Makefile.am b/tests/Makefile.am index ff056b76..ac1d5c6d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -457,8 +457,6 @@ XFAIL_TESTS += \ mathml_nemeth/msub_10.test \ mathml_nemeth/msubsup_03.test \ mathml_nemeth/msubsup_05.test \ - mathml_nemeth/msubsup_06.test \ - mathml_nemeth/msubsup_07.test \ mathml_nemeth/msup_02.test \ mathml_nemeth/msup_03.test \ mathml_nemeth/msup_06.test \ @@ -475,10 +473,7 @@ XFAIL_TESTS += \ mathml_nemeth/mover_07.test \ mathml_nemeth/mover_13.test \ mathml_nemeth/mover_15.test \ - mathml_nemeth/munder_02.test \ mathml_nemeth/munder_03.test \ - mathml_nemeth/munder_06.test \ - mathml_nemeth/munder_07.test \ mathml_nemeth/munderover_03.test \ nemeth_MathCAT/above_and_below_88_2.test \ nemeth_MathCAT/arrow_96_4.test \ @@ -575,9 +570,6 @@ XFAIL_TESTS += \ nemeth_MathCAT/order2_overbar_87_a_1.test \ nemeth_MathCAT/prescript_77_4_6.test \ nemeth_MathCAT/prescript_77_4_7.test \ - nemeth_MathCAT/prime_172_5.test \ - nemeth_MathCAT/prime_172_6.test \ - nemeth_MathCAT/prime_83_b_1.test \ nemeth_MathCAT/prime_83_b_3.test \ nemeth_MathCAT/prime_83_b_5.test \ nemeth_MathCAT/prime_83_b_6.test \ From b08eb2de9dc8c71315e800b1db37d0afad2e038e Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Thu, 6 Jul 2023 19:29:37 +0200 Subject: [PATCH 17/21] Correct handling of print number signs (hash marks) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/nemeth.ctb | 8 +++++++- tests/Makefile.am | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lbu_files/nemeth.ctb b/lbu_files/nemeth.ctb index 28a4013a..28956dbc 100644 --- a/lbu_files/nemeth.ctb +++ b/lbu_files/nemeth.ctb @@ -77,6 +77,8 @@ math \x00a8 16-16 DIAERESIS (double dots) in math expressions math \x2322 1246-1 FROWN (CONCAVE UPWARD ARC) math \x2323 1246-3 SMILE (CONCAVE DOWNWARD ARC) +math \x0023 3456a pseudo hash mark for further processing + # Braille indicators multind 56-6 letsign capsletter capsletter 6 @@ -98,7 +100,8 @@ postpunc " 356 postpunc , 6 always \e0 5 always , 6-a -always # 35-2345 print number sign before number +#always # 35-2345 print number sign before number +always # 3456a number sign (hashmark) in print - a temporary representation for further processing decpoint . 46 hyphen - 36 postpunc . 456-256 @@ -283,6 +286,9 @@ compbrl .zip # multipass corrections +#Process print number sign (hash mark) +noback pass2 [@3456a]$d @46-3456-3456 #a digit following a print hash mark needs its own Braille number sign +noback pass2 @3456a @46-3456 #produce a hash mark symbol when not followed by a number #Fix the context of the hollow dot for its uses as degrees sign or composit operator noback pass2 @45[@45-46-16-5]@5 * #remove the nesting superscript in cases the degrees sign happens to be in the correct syntax noback pass3 $d@45-46-16[@5]@6-124 @a #insert space before the F for Fahrenheit diff --git a/tests/Makefile.am b/tests/Makefile.am index ac1d5c6d..b915a617 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -591,7 +591,6 @@ XFAIL_TESTS += \ nemeth_MathCAT/sub_ind_mmultiscripts_80_b_3.test \ nemeth_MathCAT/superscript_80_a_2.test \ nemeth_MathCAT/tensor_from_mathml_spec.test \ - nemeth_MathCAT/test_9_d_2.test \ nemeth_MathCAT/test_9_d_3.test \ nemeth_MathCAT/text_after_sup_79_c_3.test \ nemeth_MathCAT/trilinear_not_ratio_151_11.test \ From cf6577058b1129ef5c27a0a6c12693adcc3c5609 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Wed, 12 Jul 2023 07:55:22 +0200 Subject: [PATCH 18/21] Fix the percent sign MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit so that it is always represented with its Nemeth braille pattern in a math context even when it does not follow a number Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/nemeth.ctb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lbu_files/nemeth.ctb b/lbu_files/nemeth.ctb index 28956dbc..31d51cb0 100644 --- a/lbu_files/nemeth.ctb +++ b/lbu_files/nemeth.ctb @@ -112,7 +112,7 @@ always < a-5-13-a always = a-46-13-a always > a-46-2-a postpunc ? 456-236 -endnum % 4-356 +#endnum % 4-356 always ~~ 4-156-5-4-156 always ~ 4-156 always & 456-12346 @@ -226,7 +226,7 @@ always ^/ 34 always ^* 16 repeated ^1 a always ^ 456-126 #default the CARET character to its Nemeth Braille representation if it has not been consumed as a prefix in the lines above - +always % 4-356 #default the actual percent sign to its Nemeth Braille representation if it has not been consumed earlier # Function names and abbreviations always acos 1-14-135-234-a always antilog 1-1345-2345-24-123-135-1245-a From 8f4090615843dac266423f1181eea00193fdbba7 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Fri, 4 Aug 2023 11:26:24 +0200 Subject: [PATCH 19/21] Improve nemeth_edit.ctb table for EBAE literary texts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Better handles punctuation, grouping symbols and spacing around math blocks. Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/nemeth_edit.ctb | 54 +++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/lbu_files/nemeth_edit.ctb b/lbu_files/nemeth_edit.ctb index 6ae8296f..3cf658cd 100644 --- a/lbu_files/nemeth_edit.ctb +++ b/lbu_files/nemeth_edit.ctb @@ -1,4 +1,9 @@ # liblouis Table for Post-Translation Editing +#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.ctb # # Based on the Linux screenreader BRLTTY, copyright (C) 1999-2006 by # The BRLTTY Team @@ -22,19 +27,46 @@ # License along with liblouis. If not, see # . +#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 -always \ee\s`4 456-256 -always \ee\s`1 6 -always \ee\s`3 456-25 -always \ee\s`2 456-23 -always `7\s\eb 12356 -always \ee\s`7 23456 +#corrections after the math blocks +always \ee\s,8;s 456-3-234 plural or possessive +always \ee\s`4 456-256 period +always \ee\s`6 456-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 +noback context #1=1["\ee\s`8"] #1=0@456-356 +#Otherwise consider it as a question mark following the Nemeth block +always \ee\s`8 456-236 +#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 +noback context #2=1["\ee\s`'"] #2=0@456-356-3 +#Otherwise consider it as an apostrophe following the Nemeth block +always \ee\s`' 456-3 +always \ee\s`1 6-0 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 0-4-25-1234 +always \ee\s`3 456-25 colon +always \ee\s`2 456-23 semicolon +always `7\s\eb 12356 left parenthesis before math block +always \ee\s`7' 0-4-2356-3 right bracket after math block +always \ee\s`72 0-4-2356-23 right brace after math block +always \ee\s`7 23456 right parenthesis after math block always "\s 0 -always \s,\s 6-0 -noback context "\eb"[]$l"\ee" @56 -noback context "\eb"[]","$l"\ee" @56 +always \s,\s 6-0 use a Nemeth comma +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 ? -noback pass2 @1b-15 ? +noback pass2 @1b-12 ? remove the escape sequences for the beginning of math blocks +noback pass2 @1b-15 ? remove the escape sequences for the end of math blocks noback pass2 @1b-12-4-4 @4 From fe1f7ab59b31aeb6d86084322ba61c153d8c5a53 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Fri, 4 Aug 2023 13:17:48 +0200 Subject: [PATCH 20/21] New improved Nemeth edit table for EBAE literary texts with support for Nemeth switch indicators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This table better handles spacing, punctuation, grouping and other symbols around math blocks. Plus, it borrows Nemeth switch indicators from UEB to mark the beginning and end of each math block, so one can always distinguish between literary text and technical content. Use nemeth_edit_en_us_with_switch_indicators.ctb as editTable along with en-us-g1.ctb or en-us-g2.ctb as mathtextTable. Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/Makefile.am | 2 +- ...meth_edit_en_us_with_switch_indicators.ctb | 80 +++++++++++++++++++ .../nemeth_edit_with_switch_indicators.ctb | 55 ------------- 3 files changed, 81 insertions(+), 56 deletions(-) create mode 100644 lbu_files/nemeth_edit_en_us_with_switch_indicators.ctb delete mode 100644 lbu_files/nemeth_edit_with_switch_indicators.ctb diff --git a/lbu_files/Makefile.am b/lbu_files/Makefile.am index d65c674b..e460232a 100644 --- a/lbu_files/Makefile.am +++ b/lbu_files/Makefile.am @@ -24,7 +24,7 @@ lbu_files_DATA = \ nemeth.ctb \ nemeth.sem \ nemeth_edit.ctb \ - nemeth_edit_with_switch_indicators.ctb \ + nemeth_edit_en_us_with_switch_indicators.ctb \ nimas.cfg \ nimas.sem \ package.sem \ diff --git a/lbu_files/nemeth_edit_en_us_with_switch_indicators.ctb b/lbu_files/nemeth_edit_en_us_with_switch_indicators.ctb new file mode 100644 index 00000000..491abf67 --- /dev/null +++ b/lbu_files/nemeth_edit_en_us_with_switch_indicators.ctb @@ -0,0 +1,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 +# . + +#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 diff --git a/lbu_files/nemeth_edit_with_switch_indicators.ctb b/lbu_files/nemeth_edit_with_switch_indicators.ctb deleted file mode 100644 index 1f024049..00000000 --- a/lbu_files/nemeth_edit_with_switch_indicators.ctb +++ /dev/null @@ -1,55 +0,0 @@ -# liblouis Table for Post-Translation Editing -#Complying with BANA's 2018 Nemeth rules -# -# 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 -# . - -include en-chardefs.cti -repeated \s 0 -always \ee\s`4 1b-15-256 -always \ee\s`6 1b-15-235 -always \ee\s`8 1b-15-236 -always \ee\s`1 1b-15-2 -always \ee\s`3p 1b-15-4-25-1234 -always \ee\s`3 1b-15-25 -always \ee\s`2 1b-15-23 -always \ee\s`' 1b-15-3 -always \ee\s- 1b-15-36 -always \ee\s_/ 1b-15-456-34 -always \ee\s99 1b-15-35-35 -always `7\s\eb 2356-1b-12 -always \ee\s`7 1b-15-2356 -always `8\s\eb 236-1b-12 -noback correct "\eb\s" "\eb" -noback context "\eb"[]$l"\ee" @56 -noback context "\eb"[]","$l"\ee" @56 -#noback pass2 @1b-12 ? -noback pass2 @1b-12 @456-146-0 #Nemeth block start indicator -#noback pass2 @1b-15 ? -noback pass2 @1b-15 @0-456-156 Nemeth block end indicator - -#Trying to detect whether the math excerpt is preceded and followed by quotes and then restoring the ending quotation mark. -noback pass2 [@236-1b-12] #1=1@236-456-146-0 -noback pass2 #1=1[@1b-15-236] #1=0@0-456-156-356 -noback pass2 @1b-12-4-4 @456-146-0-4 From 61f0ebcd98770157a51bf2850140bfe33cd3a522 Mon Sep 17 00:00:00 2001 From: Attila Hammer Date: Fri, 4 Aug 2023 13:32:09 +0200 Subject: [PATCH 21/21] Brand new Nemeth edit table supporting production of "UEB with Nemeth" documents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds support for UEB literary texts containing Nemeth blocks for technical content. Nemeth switch indicators are applied to mark the beginning and end of each math block, so one can always distinguish between literary text and technical content. Handles a range of punctuation, grouping and other symbols and their spacing around the math blocks. Use nemeth_edit_en_ueb_with_switch_indicators.ctb as editTable along with en-ueb-g1.ctb or en-ueb-g2.ctb as mathtextTable. Co-authored-by: Norbert Márkus Signed-off-by: Attila Hammer --- lbu_files/Makefile.am | 1 + ...eth_edit_en_ueb_with_switch_indicators.ctb | 205 ++++++++++++++++++ 2 files changed, 206 insertions(+) create mode 100644 lbu_files/nemeth_edit_en_ueb_with_switch_indicators.ctb diff --git a/lbu_files/Makefile.am b/lbu_files/Makefile.am index e460232a..c38a1d5c 100644 --- a/lbu_files/Makefile.am +++ b/lbu_files/Makefile.am @@ -24,6 +24,7 @@ lbu_files_DATA = \ nemeth.ctb \ nemeth.sem \ nemeth_edit.ctb \ + nemeth_edit_en_ueb_with_switch_indicators.ctb \ nemeth_edit_en_us_with_switch_indicators.ctb \ nimas.cfg \ nimas.sem \ diff --git a/lbu_files/nemeth_edit_en_ueb_with_switch_indicators.ctb b/lbu_files/nemeth_edit_en_ueb_with_switch_indicators.ctb new file mode 100644 index 00000000..66d8bc2a --- /dev/null +++ b/lbu_files/nemeth_edit_en_ueb_with_switch_indicators.ctb @@ -0,0 +1,205 @@ +# liblouis Table for Post-Translation Editing +#Use it for UEB literary texts surrounding Nemeth math blocks +#Typical usecase: +# mathtextTable en-ueb-g1.ctb or en-ueb-g2.ctb +# mathexprTable nemeth.ctb +# editTable nemeth_edit_en_ueb_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 +# . + +#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 +#helps decide whether a preceding space can be removed +attribute herethisisapunctuation 432 +#when followed by these below, the ones above are punctuations rather than contractions +attribute thecharbeforeitisnotacontraction \x0023-'0 +#single-cell signs that may follow a seqafterpattern +attribute wordfinalpunctuation 1234680- +#used to reduce the number of rules dealing with the seqafterpatterns 're and 've +attribute RorV rv +#remove an extra space added by an ellipsis, shape, etc. at the beginning of the math block following the switch indicator +noback correct "\eb\s" "\eb" +repeated \s 0 +#unconditionally remove the space before punctuation following a math block +always \ee\s6 1b-15-235 exclamation point +always \ee\s1 1b-15-2 comma +always \ee\s.0 1b-15-46-356 percent sign +always \ee\s- 1b-15-36 hyphen +always \ee\s,- 1b-15-6-36 long dash +always \ee\s",- 1b-15-5-6-36 horizontal line +always \ee\s.- 1b-15-46-36 underline +always \ee\s"9 1b-15-5-3 asterisk +always \ee\s44 1b-15-256-256 +#conditional treatment of punctuation and spacing following a math block +#question mark +noback context "\ee"["\s;8"]$s @236 drop the grade-1 prefix +noback context "\ee\s;8"~ @1b-15-236 +always \ee\s;8 1b-15-56-236 keep the prefix +#period +always \ee\s;4 1b-15-56-256 preserve the grade-1 prefix +noback context "\ee"["\s4"]$s @256 +noback context "\ee\s4"~ @1b-15-256 +#colon +always \ee\s;3 1b-15-56-25 preserve the grade-1 prefix +noback context "\ee"["\s3"]$s @25 +noback context "\ee\s3"~ @1b-15-25 +#semicolon +noback context "\ee"["\s;2"]$s @23 drop the grade-1 prefix +noback context "\ee\s;2"~ @1b-15-23 drop the prefix +always \ee\s;2 1b-15-56-23 keep the prefix +#common rules for periods, colons and semicolons +#drop the space if $w below is a punctuation rather than a contraction +noback context "\ee"["\s"]$w$x ? $w cannot be a contraction here because of $x +noback context "\ee"["\s"]$w",7" ? followed by quotation mark +noback context "\ee"["\s"]$w"`>" ? right angle bracket +noback context "\ee"["\s"]$w"\">" ? right parenthesis +noback context "\ee"["\s"]$w".>" ? right bracket +noback context "\ee"["\s"]$w"_>" ? right brace +noback context "\ee"["\s"]$w"`.>" ? end of transnote +noback context "\ee"["\s"]$w",0" ? right single quote +noback context "\ee"["\s"]$w"\"9" ? asterisk +noback context "\ee"["\s"]$w",-" ? long dash +noback context "\ee"["\s"]$w"\",-" ? horizontal line +noback context "\ee"["\s"]$w".-" ? underline +#conditional treatment of grouping symbols and spacing +#opening apostrophe before a math block +noback context $s["'\s"]"\eb" @6-236 +#noback context `["'\s\eb"] @6-236-1b-12 #the ` operand doesn't seem to work +noback context ",7"["'\s"]"\eb" @6-236 preceded by quotation mark +noback context "\"<"["'\s"]"\eb" @6-236 left parenthesis +noback context ".<"["'\s"]"\eb" @6-236 left bracket +noback context ["`_<'\s\eb"] * preserve the apostrophe and space, this is not a grouping symbol: normal subgroup +noback context ["__<'\s\eb"] * preserve the apostrophe and space: normal subgroup or equal +noback context "_<"["'\s"]"\eb" @6-236 preceded by left brace +noback context "`.<"["'\s"]"\eb" @6-236 beginning of transnote +noback context ",8"["'\s"]"\eb" @6-236 left single quote +noback context $a["'\s"]"\eb" @3-0 in any other case preserve the apostrophe and space +noback context ["'\s"]"\eb" @6-236 #assumed to be a single quote at the beginning of the string +#closing apostrophe after a math block +noback context "\ee"["\s'"]$s @6-356 +noback context "\ee"["\s'"]~ @6-356 +noback context "\ee"["\s'"]",7" @6-356 followed by quotation mark +noback context "\ee"["\s'"]"\">" @6-356 right parenthesis +noback context "\ee"["\s'"]".>" @6-356 right bracket +noback context "\ee"["\s'"]"_>" @6-356 right brace +noback context "\ee"["\s'"]"`.>" @6-356 end of transnote +noback context "\ee"["\s'"]",0" @6-356 right single quote +#opening quotation mark before a math block +noback context $s[",7\s"]"\eb" @236 +#noback context `[",7\s\eb"] @236-1b-12 #the ` operand does not appear to be working +noback context "\"<"[",7\s"]"\eb" @236 +noback context ".<"[",7\s"]"\eb" @236 +noback context ["`_<,7\s\eb"] * preserve the general quotation mark and space +noback context ["__<,7\s\eb"] * keep it as it is +noback context "_<"[",7\s"]"\eb" @236 preceded by left brace +noback context "`.<"[",7\s"]"\eb" @236 beginning of transnote +noback context ",8"[",7\s"]"\eb" @236 left single quote +noback context $a[",7\s"]"\eb" @6-2356-0 in any other case keep it as it is +noback context [",7\s"]"\eb" @236 #assumed to be a left quotation mark at the beginning of the string +#closing quotation mark after a math block +noback context "\ee"["\s,7"]$s @356 +noback context "\ee"["\s,7"]~ @356 +noback context "\ee"["\s,7"]"\">" @356 +noback context "\ee"["\s,7"]".>" @356 +noback context "\ee"["\s,7"]"_>" @356 +noback context "\ee"["\s,7"]"`.>" @356 +noback context "\ee"["\s,7"]",0" @356 +#unconditionally remove the space adjacent to grouping symbols and others +#before a math block +always _`<\s\eb 456-4-126-0-1b-12 preserve the space, this isn't a grouping symbol: less than or equal to +always .`<\s\eb 46-4-126-0-1b-12 keep the space: much less than +always `<\s\eb 4-126-1b-12 can be a left angle bracket +always .<\s\eb 46-126-1b-12 left bracket +always `.<\s\eb 4-46-126-1b-12 beginning of transnote +always ,-\s\eb 6-36-1b-12 preceding long dash +always ",-\s\eb 5-6-36-1b-12 horizontal line +always ~.-\s\eb 45-46-36-0-1b-12 keep the space, this isn't an underline: low tone +always .-\s\eb 46-36-1b-12 underline +always _-\s\eb 456-36-0-1b-12 keep the space: minus or plus +always #-\s\eb 3456-36-0-1b-12 keep the space, this isn't a hyphen: uptack or perpendicular +always -\s\eb 36-1b-12 hyphen +always ~;8\s\eb 45-56-236-1b-12 inverted question mark +always ~;6\s\eb 45-56-235-1b-12 inverted exclamation point +always `s\s\eb 4-234-1b-12 Dollar sign +always `l\s\eb 4-123-1b-12 Pound +always `y\s\eb 4-13456-1b-12 Yen +always `f\s\eb 4-124-1b-12 Franc +always `n\s\eb 4-1345-1b-12 Naira +always `e\s\eb 4-15-1b-12 Euro +always `_<\s\eb 4-456-126-0-1b-12 keep the space, not a left brace: normal subgroup +always __<\s\eb 456-456-126-0-1b-12 keep the space, not a left brace: normal subgroup or equal +always _<\s\eb 456-126-1b-12 left brace +always "<\s\eb 5-126-1b-12 left parenthesis +#grouping and others after a math block +always \ee\s"> 1b-15-5-345 right parenthesis +always \ee\s.> 1b-15-46-345 right bracket +always \ee\s_> 1b-15-456-345 right brace +always \ee\s`>`: 1b-15-0-4-345-4-156 keep the space, not a right angle bracket: not greater than +always \ee\s`> 1b-15-4-345 can be a right angle bracket +always \ee\s`.> 1b-15-4-46-345 end of transnote +always \ee\s`c 1b-15-4-14 Cent sign +#handle seqafterpatterns following a math block +always \ee\s';s 1b-15-3-234 +always \ee\s';d 1b-15-3-145 +always \ee\s';ll 1b-15-3-123-123 +#More seqafterpatterns +noback context "\ee"["\s"]"'"$z"e\s" ? where $z either represents the letter r or v +noback context "\ee"["\s"]"'"$z"e"~ ? +noback context "\ee"["\s"]"'"$z"e"$y1-10~ ? +noback context "\ee"["\s"]"'"$z"e"$y1-10"\s" ? +noback context "\ee"["\s"]"'"$z"e,7" ? +noback context "\ee"["\s"]"'"$z"e\">" ? +noback context "\ee"["\s"]"'"$z"e`>" ? +noback context "\ee"["\s"]"'"$z"e.>" ? +noback context "\ee"["\s"]"'"$z"e_>" ? +noback context "\ee"["\s"]"'"$z"e`.>" ? +noback context "\ee"["\s"]"'"$z"e,0" ? +noback context "\ee"["\s"]"'"$z"e\"9" ? +noback context "\ee"["\s"]"'"$z"e,-" ? +noback context "\ee"["\s"]"'"$z"e\",-" ? +noback context "\ee"["\s"]"'"$z"e.-" ? +noback context "\ee"["\s"]"'"$z"e"$y1-10",7" ? +noback context "\ee"["\s"]"'"$z"e"$y1-10"\">" ? +noback context "\ee"["\s"]"'"$z"e"$y1-10"`>" ? +noback context "\ee"["\s"]"'"$z"e"$y1-10".>" ? +noback context "\ee"["\s"]"'"$z"e"$y1-10"_>" ? +noback context "\ee"["\s"]"'"$z"e"$y1-10"`.>" ? +noback context "\ee"["\s"]"'"$z"e"$y1-10",0" ? +noback context "\ee"["\s"]"'"$z"e"$y1-10"\"9" ? +noback context "\ee"["\s"]"'"$z"e"$y1-10",-" ? +noback context "\ee"["\s"]"'"$z"e"$y1-10"\",-" ? +noback context "\ee"["\s"]"'"$z"e"$y1-10".-" ? + +#noback context "\eb"[]$l"\ee" @56 +#noback context "\eb"[]","$l"\ee" @56 +noback pass2 @1b-12 @456-146-0 #Nemeth block start indicator +noback pass2 @1b-15 @0-456-156 Nemeth block end indicator