Class LevenshteinResults
java.lang.Object
org.apache.commons.text.similarity.LevenshteinResults
Container class to store Levenshtein distance between two character sequences.
Stores the count of insert, deletion and substitute operations needed to change one character sequence into another.
This class is immutable.
- Since:
- 1.0
-
Constructor Summary
ConstructorDescriptionLevenshteinResults
(Integer distance, Integer insertCount, Integer deleteCount, Integer substituteCount) Constructs the results for a detailed Levenshtein distance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets the number of character deletion needed to change one character sequence to other.Gets the distance between two character sequences.Gets the number of insertion needed to change one character sequence into another.Gets the number of character substitution needed to change one character sequence into another.int
hashCode()
toString()
-
Constructor Details
-
LevenshteinResults
public LevenshteinResults(Integer distance, Integer insertCount, Integer deleteCount, Integer substituteCount) Constructs the results for a detailed Levenshtein distance.- Parameters:
distance
- distance between two character sequences.insertCount
- insert character countdeleteCount
- delete character countsubstituteCount
- substitute character count
-
-
Method Details
-
equals
-
getDeleteCount
Gets the number of character deletion needed to change one character sequence to other.- Returns:
- delete character count
-
getDistance
Gets the distance between two character sequences.- Returns:
- distance between two character sequence
-
getInsertCount
Gets the number of insertion needed to change one character sequence into another.- Returns:
- insert character count
-
getSubstituteCount
Gets the number of character substitution needed to change one character sequence into another.- Returns:
- substitute character count
-
hashCode
-
toString
-