From fd70f260ba4a2d99b003e14433b3b023b2042bc6 Mon Sep 17 00:00:00 2001 From: Jikoo Date: Mon, 27 May 2019 20:05:58 -0400 Subject: [PATCH] Fix mistake in string comparison utility --- api/src/main/java/com/lishid/openinv/util/StringMetric.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/com/lishid/openinv/util/StringMetric.java b/api/src/main/java/com/lishid/openinv/util/StringMetric.java index 6a85ada..cf13770 100644 --- a/api/src/main/java/com/lishid/openinv/util/StringMetric.java +++ b/api/src/main/java/com/lishid/openinv/util/StringMetric.java @@ -36,14 +36,14 @@ public class StringMetric { public static float compareJaroWinkler(String a, String b) { final float jaroScore = compareJaro(a, b); - if (jaroScore < (float) 0.1) { + if (jaroScore < (float) 0.7) { return jaroScore; } String prefix = commonPrefix(a, b); int prefixLength = Math.min(prefix.codePointCount(0, prefix.length()), 4); - return jaroScore + (prefixLength * (float) 0.7 * (1.0f - jaroScore)); + return jaroScore + (prefixLength * (float) 0.1 * (1.0f - jaroScore)); }