commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "tester (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CODEC-125) Implement a Beider-Morse phonetic matching codec
Date Wed, 27 Jul 2011 07:02:09 GMT

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

tester commented on CODEC-125:
------------------------------

I think I've found something: 
the method encode throws an StringIndexOutOfBounds exception when you call with "Ignatz" parameter
and NameType.GENERIC.
It seems the smallest string what can cause the problem is: "gna" and you can put anything
before and after it.
If you set the NameType to one of the other two (askenazi or sephardic) it works fine.
Here is my test:
@Test
    public void encode() throws EncoderException{
    	BeiderMorseEncoder bmpm = new BeiderMorseEncoder();
    	bmpm.setNameType(NameType.GENERIC);
    	bmpm.setRuleType(RuleType.APPROX);
    	bmpm.encode("gna");
    } 

Sorry for using this fake account, it is also a warning to remove this or change its default
password :). Meanwhile I'm registering a valid one.

Thanks

Tamas Kende

And here is the trace:

java.lang.StringIndexOutOfBoundsException: String index out of range: -2696
	at java.lang.String.substring(String.java:1937)
	at org.apache.commons.codec.language.bm.PhoneticEngine.expand(PhoneticEngine.java:360)
	at org.apache.commons.codec.language.bm.PhoneticEngine.expand(PhoneticEngine.java:368)
	at org.apache.commons.codec.language.bm.PhoneticEngine.applyRuleIfCompatible(PhoneticEngine.java:396)
	at org.apache.commons.codec.language.bm.PhoneticEngine.access$0(PhoneticEngine.java:382)
	at org.apache.commons.codec.language.bm.PhoneticEngine$RulesApplication.invoke(PhoneticEngine.java:512)
	at org.apache.commons.codec.language.bm.PhoneticEngine.phoneticUtf8(PhoneticEngine.java:214)
	at org.apache.commons.codec.language.bm.PhoneticEngine.encode(PhoneticEngine.java:122)
	at org.apache.commons.codec.language.bm.BeiderMorseEncoder.encode(BeiderMorseEncoder.java:99)
	at org.apache.commons.codec.language.bm.BeiderMorseEncoderTest.encode(BeiderMorseEncoderTest.java:50)

> Implement a Beider-Morse phonetic matching codec
> ------------------------------------------------
>
>                 Key: CODEC-125
>                 URL: https://issues.apache.org/jira/browse/CODEC-125
>             Project: Commons Codec
>          Issue Type: New Feature
>            Reporter: Matthew Pocock
>            Priority: Minor
>         Attachments: bm-gg.diff, bmpm.patch, bmpm.patch, bmpm.patch, bmpm.patch, bmpm.patch,
bmpm.patch, bmpm.patch, bmpm.patch
>
>
> I have implemented Beider Morse Phonetic Matching as a codec against the commons-codec
svn trunk. I would like to contribute this to commons-codec.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message