lauhin
10/15/2019 - 6:35 PM

Soundex in Java

Soundex in Java

Maven dependency


<dependency>
    <groupId>commons-codec</groupId>
    <artifactId>commons-codec</artifactId>
    <version>1.1</version>
</dependency>

Java code


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

private String soundex(String var) {
    Soundex soundex = new Soundex();
    return soundex.encode(var);
}