Class Util


  • public class Util
    extends Object
    • Constructor Detail

      • Util

        public Util()
    • 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 2
        size1 - token size of first input
        size2 - 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 compare
        newSource - second string to compare
        triGramAnalyzer - trigram analyzer for FM-score calculation
        Returns:
        Dice's Coefficient as a float