public class Util extends Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static float |
calculateDiceCoefficient(int intersection,
int size1,
int size2)
Calculate Dice's Coefficient
|
static float |
calculateNgramDiceCoefficient(String originalSource,
String newSource,
AlphabeticNgramTokenizer tokenizer)
Calculate Dice's Coefficient for two strings with tokens as ngrams.
|
static AlphabeticNgramTokenizer |
createNgramTokenizer(int ngramSize,
LocaleId localeId)
Create a
AlphabeticNgramTokenizer |
public static float calculateDiceCoefficient(int intersection,
int size1,
int size2)
intersection - number of tokens in common between input 1 and input 2size1 - token size of first inputsize2 - token size of second inputpublic static float calculateNgramDiceCoefficient(String originalSource, String newSource, AlphabeticNgramTokenizer tokenizer)
originalSource - first string to comparenewSource - second string to comparetokenizer - ngram tokenizerpublic static AlphabeticNgramTokenizer createNgramTokenizer(int ngramSize, LocaleId localeId)
AlphabeticNgramTokenizerngramSize - size of ngram in characterslocaleId - LocaleId of the content being tokenizedAlphabeticNgramTokenizerCopyright © 2019. All rights reserved.