Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pf:text-transform failed" on <p><sup>rs</sup>4954</p> #227

Open
josteinaj opened this issue Dec 5, 2019 · 2 comments
Open

"pf:text-transform failed" on <p><sup>rs</sup>4954</p> #227

josteinaj opened this issue Dec 5, 2019 · 2 comments
Labels

Comments

@josteinaj
Copy link
Member

When there's no whitespace after </sup>, we get a RuntimeException. Seems to be from liblouis (CC @bertfrees @egli).

To reproduce:

  1. Input document:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="no" lang="no">
    <head>
        <meta charset="utf-8"/>
        <title>TEST</title>
        <meta name="dc:identifier" content="TEST"/>
    </head>
    <body>
        <section epub:type="bodymatter chapter" id="section1">
            <h1 id="h1">TEST</h1>
            <p><sup>rs</sup>4954</p>
        </section>
    </body>
</html>
  1. Run through "HTML to PEF (NLB)"

  2. Exception

2019-12-05 14:55:24,978 [ERROR] o.d.p.b.c.s.i.TextTransformDefinition - pf:text-transform failed
java.lang.RuntimeException: null
	at org.liblouis.TranslationResult.<init>(TranslationResult.java:29) ~[na:na]
	at org.liblouis.Translator.translate(Translator.java:95) ~[na:na]
	at org.daisy.pipeline.braille.liblouis.impl.LiblouisTranslatorJnaImplProvider$LiblouisTranslatorImpl.transform(LiblouisTranslatorJnaImplProvider.java:1188) ~[na:na]
	at org.daisy.pipeline.braille.liblouis.impl.LiblouisTranslatorJnaImplProvider$LiblouisTranslatorImpl.transform(LiblouisTranslatorJnaImplProvider.java:995) ~[na:na]
	at org.daisy.pipeline.braille.liblouis.impl.LiblouisTranslatorJnaImplProvider$LiblouisTranslatorImpl.transform(LiblouisTranslatorJnaImplProvider.java:927) ~[na:na]
	at org.daisy.pipeline.braille.liblouis.impl.LiblouisTranslatorJnaImplProvider$LiblouisTranslatorImpl.access$600(LiblouisTranslatorJnaImplProvider.java:263) ~[na:na]
	at org.daisy.pipeline.braille.liblouis.impl.LiblouisTranslatorJnaImplProvider$LiblouisTranslatorImpl$2.transform(LiblouisTranslatorJnaImplProvider.java:329) ~[na:na]
	at no.nlb.pipeline.braille.impl.NLBTranslator$Provider$HandleComputerAndUncontracted$1.transform(NLBTranslator.java:408) ~[na:na]
	at no.nlb.pipeline.braille.impl.NLBTranslator$Provider$HandleComputerAndUncontracted$1.transform(NLBTranslator.java:349) ~[na:na]
	at no.nlb.pipeline.braille.impl.NLBTranslator$Provider$TransformImpl$1.transform(NLBTranslator.java:218) ~[na:na]
	at no.nlb.pipeline.braille.impl.NLBTranslator$Provider$TransformImpl$1.transform(NLBTranslator.java:212) ~[na:na]
	at org.daisy.pipeline.braille.common.saxon.impl.TextTransformDefinition$1.call(TextTransformDefinition.java:128) ~[na:na]
	at net.sf.saxon.functions.IntegratedFunctionCall.iterate(IntegratedFunctionCall.java:268) ~[na:na]
	at net.sf.saxon.expr.instruct.Choose.iterate(Choose.java:944) ~[na:na]
	at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:112) ~[na:na]

(…)

	at com.xmlcalabash.runtime.XCompoundStep.run(XCompoundStep.java:262) ~[na:na]
	at com.xmlcalabash.runtime.XTry.run(XTry.java:98) ~[na:na]
	at com.xmlcalabash.runtime.XPipeline.doRun(XPipeline.java:236) ~[na:na]
	at com.xmlcalabash.runtime.XPipeline.run(XPipeline.java:136) ~[na:na]
	at org.daisy.common.xproc.calabash.impl.CalabashXProcPipeline.run(CalabashXProcPipeline.java:242) ~[na:na]
	at org.daisy.pipeline.job.Job.run(Job.java:216) ~[na:na]
	at org.daisy.pipeline.job.impl.DefaultJobExecutionService$1.run(DefaultJobExecutionService.java:115) ~[na:na]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_222]

Full log: job-5056.log

  1. Insert a space after </sup> and try again, and it will succeed.
@bertfrees
Copy link
Collaborator

bertfrees commented Dec 5, 2019

Looks like a Liblouis bug indeed.

I've created an issue: liblouis/liblouis#886.

By the way what is the correct translation of this example? I suspect that "⠨⠦⠗⠎⠼⠬⠙⠊⠑⠙" is wrong, it would be more logical if the "⠼" came after the "⠬". @josteinaj @KariRudjord Can you please check?

@bertfrees bertfrees added the bug label Dec 5, 2019
@josteinaj
Copy link
Member Author

Yes, I think you're right. The "⠼" should come after the "⠬".

<sup>: ⠨⠦
rs: ⠗⠎
</sup>: ⠬
number: ⠼
4954: ⠙⠊⠑⠙

⠨⠦⠗⠎⠬⠼⠙⠊⠑⠙

(@KariRudjord: correct me if I'm wrong)

Could the ordering of the number sign vs end of </sup> be the same as the ordering of </strong></em> vs </strong></em>? (can't find the github issue for it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants