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

  • From: Bert Frees <bertfrees@xxxxxxxxx>
  • To: "liblouis-liblouisxml@xxxxxxxxxxxxx" <liblouis-liblouisxml@xxxxxxxxxxxxx>
  • Date: Tue, 10 Jan 2017 11:15:51 +0100

Hi Dave,

Thanks for the test. But I need some more explanation. You are testing
back-translation, yet you expect that the pass2 rules match?

Also in another email you said:

Another thing that was confusing me is the multipass order when back
translating. So, just in case others don't know, it looks like its pass4,
then
pass3, then pass2, then context, then back translation. Although I
haven't yet
checked, I suspect that correct, if present, is done last.

How did you get to this conclusion? I don't know the back-translation code,
but I would expect the multipass rules to be applied in reverse somehow
(either that or not at all).


Thanks,
Bert



2017-01-07 22:52 GMT+01:00 Dave Mielke <dave@xxxxxxxxx>:

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


Other related posts: