Example usage for org.apache.commons.codec.language Metaphone encode

List of usage examples for org.apache.commons.codec.language Metaphone encode

Introduction

In this page you can find the example usage for org.apache.commons.codec.language Metaphone encode.

Prototype

public String encode(String pString) 

Source Link

Document

Encodes a String using the Metaphone algorithm.

Usage

From source file:com.vangent.hieos.empi.transform.MetaphoneTransformFunction.java

/**
 * /*  w  w  w .  j a  v a  2  s . co  m*/
 * @param obj
 * @return
 */
public Object transform(Object obj) {
    Metaphone encoder = new Metaphone();
    return encoder.encode((String) obj);
}

From source file:aos.lucene.analysis.codec.CodecTest.java

public void testMetaphone() throws Exception {
    Metaphone metaphoner = new Metaphone();
    assertEquals(metaphoner.encode("cute"), metaphoner.encode("cat"));
}