Class LevenshteinResults
- java.lang.Object
-
- org.apache.commons.text.similarity.LevenshteinResults
-
public class LevenshteinResults extends Object
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
Constructors Constructor Description LevenshteinResults(Integer distance, Integer insertCount, Integer deleteCount, Integer substituteCount)
Create the results for a detailed Levenshtein distance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Integer
getDeleteCount()
Get the number of character deletion needed to change one character sequence to other.Integer
getDistance()
Get the distance between two character sequences.Integer
getInsertCount()
Get the number of insertion needed to change one character sequence into another.Integer
getSubstituteCount()
Get the number of character substitution needed to change one character sequence into another.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
LevenshteinResults
public LevenshteinResults(Integer distance, Integer insertCount, Integer deleteCount, Integer substituteCount)
Create 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 Detail
-
getDistance
public Integer getDistance()
Get the distance between two character sequences.- Returns:
- distance between two character sequence
-
getInsertCount
public Integer getInsertCount()
Get the number of insertion needed to change one character sequence into another.- Returns:
- insert character count
-
getDeleteCount
public Integer getDeleteCount()
Get the number of character deletion needed to change one character sequence to other.- Returns:
- delete character count
-
getSubstituteCount
public Integer getSubstituteCount()
Get the number of character substitution needed to change one character sequence into another.- Returns:
- substitute character count
-
-