[liblouis-liblouisxml] Re: Update output positions during multi pass (forward translation only)

  • From: Davy Kager <DavyKager@xxxxxxxxxx>
  • To: "'liblouis-liblouisxml@xxxxxxxxxxxxx'" <liblouis-liblouisxml@xxxxxxxxxxxxx>
  • Date: Thu, 29 Oct 2015 13:30:08 +0000

Hi Arend,

I hear you – I tried to fix #78 but got terribly lost. ☺

Davy

Van: liblouis-liblouisxml-bounce@xxxxxxxxxxxxx
[mailto:liblouis-liblouisxml-bounce@xxxxxxxxxxxxx] Namens Arend Arends
Verzonden: donderdag 29 oktober 2015 14:28
Aan: liblouis-liblouisxml@xxxxxxxxxxxxx
Onderwerp: [liblouis-liblouisxml] Re: Update output positions during multi pass
(forward translation only)

Hi Davy,

I did not study the behaviour with the parameter mode set to a value other than
zero. Unless a pass rule is applied in that table I don’t think it is related.
The code is already difficult enough without using mode. I wish there would be
more explanation what the internal functions are supposed to do.

Arend

From: Davy Kager<mailto:DavyKager@xxxxxxxxxx>
Sent: Thursday, October 29, 2015 1:53 PM
To: mailto:liblouis-liblouisxml@xxxxxxxxxxxxx
Subject: [liblouis-liblouisxml] Re: Update output positions during multi pass
(forward translation only)

Potentially related:
https://github.com/liblouis/liblouis/issues/78

Van:
liblouis-liblouisxml-bounce@xxxxxxxxxxxxx<mailto:liblouis-liblouisxml-bounce@xxxxxxxxxxxxx>
[mailto:liblouis-liblouisxml-bounce@xxxxxxxxxxxxx] Namens Arend Arends
Verzonden: donderdag 29 oktober 2015 13:49
Aan:
liblouis-liblouisxml@xxxxxxxxxxxxx<mailto:liblouis-liblouisxml@xxxxxxxxxxxxx>
Onderwerp: [liblouis-liblouisxml] Update output positions during multi pass
(forward translation only)

I have just made a pull request for liblouis/transcommon.ci with the
description:

“trace_translate, the general translation function in lou_translateString.c
calls translatePass for pass2, 3 and 4. translatePass does currently not update
the output positions. This modification tries to handle this. This may affect
cursor position too.”.

Although the header of the file suggests that it is an include file for both
forward and backward translation (lou_translateString.c and
lou_backTranslateString.c), it is only used in lou_translateString.c. It seems
that most of the relevant contents has been copied to lou_backTranslateString.c
directly without the use of a separate include file. This has been the case
since GitHub was first used (2013?). Maybe we should also integrate
transcommon.ci in lou_translateString.c directly?

The reason that I made this change was that the LibLouis function lou_translate
provides parameters for inputPos, outputPos and cursorPos, but that these
arrays and single value for cursorPos are only updated in the first (normal)
pass of the translation, which calls the internal function translateString. In
case of multi passes the function translatePass is called (pass2, 3 and 4), but
it makes no changes in the outputPos array (pointed to by a local static
pointer outputPositions).
Input positions and the cursor position are to some extent derived from the
output positions after the translation is made.

These parameters can be used by a screenreader. In TactileView, the application
that I am working on, the output positions are used to synchronize characters
in braille and text in a graphic document (especially when printing to swell
paper or ViewPlus printers). It is also used to mark braille indicators in a
special way, for which it was necessary to solve the current problem with the
output positions.
Especially the rules for capitalization in Dutch braille tables gave a
mismatch, because in these tables extensive use is made of context and multi
pass rules.

Unfortanately I could solve this only for forward translation, and it may not
even be perfect. I did not investigate what was needed for backward
translation, particularly because I do not use it and also do not have
experience with backward translation.

Arend Arends



DISCLAIMER:
De informatie verzonden met dit e-mail bericht is uitsluitend bestemd voor de
geadresseerde. Indien u niet de beoogde geadresseerde bent, verzoeken wij u
vriendelijk dit aan de afzender te melden (of via:
info@xxxxxxxxxx<mailto:info@xxxxxxxxxx>) en het origineel en eventuele kopieën
te verwijderen.

The information sent in this e-mail is solely intended for the individual or
company to whom it is addressed. If you received this message in error, please
notify the sender immediately (or mail to
info@xxxxxxxxxx<mailto:info@xxxxxxxxxx>) and delete the original message and
possible copies.


DISCLAIMER:
De informatie verzonden met dit e-mail bericht is uitsluitend bestemd voor de
geadresseerde. Indien u niet de beoogde geadresseerde bent, verzoeken wij u
vriendelijk dit aan de afzender te melden (of via:
info@xxxxxxxxxx<mailto:info@xxxxxxxxxx>) en het origineel en eventuele kopieën
te verwijderen.

The information sent in this e-mail is solely intended for the individual or
company to whom it is addressed. If you received this message in error, please
notify the sender immediately (or mail to
info@xxxxxxxxxx<mailto:info@xxxxxxxxxx>) and delete the original message and
possible copies.

Other related posts: