Hi LibLouis team,
May I suggest that Gary's email points to a need to update the documentation
and to make sure all opcodes and all parameters are accurately listed.
I know there are opcodes (such as seqdelimiter) which are completely missing
from the documentation, and there are parameters for some opcodes (such a %< in
match) which also are not documented.
Gary: the "3" you mention when back translating #aj3#jj is the raw input just
gone straight through to output. Dots 25 in USA computer coding is the ASCII 3.
Just a suggestion - and it might be a silly one - how about use the midnum
opcode to allow the colon?
e.g. in en-us-g1.ctb add:
midnum : 25
I hope this helps.
With best regards,
James.
-----Original Message-----
From: liblouis-liblouisxml-bounce@xxxxxxxxxxxxx
[mailto:liblouis-liblouisxml-bounce@xxxxxxxxxxxxx] On Behalf Of Gary Campbell
Sent: 14 October 2019 18:19
To: liblouis-liblouisxml@xxxxxxxxxxxxx
Subject: [liblouis-liblouisxml] Back translating times-- and using correct?
Hi,
When I try to back translate something like #aj3jj I get 10:jj instead
of 10:00. I tried to fix this with correct:
# Change letters following colon in times to digits.
swapcc timedigits abcdefghij 1234567890
nofor correct $d1-2":"[$l2] %timedigits
(I also tried upper case $D.) This seems to have no effect. Should it?
I'm trying to understand how to use the context/multipass/correct
patterns. (Maybe this should have been called "Questions about Correct"
or something.)
1. For purposes of ` and ~ what is "the string"? The line being processed?
2. The _ says that it "backs up 1 character". Does the processing model
have a "cursor"? I assume it scans the line character by character
looking for a place when the pattern matches similar to regular
expressions, and that [...] is like defining a regular expression group,
and that the result of the action replaces whatever is matched by the
patterns inside the brackets. Is that right?I would then assume that
the rule:
noback context $l["."]$l @256 U.S.
would scan until it matched "u.s" and replace the period in the
brackets with dots 256. However, the rule in en-us-g2.ctb is:
noback context _$l["."]$l @256 U.S.
Why is the _ needed?
3. I assume that "swapcc name abc 123" says to replace a with 1, b with
2, and c with 3. If I then use something like 'correct "abc" %name'
will the statement apply that operation to all 3 letters giving "123",
or is it going to operate only on the first character?
Thinking that I might be able to solve my problem by inserting a number
sign after the colon with pass2, I tried a back translation of #aj3#jj,
which produced "10310. Why was the "3" interpreted as a number in that
context? (I tried aj:#jj and it not surprisingly thought it was wh.)
I'm going to have the same problem with phone numbers.
Thanks.
Gary
For a description of the software, to download it and links to
project pages go to http://liblouis.org ;<http://liblouis.org>
--
Celebrating 150 years of creating change for blind and partially sighted
people.
To help us continue removing the barriers that can stop people with sight loss
thriving, visit www.rnib.org.uk to donate.
--
DISCLAIMER:
NOTICE: The information contained in this email and any attachments is
confidential and may be privileged. If you are not the intended recipient you
should not use, disclose, distribute or copy any of the content of it or of any
attachment; you are requested to notify the sender immediately of your receipt
of the email and then to delete it and any attachments from your system.
RNIB endeavours to ensure that emails and any attachments generated by its
staff are free from viruses or other contaminants. However, it cannot accept
any responsibility for any such which are transmitted.
We therefore recommend you scan all attachments.
Please note that the statements and views expressed in this email and any
attachments are those of the author and do not necessarily represent those of
RNIB.
RNIB Registered Charity Number: 226227
Website: https://www.rnib.org.uk
��u��*m���~�^������h�yhiحjwe�y,��k�7����z�(��m����&��謢�