Skip to content

Commit

Permalink
remove levenshtein similarity literal
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewErispe committed Oct 17, 2024
1 parent 345e29e commit 7fa8954
Showing 1 changed file with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public final class LinkerProbabilistic {
static final JaroSimilarity JARO_SIMILARITY = new JaroSimilarity();
static final ExactSimilarity EXACT_SIMILARITY = new ExactSimilarity();
static final SoundexSimilarity SOUNDEX_SIMILARITY = new SoundexSimilarity();
static final LevenshteinSimilarity LEVENSHTEIN_SIMILARITY = new LevenshteinSimilarity();
static final LevenshteinSimilarityPercentage LEVENSHTEIN_SIMILARITY_PERCENTAGE = new LevenshteinSimilarityPercentage();
private static final int METRIC_MIN = 0;
private static final int METRIC_MAX = 1;
Expand Down Expand Up @@ -84,7 +83,6 @@ public enum SimilarityFunctionName {
JACCARD_SIMILARITY,
SOUNDEX_SIMILARITY,
EXACT_SIMILARITY,
LEVENSHTEIN_SIMILARITY,
LEVENSHTEIN_SIMILARITY_PERCENTAGE
}

Expand All @@ -93,7 +91,6 @@ public enum SimilarityFunctionName {
SimilarityFunctionName.JARO_SIMILARITY, JARO_SIMILARITY,
SimilarityFunctionName.JACCARD_SIMILARITY, JACCARD_SIMILARITY,
SimilarityFunctionName.SOUNDEX_SIMILARITY, SOUNDEX_SIMILARITY,
SimilarityFunctionName.LEVENSHTEIN_SIMILARITY, LEVENSHTEIN_SIMILARITY,
SimilarityFunctionName.LEVENSHTEIN_SIMILARITY_PERCENTAGE, LEVENSHTEIN_SIMILARITY_PERCENTAGE,
SimilarityFunctionName.EXACT_SIMILARITY, EXACT_SIMILARITY
);
Expand Down Expand Up @@ -341,23 +338,6 @@ public Double apply(

}

static class LevenshteinSimilarity implements SimilarityScore<Double> {

private final LevenshteinDistance levenshteinDistance = new LevenshteinDistance();

@Override
public Double apply(
final CharSequence left,
final CharSequence right) {
if (StringUtils.isEmpty(left) || StringUtils.isEmpty(right)) {
return 0.5;
}

return Double.valueOf(levenshteinDistance.apply(left, right));
}

}

static class JaroSimilarity implements SimilarityScore<Double> {

@Override
Expand Down

0 comments on commit 7fa8954

Please sign in to comment.