From 2dcf9984542151313749c1ccf9799f206a5d9999 Mon Sep 17 00:00:00 2001 From: vsmontalvao Date: Tue, 28 Feb 2017 15:58:00 -0800 Subject: [PATCH] Fix for number backtranslations on fr-fr-g1 and vi-g1 tables This commit adds the litdigit definition for the french and vietnamese grade 1 tables. These tables included the digit definition from digits6DotsPlusDot6.uti but did not include a definition for litdigits, which would provide the correct translations only for computer braille. Previously, backtranslations for cells starting with the number sign would behave differently from the forward translations by returning space for 0 or ignoring the number sign for other digits (e.g. a with circumflex for 3456-16 instead of 1). --- tables/Makefile.am | 1 + tables/fr-fr-g1.utb | 2 ++ tables/litdigits6DotsPlusDot6.uti | 30 ++++++++++++++++++++++++++++++ tables/vi-g1.ctb | 2 ++ tests/yaml/fr-fr-g1_backward.yaml | 21 +++++++++++++++++++++ tests/yaml/fr-fr-g1_harness.yaml | 21 +++++++++++++++++++++ tests/yaml/vi-g1_backward.yaml | 21 +++++++++++++++++++++ tests/yaml/vi-g1_harness.yaml | 21 +++++++++++++++++++++ 8 files changed, 119 insertions(+) create mode 100644 tables/litdigits6DotsPlusDot6.uti create mode 100644 tests/yaml/fr-fr-g1_backward.yaml create mode 100644 tests/yaml/fr-fr-g1_harness.yaml create mode 100644 tests/yaml/vi-g1_backward.yaml create mode 100644 tests/yaml/vi-g1_harness.yaml diff --git a/tables/Makefile.am b/tables/Makefile.am index 30002b6ff7..9881039297 100644 --- a/tables/Makefile.am +++ b/tables/Makefile.am @@ -226,6 +226,7 @@ table_files = \ latinLetterDef6Dots.uti \ latinLetterDef8Dots.uti \ litdigits6Dots.uti \ + litdigits6DotsPlusDot6.uti \ loweredDigits6Dots.uti \ loweredDigits8Dots.uti \ lt.ctb \ diff --git a/tables/fr-fr-g1.utb b/tables/fr-fr-g1.utb index 6dfacfa532..be8047a6d4 100644 --- a/tables/fr-fr-g1.utb +++ b/tables/fr-fr-g1.utb @@ -72,6 +72,8 @@ sign # 3456 dièse # override zero digit 0 3456 include digits6DotsPlusDot6.uti +litdigit 0 3456 +include litdigits6DotsPlusDot6.uti sign \x00A8 46 diaeresis sign math \x00F7 6-256 divisé par diff --git a/tables/litdigits6DotsPlusDot6.uti b/tables/litdigits6DotsPlusDot6.uti new file mode 100644 index 0000000000..aeb6eab2da --- /dev/null +++ b/tables/litdigits6DotsPlusDot6.uti @@ -0,0 +1,30 @@ +# liblouis: sub table for literary digits, 6 dots with dot 6 added +# +# Copyright (C) 2017 Victor Montalvao +# +# 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 +# . + +litdigit 0 346 +litdigit 1 16 +litdigit 2 126 +litdigit 3 146 +litdigit 4 1456 +litdigit 5 156 +litdigit 6 1246 +litdigit 7 12456 +litdigit 8 1256 +litdigit 9 246 diff --git a/tables/vi-g1.ctb b/tables/vi-g1.ctb index 7ec4c4fdaf..7d2f76efa6 100644 --- a/tables/vi-g1.ctb +++ b/tables/vi-g1.ctb @@ -161,6 +161,8 @@ sign # 3456 dièse # override zero digit 0 3456 include digits6DotsPlusDot6.uti +litdigit 0 3456 +include litdigits6DotsPlusDot6.uti sign \x00A8 46 diaeresis sign math \x00F7 6-256 divisé par diff --git a/tests/yaml/fr-fr-g1_backward.yaml b/tests/yaml/fr-fr-g1_backward.yaml new file mode 100644 index 0000000000..5c433b9a22 --- /dev/null +++ b/tests/yaml/fr-fr-g1_backward.yaml @@ -0,0 +1,21 @@ +tables: [tables/unicode.dis, tables/fr-fr-g1.utb] +flags: {testmode: backward} +tests: +# Backward translations + # Digits + - [⠼⠼, 0] + - [⠼⠡, 1] + - [⠼⠣, 2] + - [⠼⠩, 3] + - [⠼⠹, 4] + - [⠼⠱, 5] + - [⠼⠫, 6] + - [⠼⠻, 7] + - [⠼⠳, 8] + - [⠼⠪, 9] + - [⠼⠡⠼, 10] + - [⠼⠡⠡, 11] + - [⠼⠡⠣, 12] + - [⠼⠪⠪, 99] + - [⠼⠡⠼⠼, 100] + - [⠼⠡⠼⠼⠼, 1000] diff --git a/tests/yaml/fr-fr-g1_harness.yaml b/tests/yaml/fr-fr-g1_harness.yaml new file mode 100644 index 0000000000..423c4db541 --- /dev/null +++ b/tests/yaml/fr-fr-g1_harness.yaml @@ -0,0 +1,21 @@ +tables: [tables/unicode.dis, tables/fr-fr-g1.utb] +flags: {testmode: forward} +tests: +# Forward translations + # Digits + - [0, ⠼⠼] + - [1, ⠼⠡] + - [2, ⠼⠣] + - [3, ⠼⠩] + - [4, ⠼⠹] + - [5, ⠼⠱] + - [6, ⠼⠫] + - [7, ⠼⠻] + - [8, ⠼⠳] + - [9, ⠼⠪] + - [10, ⠼⠡⠼] + - [11, ⠼⠡⠡] + - [12, ⠼⠡⠣] + - [99, ⠼⠪⠪] + - [100, ⠼⠡⠼⠼] + - [1000, ⠼⠡⠼⠼⠼] diff --git a/tests/yaml/vi-g1_backward.yaml b/tests/yaml/vi-g1_backward.yaml new file mode 100644 index 0000000000..cf15785210 --- /dev/null +++ b/tests/yaml/vi-g1_backward.yaml @@ -0,0 +1,21 @@ +tables: [tables/unicode.dis, tables/vi-g1.ctb] +flags: {testmode: backward} +tests: +# Backward translations + # Digits + - [⠼⠼, 0] + - [⠼⠡, 1] + - [⠼⠣, 2] + - [⠼⠩, 3] + - [⠼⠹, 4] + - [⠼⠱, 5] + - [⠼⠫, 6] + - [⠼⠻, 7] + - [⠼⠳, 8] + - [⠼⠪, 9] + - [⠼⠡⠼, 10] + - [⠼⠡⠡, 11] + - [⠼⠡⠣, 12] + - [⠼⠪⠪, 99] + - [⠼⠡⠼⠼, 100] + - [⠼⠡⠼⠼⠼, 1000] diff --git a/tests/yaml/vi-g1_harness.yaml b/tests/yaml/vi-g1_harness.yaml new file mode 100644 index 0000000000..447d36a043 --- /dev/null +++ b/tests/yaml/vi-g1_harness.yaml @@ -0,0 +1,21 @@ +tables: [tables/unicode.dis, tables/vi-g1.ctb] +flags: {testmode: forward} +tests: +# Forward translations + # Digits + - [0, ⠼⠼] + - [1, ⠼⠡] + - [2, ⠼⠣] + - [3, ⠼⠩] + - [4, ⠼⠹] + - [5, ⠼⠱] + - [6, ⠼⠫] + - [7, ⠼⠻] + - [8, ⠼⠳] + - [9, ⠼⠪] + - [10, ⠼⠡⠼] + - [11, ⠼⠡⠡] + - [12, ⠼⠡⠣] + - [99, ⠼⠪⠪] + - [100, ⠼⠡⠼⠼] + - [1000, ⠼⠡⠼⠼⠼]