configure double metaphone in french java apache

188 views Asked by At

I want to use the function java apache DoubleMetaphoneEqual but with french language ? I'm using as routine in my talend job

Could you please tell me what should i add to my code ? For the example JAID MOHAMED, JAWAD MOHAMED gives true and in french is should be false

static DoubleMetaphone dd = new DoubleMetaphone();

 public static boolean resultat (final String value1, final String value2) 
 {
        return dd.isDoubleMetaphoneEqual(value1, value2,false);
    }

Thanks

1

There are 1 answers

1
Jim Garrison On

If you are using the standard Apache implementation, this is not possible. From the DoubleMetaphone Javadoc:

Encodes a string into a double metaphone value. This Implementation is based on the algorithm by Lawrence Philips.

and from the Metaphone page on Wikipedia

Metaphone is a phonetic algorithm, published by Lawrence Philips in 1990, for indexing words by their English pronunciation

So it will not work for French