On 18 July 2012 19:25, Jimmy O'Regan <jore...@gmail.com> wrote:
> On 18 July 2012 18:28, Mikel Artetxe <artet...@gmail.com> wrote:
>>
>>> I was only half right - this is a different issue. I committed 39497
>>> to lttoolbox-java in trunk[1] to check for an empty translation, but
>>> this is only a partial fix, as it leads to "ghost" = signs in the text
>>> where this has happened. (To do otherwise would require a bit more
>>> effort, and I'm not entirely convinced it's worth it).
>>
>>
>> I haven't really understood the technical details, but lttoolbox-java still
>> crashes... Look:
>>
>> [mikel@fedora dist]$ echo "will" | java -jar lttoolbox.jar apertium -a -d
>> /usr/local/share/apertium/ en-es
>>
>> java.lang.StringIndexOutOfBoundsException: String index out of range: 0
>>     at
>> java.lang.AbstractStringBuilder.charAt(AbstractStringBuilder.java:174)
>>     at java.lang.StringBuilder.charAt(StringBuilder.java:55)
>>     at
>> org.apertium.lttoolbox.process.FSTProcessor.generation(FSTProcessor.java:1323)
>
> Sorry, this is a different error:
>
>                 char ch0 = sf.charAt(0);
>
> This also needs a null check, but javac doesn't like
> char ch0 = (sf != null) ? sf.charAt(0) : '';
> and
> char ch0 = (sf != null) ? sf.charAt(0) : (char) Character.UNASSIGNED;
> isn't the same thing, though it doesn't look like it would matter in this 
> case.
>
> One for Jacob, I think.

I've attached the diff, it might make it more clear.

-- 
<Sefam> Are any of the mentors around?
<jimregan> yes, they're the ones trolling you

Attachment: patch
Description: Binary data

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Apertium-stuff mailing list
Apertium-stuff@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to