[liblouis-liblouisxml] An example of what I think should work but doesn't.

  • From: Dave Mielke <dave@xxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Sat, 7 Jan 2017 16:52:56 -0500

I've attached five small files to this message which illustrate a back 
translation example that doesn't work but, according to my current 
understanding as well as a bit of code inspection, should work. I'll also 
explain these files.

tst-run: A script that runs the command:

   lou_translate -b tst-ctb <tst-in >tst-out

tst-in: This is the input which is to be back translated. It contains two lines 
that both say (without the quotes) ";abc". The first line is in characters 
(semicolon, a, b, c), and the second is in Unicode braille patterns.

tst-out: The output, i.e. the actual back translation. Both lines are still 
";abc". Both are in characters (semicolon, a, b, c).

This isn't what's supposed to happen. The rules in the table (see below) should 
translate both lines to "xyz;". There are three rules:

   ;a -> x;
   ;b -> y;
   ;c -> z;

Each of these rules starts with _ so it should see the ; from the previous rule 
application. Here's the atual table, followed by the trace. As you'll see, the 
";a" isn't even processed as a pair.

letter a 1
letter b 12
letter c 14
letter x 1346
letter y 13456
letter z 1356
sign   ; 56
include braille-patterns.cti
pass2 _[@56-1]  @1346-56  # -1 ;a -> x;
pass2 _[@56-12] @13456-56 # -1 ;b -> y;
pass2 _[@56-14] @1356-56  # -1 ;c -> z;

;abc
1.      sign    ;       56
2.      letter  a       1
3.      letter  b       12
4.      letter  c       14
;abc
1.      sign    ;       56
2.      letter  a       1
3.      letter  b       12
4.      letter  c       14

-- 
Dave Mielke           | 2213 Fox Crescent | The Bible is the very Word of God.
Phone: 1-613-726-0014 | Ottawa, Ontario   | http://Mielke.cc/bible/
EMail: Dave@xxxxxxxxx | Canada  K2A 1H7   | http://FamilyRadio.org/
letter a 1
letter b 12
letter c 14
letter x 1346
letter y 13456
letter z 1356
sign   ; 56
include braille-patterns.cti
pass2 _[@56-1]  @1346-56  # -1 ;a -> x;
pass2 _[@56-12] @13456-56 # -1 ;b -> y;
pass2 _[@56-14] @1356-56  # -1 ;c -> z;
;abc
⠰⠁⠃⠉
;abc
;abc
;abc
1.      sign    ;       56
2.      letter  a       1
3.      letter  b       12
4.      letter  c       14
;abc
1.      sign    ;       56
2.      letter  a       1
3.      letter  b       12
4.      letter  c       14
#!/bin/sh
lou_translate -b tst-ctb <tst-in >tst-out
exit $?

Other related posts: