java.util.EmptyStackException if target has literal escaped g tags

Create issue
Issue #1158 new
László Laki created an issue

Hi,

I have an issue with the Leverage Files from Moses part of the script. I try to insert this target to my xliff.

target.txt

<g>a</g>

command:

okapi/tikal.sh -lm sourceTikal.xlf -fc okf_xliff -sl en -tl de -ie UTF-8 -oe UTF-8 -trace -totrg -overtrg -noalttrans -from target.txt -to targetTikal.xlf

result:

-------------------------------------------------------------------------------
Okapi Tikal - Localization Toolset
Version: 2.1.43.0
-------------------------------------------------------------------------------
1 class net.sf.okapi.applications.tikal.Main
2 ProtectionDomain  (file:/okapi/lib/okapi-application-tikal-1.43.0.jar <no signer certificates>)
 jdk.internal.loader.ClassLoaders$AppClassLoader@5bc2b487
 <no principals>
 java.security.Permissions@a33b4e3 (
 ("java.lang.RuntimePermission" "exitVM")
 ("java.io.FilePermission" "/okapi/lib/okapi-application-tikal-1.43.0.jar" "read")
)


3 (file:/okapi/lib/okapi-application-tikal-1.43.0.jar <no signer certificates>)
4 file:/okapi/lib/okapi-application-tikal-1.43.0.jar
5 /okapi/lib/okapi-application-tikal-1.43.0.jar
Merging Moses InlineText
Input: /dataDirOkapi/sourceTikal.xlf
XMLInputFactory: com.ctc.wstx.stax.WstxInputFactory
java.util.EmptyStackException
        at java.base/java.util.Stack.peek(Stack.java:102)
        at java.base/java.util.Stack.pop(Stack.java:84)
        at net.sf.okapi.filters.mosestext.MosesTextFilter.fromPseudoXLIFF(MosesTextFilter.java:337)
        at net.sf.okapi.filters.mosestext.MosesTextFilter.processBuffer(MosesTextFilter.java:269)
        at net.sf.okapi.filters.mosestext.MosesTextFilter.next(MosesTextFilter.java:188)
        at net.sf.okapi.steps.moses.MergingStep.processStartDocument(MergingStep.java:150)
        at net.sf.okapi.steps.moses.MergingStep.handleEvent(MergingStep.java:108)
        at net.sf.okapi.common.pipeline.Pipeline.execute(Pipeline.java:117)
        at net.sf.okapi.common.pipeline.Pipeline.process(Pipeline.java:227)
        at net.sf.okapi.common.pipeline.Pipeline.process(Pipeline.java:199)
        at net.sf.okapi.common.pipelinedriver.PipelineDriver.processBatch(PipelineDriver.java:182)
        at net.sf.okapi.applications.tikal.Main.leverageFileWithMoses(Main.java:1665)
        at net.sf.okapi.applications.tikal.Main.process(Main.java:1043)
        at net.sf.okapi.applications.tikal.Main.main(Main.java:570)

If I rename the close </g>tag it works correctly. Can you help me how can I handle this problem?

Comments (1)

  1. Log in to comment