[liblouis-liblouisxml] Re: Difficulty with the context opcode.

  • From: "Michael Whapples" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "mwhapples" for DMARC)
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Mon, 2 Jan 2017 12:37:47 +0000

OK, that is good to hear.


However it seems like LibLouis still accepts a third column where * or ? is not the only thing in the third column. If it should be the only thing in that column then it should cause an error when there is more.


What is more, having something like @56* in the third column sometimes works as you might expect and other times it does not. I think I managed to get a pass2 rule to work with such a third column, but context rules do not work as expected.


So yes documentation may be needs improvements, but I think also the code needs to prevent something like @56* in the third column.


Finally we still have the original question of how to achieve insertion at the start of a string based on what the first character is.


Michael Whapples


On 02/01/2017 12:26, John J. Boyer wrote:

Yes, * or ? should be the only thing in the action columkn. the documentation 
probably needs improvement.

John

On Mon, Jan 02, 2017 at 08:28:03AM +0000, Michael Whapples wrote:
I have a feeling that if * or ? is used in the action column then it should
be the only thing. However the documentation is not clear on this and it
might be otherwise.


I think that for the first of the context rules you gave it would need to be
specified as:

context `[]%englishLetter @56


The third column is specifying what to replace the content of the brackets
with, so moving the %englishLetter outside those brackets means it does not
need specifying in the third column. If the second column has no brackets
then I think it is assumed the brackets surround the whole of the second
column.


Similar can be done for the other context rule you gave:

context _!$l[]%englishLetter @56


Does this work for you?


Michael Whapples


On 02/01/2017 01:45, Dave Mielke wrote:
I must be missing something regarding my understanding of the context opcode.
My goal is to prefix the first English letter of a sequence with dots 56. To
that end, I've written:

    class englishLetter ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
    context `[%englishLetter] @56*
    context _!$l[%englishLetter] @56*

What happens is that the dots 56 is generated but that the letter itself is
missing. What's the right way to have the original text copied from the test to
the action?

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

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

Other related posts: