org.simmetrics.simplifiers.DaitchMokotoffSoundex Maven / Gradle / Ivy
package org.simmetrics.simplifiers;
/**
* Encodes a string into a Daitch-Mokotoff Soundex value.
*
* The Daitch-Mokotoff Soundex algorithm is a refinement of the Russel and
* American Soundex algorithms, yielding greater accuracy in matching especially
* Slavish and Yiddish surnames with similar pronunciation but differences in
* spelling.
*
*
* This class is immutable and thread-safe.
*
* @see org.apache.commons.codec.language.DaitchMokotoffSoundex
* @see
* Wikipedia - Daitch-Mokotoff Soundex
* @see Avotaynu - Soundexing and
* Genealogy
*/
public class DaitchMokotoffSoundex implements Simplifier {
private final org.apache.commons.codec.language.DaitchMokotoffSoundex simplifier;
/**
* Creates a new instance with ASCII-folding enabled.
*/
public DaitchMokotoffSoundex() {
this.simplifier = new org.apache.commons.codec.language.DaitchMokotoffSoundex();
}
/**
* Creates a new DaitchMokotoffSoundex simplifier.
*
* With ASCII-folding enabled, certain accented characters will be
* transformed to equivalent ASCII characters, e.g. è -> e.
*
*
* @param folding
* if ASCII-folding shall be performed before encoding
*/
public DaitchMokotoffSoundex(boolean folding) {
this.simplifier = new org.apache.commons.codec.language.DaitchMokotoffSoundex(
folding);
}
@Override
public String simplify(String input) {
return simplifier.encode(input);
}
@Override
public String toString() {
return "DaitchMokotoffSoundex";
}
}