com.datumbox.framework.core.common.text.analyzers
Class TextSimilarity
- java.lang.Object
-
- com.datumbox.framework.core.common.text.analyzers.TextSimilarity
-
public class TextSimilarity extends java.lang.ObjectThe TextSimilarity class provides methods that estimate the similarity of two different strings.
-
-
Constructor Summary
Constructors Constructor and Description TextSimilarity()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static doubleoliverSimilarity(java.lang.String text1, java.lang.String text2)This calculates the similarity between two strings as described in Programming Classics: Implementing the World's Best Algorithms by Oliver (ISBN 0-131-00413-1).static doubleshinglerSimilarity(java.lang.String text1, java.lang.String text2, int w)Estimates the w-shingler similarity between two texts.
-
-
-
Method Detail
-
oliverSimilarity
public static double oliverSimilarity(java.lang.String text1, java.lang.String text2)This calculates the similarity between two strings as described in Programming Classics: Implementing the World's Best Algorithms by Oliver (ISBN 0-131-00413-1).- Parameters:
text1-text2-- Returns:
-
shinglerSimilarity
public static double shinglerSimilarity(java.lang.String text1, java.lang.String text2, int w)Estimates the w-shingler similarity between two texts. The w is the number of word sequences that are used for the estimation. References: http://phpir.com/shingling-near-duplicate-detection http://www.std.org/~msm/common/clustering.html- Parameters:
text1-text2-w-- Returns:
-
-
DataMelt 3.0 © DataMelt by jWork.ORG