getKeys() public method

Return the sorted keys by frequency desc
public getKeys ( ) : array
return array
 /**
  * Compute the Pointwise Mutual Information on the collocations
  * @return array
  */
 public function getCollocationsByPmi()
 {
     $nGramFreqDist = new FreqDist(NGramFactory::create($this->tokens, $this->nGramSize));
     $unigramsFreqDist = new FreqDist($this->tokens);
     $dataSet = [];
     foreach ($nGramFreqDist->getKeys() as $nGramToken) {
         $tokens = explode(" ", $nGramToken);
         $tally = 1;
         foreach ($tokens as $unigramToken) {
             $tally *= $unigramsFreqDist->getKeyValuesByWeight()[$unigramToken];
         }
         // get probabilities of all tokens
         $dataSet[$nGramToken] = log($nGramFreqDist->getKeyValuesByWeight()[$nGramToken] / $tally);
     }
     arsort($dataSet);
     return $dataSet;
 }