Hello,

it looks like there is a bug in DoubleMetaphone implementation in
commons-codec 1.16.1. Older 1.16.0 is fine. In fact I'm not 100% sure it is
a bug, but it behaves differently and the old output looks much more
reasonable than the new one.

Old code contains index+=2 -
https://github.com/apache/commons-codec/blob/rel/commons-codec-1.16.0/src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java#L462
New code does not contain that line -
https://github.com/apache/commons-codec/blob/rel/commons-codec-1.16.1/src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java#L619

Regards,
Martin

Simple test:

import org.apache.commons.codec.language.DoubleMetaphone;

public class Test {
    public static void main(String[] args) {
        // ANKL - old version
        // ANKK - new version - wrong
        System.out.println(new
DoubleMetaphone().doubleMetaphone("ANGHELINA"));
    }
}

Reply via email to