public final class FuzzyStringMatcher extends FuzzyMatcher<java.lang.Character>
Constructor and Description |
---|
FuzzyStringMatcher(double matchCost,
double insertionCost,
double deletionCost,
double substitutionCost)
Used to create a fuzzy string matcher with the given costs for insertion and deletions
|
FuzzyStringMatcher(FuzzyCost<java.lang.Character> costAnalyzer)
Creates a fuzzy string matcher with the given costs
|
Modifier and Type | Method and Description |
---|---|
FuzzyMatcherAlignmentResult<java.lang.Character> |
getAlignment(java.lang.CharSequence mainString,
java.lang.CharSequence secondaryString)
Returns the alignment found as the best fuzzy match for the two strings
|
double |
getPercentMatch(java.lang.CharSequence mainString,
java.lang.CharSequence secondaryString)
Returns a percent value indicating how well the two strings matched
|
double |
getScore(java.lang.CharSequence mainString,
java.lang.CharSequence secondaryString)
Gets the match score for the two strings
|
getAlignment, getAlignment, getPercentMatch, getPercentMatch, getScore, getScore, getScoreByResult, getWeightedPercentMatch, getWeightedPercentMatch
public FuzzyStringMatcher(double matchCost, double insertionCost, double deletionCost, double substitutionCost)
matchCost
- The cost for matching charactersinsertionCost
- The cost of inserting a value into the main setdeletionCost
- The cost of deleting values from the main setsubstitutionCost
- The cost of substituting one value for anotherpublic FuzzyStringMatcher(FuzzyCost<java.lang.Character> costAnalyzer)
costAnalyzer
- The analyzer used to get costs dynamically based on the valuespublic double getScore(@NotNull java.lang.CharSequence mainString, @NotNull java.lang.CharSequence secondaryString)
mainString
- The main stringsecondaryString
- The secondary string@NotNull public FuzzyMatcherAlignmentResult<java.lang.Character> getAlignment(@NotNull java.lang.CharSequence mainString, @NotNull java.lang.CharSequence secondaryString)
mainString
- The main string to matchsecondaryString
- The secondary string to matchpublic double getPercentMatch(@NotNull java.lang.CharSequence mainString, @NotNull java.lang.CharSequence secondaryString)
mainString
- The main string to testsecondaryString
- The secondary string to test