[liblouis-liblouisxml] Re: nofor context, rules in backward with conditions

  • From: Bert Frees <bertfrees@xxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Fri, 6 Apr 2018 11:49:47 +0200

It would help if you could share with us the table you are working on, and
if possible a little test (YAML format
<http://liblouis.org/documentation/liblouis.html#YAML-Tests-1>) to explain
what exactly you are trying to accomplish. This would be easier because I
don't have the behavior of all the Liblouis rules in my head. With a table
and a test we can try to fix it through trial and error.

If the table you are working on is not in Liblouis yet but the plan is to
contribute it, maybe just create a PR even if it is not finished yet.

2018-04-06 11:19 GMT+02:00 Vincent LE GOFF <vincent.legoff.srs@xxxxxxxxx>:

Hello everyone,

A little technical question and help on nofor context.  I have a very
simple problem that ought to be easy to solve but, I can't seem to come up
with the right syntax.

Case study: back translating, if the user enters 236, it could be either a
parent or question mark, depending on whether there's a blank (dot 0) after
236.  To complicate matters a little, I can neither use prepunc nor
postpunc.

Thinking: let's place a rule on 236-0 (question mark).

punctuation ( 236
nofor context @236-0 "?"

Obviously that won't work, presumably because I didn't use brackets (here,
I just want the 236 to be replaced, not the following dot).

nofor context [@236]@0 "?"

Still not.  Perhaps I should tell it to look backward for the 236?

nofor context _[@236]@0 "?"

... well I tried a lot of things and either the table won't load because
of syntax errors, or it just didn't work (always printing left parent when
I enter 236 followed by 0 or not).

Thank you very much for your help,

Vincent

For a description of the software, to download it and links to
project pages go to http://liblouis.org

Other related posts: