Class MatchRatingApproachEncoder
- java.lang.Object
-
- org.aksw.limes.core.measures.measure.phoneticmeasure.MatchRatingApproachEncoder
-
- All Implemented Interfaces:
org.apache.commons.codec.Encoder,org.apache.commons.codec.StringEncoder
public class MatchRatingApproachEncoder extends Object implements org.apache.commons.codec.StringEncoder
Match Rating Approach Phonetic Algorithm Developed by Western Airlines in 1977.This class is immutable and thread-safe.
- Since:
- 1.8
- See Also:
- Wikipedia - Match Rating Approach
-
-
Constructor Summary
Constructors Constructor Description MatchRatingApproachEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectencode(Object pObject)Encodes an Object using the Match Rating Approach algorithm.Stringencode(String name)Encodes a String using the Match Rating Approach (MRA) algorithm.booleanisEncodeEquals(String name1, String name2)Determines if two names are homophonous via Match Rating Approach (MRA) algorithm.
-
-
-
Method Detail
-
encode
public final Object encode(Object pObject) throws org.apache.commons.codec.EncoderException
Encodes an Object using the Match Rating Approach algorithm. Method is here to satisfy the requirements of the Encoder interface Throws an EncoderException if input object is not of type java.lang.String.- Specified by:
encodein interfaceorg.apache.commons.codec.Encoder- Parameters:
pObject- Object to encode- Returns:
- An object (or type java.lang.String) containing the Match Rating Approach code which corresponds to the String supplied.
- Throws:
org.apache.commons.codec.EncoderException- if the parameter supplied is not of type java.lang.String
-
encode
public final String encode(String name)
Encodes a String using the Match Rating Approach (MRA) algorithm.- Specified by:
encodein interfaceorg.apache.commons.codec.StringEncoder- Parameters:
name- String object to encode- Returns:
- The MRA code corresponding to the String supplied
-
isEncodeEquals
public boolean isEncodeEquals(String name1, String name2)
Determines if two names are homophonous via Match Rating Approach (MRA) algorithm. It should be noted that the strings are cleaned in the same way asencode(String).- Parameters:
name1- First of the 2 strings (names) to comparename2- Second of the 2 names to compare- Returns:
trueif the encodings are identicalfalseotherwise.
-
-