[liblouis-liblouisxml] Re: Problem with emphasis translation when there is an embedded span

  • From: "John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Tue, 25 Feb 2014 15:53:08 -0600

What liblouis table are you using? If you are using old tables they remove 
extra spaces. If you are using tables from the last six months or so you should 
use a table list such as

compress.cti,en-us-g2.ctb

The compress.cti table removes extra spaces, replaces line feeds with spaces, 
etc.

John

On Tue, Feb 25, 2014 at 09:28:48PM +0000, John  Brugge wrote:
> Thanks for the suggestion, John. That did work in this particular
> situation, but I think it will cause problems for other cases where an
> extra space isn't intended. To simplify the example text I sent in, there
> is already a space after the span that should simply be preserved:
> <p>
>   <em>The fox</em> <span>jumped over</span> <em>the lazy dog</em>
>  </p>
> 
> 
> The resulting BRF I get has a space after "fox", but not after "over":
>   .,! .FOX JUMP$ OV].'! LAZY DOG.-
> 
> If I put in the change to "no span" that is suggested, then the
> translation above comes out with the needed space, but that gives the
> wrong translation for places where the source material has no space after
> the span, and should not. For example, in this case, the period should
> appear right after the text in the span:
> <p>
> <span>The fox jumped over the lazy dog</span>.
>  </p>
> 
> 
> With the "no span \*\s" setting, the resulting BRF looks like this:
>   ,! FOX JUMP$ OV] ! LAZY DOG @4
> 
> The documentation I see for the "no elementSpecifier" in the liblouisxml
> manual makes it sound like it tries to do the right thing:
> 
> "Originally, this semantic action was intended to be the default and to do
> nothing when an elementSpecifier had no meaning for braille translation.
> Later it was found that it should insert a blank space if parts of the
> text would run together, so this is now its action."
> 
> I wonder if this is something specific to the "span" element, or the "no"
> action in general? It seems like it is related to the "no" action, for if
> I change the tag in the example above from "span" to "blah", and have an
> action of "no blah", it has the same behavior, of collapsing the space
> after the "blah".
> 
> Thanks for any insights or clues,
> John Brugge
> 
> On 2/24/14 5:33 PM, "John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxxx> wrote:
> 
> >You might try the third column on the "no span" line. This column is used
> >to specify text to be inserted in a subtree. To see how it is used look
> >at nemeth.ctb . In this case try \*\s This will
> >introduce a space after every span tag. If you have set up the liblou9s
> >tables to compress spaces any extra ones will be removed during
> >translation.
> >
> >John
> >
> >On Mon, Feb 24, 2014 at 10:43:45PM +0000, John  Brugge wrote:
> >> We are seeing an odd translation when text that is enclosed in an <em/>
> >>tag has an embedded <span/>. We have a setting of "no span" and "italicx
> >>em" in our semantic action file, and nothing else that seems out of the
> >>ordinary. What we get is the span text running into the emphasis text
> >>that follows, without space between them.
> >> 
> >> I've attached a ZIP file with a fragment of the text in an XML file,
> >>the script to reproduce it, and the resulting BRF that we see.
> >> 
> >> We are running with liblouisutdml 2.4.0.
> >> 
> >> Any insights or clues appreciated.
> >> Thanks,
> >> John Brugge
> >
> >-- 
> >John J. Boyer; President, Chief Software Developer
> >Abilitiessoft, Inc.
> >http://www.abilitiessoft.com
> >Madison, Wisconsin USA
> >Developing software for people with disabilities
> >
> >For a description of the software, to download it and links to
> >project pages go to http://www.abilitiessoft.com
> 
> For a description of the software, to download it and links to
> project pages go to http://www.abilitiessoft.com

-- 
John J. Boyer; President, Chief Software Developer
Abilitiessoft, Inc.
http://www.abilitiessoft.com
Madison, Wisconsin USA
Developing software for people with disabilities

For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts: