src/NGrams/Statistic2D.php
/**
    * Calculate the Dice coefficient
    * @param array $ngram Array of ngrams with frequencies
    * @return float Return the calculated value
    */
Calculate the Dice coefficient
@param array $ngram Array of ngrams with frequencies
@return float Return the calculated value
Calculate the Dice coefficient @param array $ngram Array of ngrams with frequencies @return float Return the calculated value
static public function dice(array $ngram, int $totalNgrams) : float
    {
        $var = self::setStatVariables($ngram, $totalNgrams);
        return (2 * $var['jointFrequency'] / ($var['leftFrequency'] + $var['rightFrequency']));
    }
static public function dice ( array $ ngram , int $ totalNgrams ) : float { $ var = self :: setStatVariables ( $ ngram , $ totalNgrams ) ; return ( 2 * $ var [ 'jointFrequency' ] / ( $ var [ 'leftFrequency' ] + $ var [ 'rightFrequency' ] ) ) ; }
Calculate the Dice coefficient
 @param array $ngram Array of ngrams with frequencies
 @return float Return the calculated value
Calculate the Dice coefficient @param array $ngram Array of ngrams with frequencies @return float Return the calculated value