[liblouis-liblouisxml] Re: Character Attribute with Number Range Check

  • From: Bert Frees <bertfrees@xxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Thu, 19 Sep 2019 22:53:09 +0200

Hi Phuc,

What you're trying to do doesn't work unfortunately. The multipass
expression handler is rather primitive when it comes to repetition. It
doesn't do "backtracking" like regular expression engines do.

If you have a specific use case for a table, feel free to share it on the
list and we can help you find a solution for the problem. But I'm afraid
that improving the code to do what you want is going to take some time and
effort.

Bert



Op di 17 sep. 2019 om 02:41 schreef Dang Hoai Phuc <danghoaiphuc@xxxxxxxxx>:

Hi All,
Can you advice me on this:
I am defining a new class and use the context optcode to check the
condition to remove certain characters if they are between a number of
characters and the new class characters. It works for default number and
exact number. But when I define a range number like from 1-10 or
indefinite number with period sign (.), it doesn't work. If it's a bug
of LibLouis or I make it wrong somewhere else?

Here is my definitions:
class wordendingsign @",^.;_
noback context ">"$a["abcd"]%wordendingsign ?

This works, for instance: I send to LibLouis: ">tabcd_", it removes
"abcd". And this case also works:
noback context ">"$a4["abcd"]%wordendingsign ?
Sending to LibLouis: ">testabcd_". But two cases below do not work:

noback context ">"$a1-10["abcd"]%wordendingsign ?
Or for indefinite number with period sign:
noback context ">"$a.["abcd"]%wordendingsign ?
It doesn't remove "abcd" at all.
Many thanks in advance.
Phuc


Other related posts: