Package rs.baselib.util
Class LevenshteinDistance
java.lang.Object
rs.baselib.util.LevenshteinDistance
- All Implemented Interfaces:
DistanceCalculation
Implements Levensstein distance.
- Since:
- 1.2.9
- Author:
- ralph
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getDistance
(String s1, String s2) Return the distance according to the algorithm used.
-
Field Details
-
INSTANCE
static instance
-
-
Constructor Details
-
LevenshteinDistance
public LevenshteinDistance()
-
-
Method Details
-
getDistance
Return the distance according to the algorithm used.Important! Both strings must not be null.
- Specified by:
getDistance
in interfaceDistanceCalculation
- Parameters:
s1
- first strings2
- second string- Returns:
- the distance between two strings
-