Skip to content

Commit

Permalink
add method setThreshold
Browse files Browse the repository at this point in the history
  • Loading branch information
jmkeil committed Aug 24, 2018
1 parent 5efd34e commit 4717dfb
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ private static <R> void match(Trie<R> termTrie, double threshold, String query,
/**
* Returns the Jaro Winkler similarity of two given {@link String}s.
*
* <b>Note:</b> Use {@link #apply(String)} to calculate the similarity
* of one {@link String} to many {@link String}s for performance reasons.
* <b>Note:</b> Use {@link #apply(String)} to calculate the similarity of one
* {@link String} to many {@link String}s for performance reasons.
*
* @param first
* First {@link String} to match.
Expand Down Expand Up @@ -358,7 +358,7 @@ public static <T> JaroWinklerSimilarity<T> with(Map<String, T> terms, double thr

private final Trie<T> trie;

private final double threshold;
private double threshold;

private JaroWinklerSimilarity(Trie<T> trie, double threshold) {
this.trie = trie;
Expand Down Expand Up @@ -402,4 +402,14 @@ public Map<T, Double> apply(String query) {
}
return results;
}

/**
* Changes the used threshold.
*
* @param threshold
* Minimum similarity of matching terms.
*/
public void setThreshold(double threshold) {
this.threshold = threshold;
}
}

0 comments on commit 4717dfb

Please sign in to comment.