Top Description Methods
org.apache.commons.text.similarity

public Interface SimilarityScore<R>

extends ObjectSimilarityScore<CharSequence, R>
Known Direct Subinterfaces
org.apache.commons.text.similarity.EditDistance
Known Direct Implementers
org.apache.commons.text.similarity.IntersectionSimilarity, org.apache.commons.text.similarity.JaccardSimilarity, org.apache.commons.text.similarity.JaroWinklerSimilarity, org.apache.commons.text.similarity.LongestCommonSubsequence
Type Parameters
<R>
The type of similarity score unit.

Scores CharSequence similarity, like a String.

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:

Notice, these are two of the properties that contribute to d being a metric.

Further, this intended to be BiFunction<CharSequence, CharSequence, R>. The apply method accepts a pair of CharSequence parameters and returns an R type similarity score.

Since
1.0

Method Summary

Modifier and TypeMethod and Description
public R

Returns:

The similarity score between two CharSequences.
apply
(CharSequence
the "left" or "first" input.
left
,
CharSequence
the "right" or "second" input.
right
)

Redeclares org.apache.commons.text.similarity.ObjectSimilarityScore.apply.

Compares two CharSequences.

Method Detail

applyback to summary
public R apply(CharSequence left, CharSequence right)

Redeclares org.apache.commons.text.similarity.ObjectSimilarityScore.apply.

Compares two CharSequences.

Parameters
left:CharSequence

the "left" or "first" input.

right:CharSequence

the "right" or "second" input.

Returns:R

The similarity score between two CharSequences.

Annotations
@Override