public class Similarity extends Object
| 构造器和说明 |
|---|
Similarity() |
| 限定符和类型 | 方法和说明 |
|---|---|
static float |
cos(String a,
String b)
余弦相似性通过测量两个向量的夹角的余弦值来度量它们之间的相似性。
|
static float |
hamming(String a,
String b)
汉明距离是编辑距离中的一个特殊情况,仅用来计算两个等长字符串中不一致的字符个数。
|
static float |
jaccard(String a,
String b)
The Jaccard index, also known as Intersection over Union and the Jaccard similarity coefficient
(originally given the French name coefficient de communauté by Paul Jaccard),
is a statistic used for gauging the similarity and diversity of sample sets.
|
static float |
levenshtein(String a,
String b)
莱文斯坦距离,又称 Levenshtein 距离,是编辑距离的一种。
|
static float |
sorensenDice(String a,
String b)
Sorensen Dice 相似度系数
The Sørensen–Dice coefficient (see below for other names) is a statistic used to gauge the similarity of two samples.
|
public static float cos(String a, String b)
a - 字符串Ab - 字符串Bpublic static float hamming(String a, String b)
a - 字符串Ab - 字符串Bpublic static float levenshtein(String a, String b)
a - 字符串Ab - 字符串Bpublic static float sorensenDice(String a, String b)
a - 字符串Ab - 字符串Bpublic static float jaccard(String a, String b)
a - 字符串Ab - 字符串BCopyright © 2022. All rights reserved.