public class FuzzyMatcher<T>
extends java.lang.Object
Constructor and Description |
---|
FuzzyMatcher(double matchCost,
double insertionCost,
double deletionCost,
double substitutionCost)
Create a fuzzy matcher with the given costs
|
FuzzyMatcher(FuzzyCost<T> costAnalyzer)
Create a fuzzy matcher using a
FuzzyCost matcher |
Modifier and Type | Method and Description |
---|---|
FuzzyMatcherAlignmentResult<T> |
getAlignment(java.util.List<T> mainList,
java.util.List<T> secondaryList)
Returns the resulting alignment for matching the to lists
|
FuzzyMatcherAlignmentResult<T> |
getAlignment(T[] mainArray,
T[] secondaryArray)
Returns the resulting alignment for matching the to arrays
|
double |
getPercentMatch(java.util.List<T> mainList,
java.util.List<T> secondaryList)
Gets the percent match of the two lists.
|
double |
getPercentMatch(T[] mainArray,
T[] secondaryArray)
Gets the percent match of the two arrays.
|
double |
getScore(java.util.List<T> mainList,
java.util.List<T> secondaryList)
Gets the best possible score for fuzzy matching the two lists
|
double |
getScore(T[] mainArray,
T[] secondaryArray)
Gets the best possible score for fuzzy matching the two arrays
|
double |
getScoreByResult(FuzzyMatcherAlignmentResult<T> alignmentResult)
Recalculates the cost of the given match.
|
double |
getWeightedPercentMatch(java.util.List<T> mainList,
java.util.List<T> secondaryList)
Gets the percent match of the two lists.
|
double |
getWeightedPercentMatch(T[] mainArray,
T[] secondaryArray)
Gets the percent match of the two arrays.
|
public FuzzyMatcher(double matchCost, double insertionCost, double deletionCost, double substitutionCost)
matchCost
- The cost of making a direct matchinsertionCost
- The cost of inserting into the main valuedeletionCost
- The cost of removing from the main valuesubstitutionCost
- The cost of substituting one value for anotherpublic double getScore(@NotNull java.util.List<T> mainList, @NotNull java.util.List<T> secondaryList)
mainList
- The main list of objects to matchsecondaryList
- The secondary list of objects to matchpublic double getScore(T[] mainArray, T[] secondaryArray)
mainArray
- The main array of objects to matchsecondaryArray
- The secondary array of objects to match@NotNull public FuzzyMatcherAlignmentResult<T> getAlignment(@NotNull java.util.List<T> mainList, @NotNull java.util.List<T> secondaryList)
mainList
- The main list of objects to matchsecondaryList
- The secondary list of objects to matchFuzzyMatcherAlignmentResult
object that represents the best alignment@NotNull public FuzzyMatcherAlignmentResult<T> getAlignment(T[] mainArray, T[] secondaryArray)
mainArray
- The main array of objects to matchsecondaryArray
- The secondary array of objects to matchFuzzyMatcherAlignmentResult
object that represents the best alignmentpublic double getScoreByResult(@NotNull FuzzyMatcherAlignmentResult<T> alignmentResult)
alignmentResult
- The alignment matchpublic double getPercentMatch(@NotNull java.util.List<T> mainList, @NotNull java.util.List<T> secondaryList)
mainList
- The main list of objects to matchsecondaryList
- The secondary list of objects to matchpublic double getPercentMatch(T[] mainArray, T[] secondaryArray)
mainArray
- The main array of objects to matchsecondaryArray
- The secondary array of objects to matchpublic double getWeightedPercentMatch(@NotNull java.util.List<T> mainList, @NotNull java.util.List<T> secondaryList)
mainList
- The main list of objects to matchsecondaryList
- The secondary list of objects to matchpublic double getWeightedPercentMatch(T[] mainArray, T[] secondaryArray)
mainArray
- The main array of objects to matchsecondaryArray
- The secondary array of objects to match