[ 
https://issues.apache.org/jira/browse/JOSHUA-267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15292242#comment-15292242
 ] 

Kellen Sunderland commented on JOSHUA-267:
------------------------------------------

Hey Tom, it certainly should not throw a NPE just because you pass it the wrong 
language.  Any word that Joshua doesn't recognize should be marked as an OOV 
(out of vocabulary) word.  It should then be passed through Joshua and appear 
in the output, likely in the same position.  One reason for this behaviour is 
that you often get things like names of products or places that you haven't 
seen during training.  For most names of things it'd make sense to just pass 
the name through.  I think there also may be an option to remove any OOVs, but 
I don't believe that's the default.

(Correct me if I'm wrong about this behaviour Joshua experts).

As far as Java swallowing the exceptions from C++, that is likely the case.  We 
would have to write some extra code to catch all C++ at the JNI boundary and 
marshall them to Java exceptions in order to get useful Java exceptions.  Not a 
bad idea for the backlog.  The one caveat is that this may incur some 
performance overhead because these JNIs calls are being called constantly 
during decoding.  If that's the case we may want to turn any marshalling of 
exceptions off by default.

> Java seems to swallow C exceptions
> ----------------------------------
>
>                 Key: JOSHUA-267
>                 URL: https://issues.apache.org/jira/browse/JOSHUA-267
>             Project: Joshua
>          Issue Type: Bug
>            Reporter: Tom Barber
>            Priority: Minor
>
> I compiled joshua on Ubuntu and copied it to another box of the same type, 
> but missing various C bits that were required at build time, but Joshua 
> doesn't run and tells me:
> Input 0: <s> berkeley works fine , but the pipeline fails in next steps </s>
> Input 0: Collecting options took 0.000 seconds
> Input 0: FATAL UNCAUGHT EXCEPTION: null
> java.lang.NullPointerException
>         at joshua.decoder.phrase.Candidate.score(Candidate.java:214)
>         at joshua.decoder.phrase.Candidate.compareTo(Candidate.java:136)
>         at joshua.decoder.phrase.Candidate.compareTo(Candidate.java:19)
>         at java.util.HashMap.compareComparables(HashMap.java:371)
>         at java.util.HashMap$TreeNode.treeify(HashMap.java:1920)
>         at java.util.HashMap.treeifyBin(HashMap.java:771)
>         at java.util.HashMap.putVal(HashMap.java:643)
>         at java.util.HashMap.put(HashMap.java:611)
>         at java.util.HashSet.add(HashSet.java:219)
>         at joshua.decoder.phrase.Stack.addCandidate(Stack.java:125)
>         at joshua.decoder.phrase.Stacks.search(Stacks.java:166)
>         at joshua.decoder.DecoderThread.translate(DecoderThread.java:113)
>         at joshua.decoder.Decoder$DecoderThreadRunner.run(Decoder.java:218)
> Looking at the code its where it passes off to a decoder, which if it doesn't 
> appear, must surely throw some error that we don't see?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to