public function getWordsByComplexity($string)
    {
        $words = $this->getWords($string);
        $analysis = new FrequencyAnalysis($words);
        $sortedWords = $analysis->getKeyValuesByFrequency();
        $wordsByFrequency = array_unique(array_keys($sortedWords));

        usort($wordsByFrequency, function ($a, $b) {
            return strlen($b) - strlen($a);
        });

        return $wordsByFrequency;
    }
public function getWordsByComplexity($string)
    {
        $words = $this->getWords($string);
        $analysis = new FrequencyAnalysis($words);
        $sortedWords = $analysis->getKeyValuesByFrequency();
        $wordsByFrequency = array_unique(array_keys($sortedWords));

        usort($wordsByFrequency, function ($a, $b) {
            return strlen($b) - strlen($a);
        });

        return $wordsByFrequency;
    }
public function getWordsByComplexity ( $ string ) { $ words = $ this -> getWords ( $ string ) ; $ analysis = new FrequencyAnalysis ( $ words ) ; $ sortedWords = $ analysis -> getKeyValuesByFrequency ( ) ; $ wordsByFrequency = array_unique ( array_keys ( $ sortedWords ) ) ; usort ( $ wordsByFrequency , function ( $ a , $ b ) { return strlen ( $ b ) - strlen ( $ a ) ; } ) ; return $ wordsByFrequency ; }
Get words by complexity.

@param string $string

@return array
Get words by complexity .