mirror of
https://github.com/TotalFreedomMC/OpenInv.git
synced 2025-08-10 14:33:08 +00:00
Fix mistake in string comparison utility
This commit is contained in:
parent
be9874ba1d
commit
fd70f260ba
1 changed files with 2 additions and 2 deletions
|
@ -36,14 +36,14 @@ public class StringMetric {
|
||||||
public static float compareJaroWinkler(String a, String b) {
|
public static float compareJaroWinkler(String a, String b) {
|
||||||
final float jaroScore = compareJaro(a, b);
|
final float jaroScore = compareJaro(a, b);
|
||||||
|
|
||||||
if (jaroScore < (float) 0.1) {
|
if (jaroScore < (float) 0.7) {
|
||||||
return jaroScore;
|
return jaroScore;
|
||||||
}
|
}
|
||||||
|
|
||||||
String prefix = commonPrefix(a, b);
|
String prefix = commonPrefix(a, b);
|
||||||
int prefixLength = Math.min(prefix.codePointCount(0, prefix.length()), 4);
|
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));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue