Class Util
- java.lang.Object
-
- net.sf.okapi.lib.search.lucene.scorer.Util
-
public class Util extends Object
-
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static floatcalculateDiceCoefficient(int intersection, int size1, int size2)Calculate Dice's Coefficientstatic floatcalculateNgramDiceCoefficient(String originalSource, String newSource, org.apache.lucene.analysis.Analyzer triGramAnalyzer)Calculate Dice's Coefficient for two strings with tokens as ngrams.
-
-
-
Method Detail
-
calculateDiceCoefficient
public static float calculateDiceCoefficient(int intersection, int size1, int size2)Calculate Dice's Coefficient- Parameters:
intersection- number of tokens in common between input 1 and input 2size1- token size of first inputsize2- token size of second input- Returns:
- Dice's Coefficient as a float
-
calculateNgramDiceCoefficient
public static float calculateNgramDiceCoefficient(String originalSource, String newSource, org.apache.lucene.analysis.Analyzer triGramAnalyzer)
Calculate Dice's Coefficient for two strings with tokens as ngrams.- Parameters:
originalSource- first string to comparenewSource- second string to comparetriGramAnalyzer- trigram analyzer for FM-score calculation- Returns:
- Dice's Coefficient as a float
-
-