We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9e46d41 + 6d4c08e commit 5bd1bb9Copy full SHA for 5bd1bb9
src/main/java/info/debatty/java/stringsimilarity/NGram.java
@@ -48,9 +48,9 @@ public final double distance(final String s0, final String s1) {
48
49
if (sl == 0 || tl == 0) {
50
if (sl == tl) {
51
- return 1;
52
- } else {
53
return 0;
+ } else {
+ return 1;
54
}
55
56
@@ -129,6 +129,6 @@ public final double distance(final String s0, final String s1) {
129
130
// our last action in the above loop was to switch d and p, so p now
131
// actually has the most recent cost counts
132
- return 1.0 - (p[sl] / Math.max(tl, sl));
+ return p[sl] / Math.max(tl, sl);
133
134
0 commit comments