@Beta public class DamerauLevenshteinAlgorithm extends Object
Constructor and Description |
---|
DamerauLevenshteinAlgorithm(int deleteCost,
int insertCost,
int replaceCost,
int swapCost)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
execute(String source,
String target)
Compute the Damerau-Levenshtein distance between the specified source
string and the specified target string.
|
public DamerauLevenshteinAlgorithm(int deleteCost, int insertCost, int replaceCost, int swapCost)
deleteCost
- the cost of deleting a character.insertCost
- the cost of inserting a character.replaceCost
- the cost of replacing a character.swapCost
- the cost of swapping two adjacent characters.Copyright © 2012–2016. All rights reserved.