This commit is contained in:
Looly
2023-04-12 17:23:09 +08:00
parent a96a95c988
commit a7c18e81f6
38 changed files with 426 additions and 175 deletions

View File

@@ -1,12 +1,15 @@
package org.dromara.hutool.core.text;
import org.dromara.hutool.core.lang.Console;
import org.dromara.hutool.core.util.RandomUtil;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* 文本相似度计算工具类单元测试
* @author looly
*
* @author looly
*/
public class TextSimilarityTest {
@@ -35,8 +38,20 @@ public class TextSimilarityTest {
}
@Test
public void similarTest(){
public void similarTest() {
final double abd = TextSimilarity.similar("abd", "1111");
Assertions.assertEquals(0, abd, 1);
}
@Test
@Disabled
void longestCommonSubstringLengthTest() {
// https://github.com/dromara/hutool/issues/3045
final String strCommon = RandomUtil.randomString(1024 * 32);
final String strA = RandomUtil.randomString(1024 * 32) + strCommon;
final String strB = RandomUtil.randomString(1024 * 32) + strCommon;
final int i = TextSimilarity.longestCommonSubstringLength(strA, strB);
Console.log(i);
}
}