调整:/tlocale 命令重构
调整:bstats 统计跳过配置文件判断
修复:NMSUtil19 工具的部分语法错误导致 1.8 版本启动报错
修复:StirngUtils 工具 similarDegree 方法的蜜汁报错
新增:面子工程
This commit is contained in:
坏黑
2018-06-12 22:11:07 +08:00
parent 8e5279d720
commit 6b58848996
10 changed files with 211 additions and 101 deletions

View File

@@ -36,9 +36,13 @@ public class StringUtils {
public static double similarDegree(String strA, String strB){
String newStrA = removeSign(max(strA, strB));
String newStrB = removeSign(min(strA, strB));
int temp = Math.max(newStrA.length(), newStrB.length());
int temp2 = longestCommonSubstring(newStrA, newStrB).length();
return temp2 * 1.0 / temp;
try {
int temp = Math.max(newStrA.length(), newStrB.length());
int temp2 = longestCommonSubstring(newStrA, newStrB).length();
return temp2 * 1.0 / temp;
} catch (Exception ignored) {
return 0;
}
}
private static String max(String strA, String strB) {