src/Generators/StopwordGenerator.php
/**
     * Adds frequency counts to the stopWords property
     * @param array $tokens
     */
Adds frequency counts to the stopWords property
@param array $tokens
Adds frequency counts to the stopWords property @param array $tokens
protected function computeUsingFreqDist(array $tokens)
    {
        $freqDist = (new FreqDist($tokens))
            ->getKeyValuesByFrequency();
        foreach($freqDist as $token => $freqValue)
        {
            if(!isset($this->stopWords[$token])) {
                $this->stopWords[$token] = $freqValue;
            } else {
                $this->stopWords[$token] += $freqValue;
            }
        }        
    }
protected function computeUsingFreqDist ( array $ tokens ) { $ freqDist = ( new FreqDist ( $ tokens ) ) -> getKeyValuesByFrequency ( ) ; foreach ( $ freqDist as $ token => $ freqValue ) { if ( ! isset ( $ this -> stopWords [ $ token ] ) ) { $ this -> stopWords [ $ token ] = $ freqValue ; } else { $ this -> stopWords [ $ token ] += $ freqValue ; } } }
Adds frequency counts to the stopWords property
 @param array $tokens
Adds frequency counts to the stopWords property @param array $tokens