Interface SimilarityScore<R>
-
- Type Parameters:
R- The type of similarity score unit.
- All Superinterfaces:
java.util.function.BiFunction<java.lang.CharSequence,java.lang.CharSequence,R>,ObjectSimilarityScore<java.lang.CharSequence,R>
- All Known Subinterfaces:
EditDistance<R>
- All Known Implementing Classes:
CosineDistance,DamerauLevenshteinDistance,HammingDistance,IntersectionSimilarity,JaccardDistance,JaccardSimilarity,JaroWinklerDistance,JaroWinklerSimilarity,LevenshteinDetailedDistance,LevenshteinDistance,LongestCommonSubsequence,LongestCommonSubsequenceDistance
public interface SimilarityScore<R> extends ObjectSimilarityScore<java.lang.CharSequence,R>
ScoresCharSequencesimilarity, like aString.A string similarity score is intended to have some of the properties of a metric, yet allowing for exceptions, like the Jaro-Winkler similarity score.
A similarity score is the function
d: [X * X] -> [0, INFINITY)with the following properties:d(x,y) >= 0, non-negativity or separation axiomd(x,y) == d(y,x), symmetry.
Notice, these are two of the properties that contribute to
dbeing a metric.Further, this intended to be BiFunction<CharSequence, CharSequence, R>. The
applymethod accepts a pair ofCharSequenceparameters and returns anRtype similarity score.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Rapply(java.lang.CharSequence left, java.lang.CharSequence right)Compares two CharSequences.
-
-
-
Method Detail
-
apply
R apply(java.lang.CharSequence left, java.lang.CharSequence right)
Compares two CharSequences.- Specified by:
applyin interfacejava.util.function.BiFunction<java.lang.CharSequence,java.lang.CharSequence,R>- Specified by:
applyin interfaceObjectSimilarityScore<java.lang.CharSequence,R>- Parameters:
left- the "left" or "first" input.right- the "right" or "second" input.- Returns:
- The similarity score between two CharSequences.
-
-