public function getKeyValuesByWeight()
    {
        if(empty($this->keysByWeight)) {
            $weightPerToken = $this->getWeightPerToken();
            //make a copy of the array
            $keyValuesByWeight = $this->keyValues;
            array_walk($keyValuesByWeight, function(&$value, $key, $weightPerToken) {
                $value /= $weightPerToken;
            }, $this->totalTokens);
            
            $this->keysByWeight = $keyValuesByWeight;
        }
        return $this->keysByWeight;
    }
public function getKeyValuesByWeight()
    {
        if(empty($this->keysByWeight)) {
            $weightPerToken = $this->getWeightPerToken();
            //make a copy of the array
            $keyValuesByWeight = $this->keyValues;
            array_walk($keyValuesByWeight, function(&$value, $key, $weightPerToken) {
                $value /= $weightPerToken;
            }, $this->totalTokens);
            
            $this->keysByWeight = $keyValuesByWeight;
        }
        return $this->keysByWeight;
    }
public function getKeyValuesByWeight ( ) { if ( empty ( $ this -> keysByWeight ) ) { $ weightPerToken = $ this -> getWeightPerToken ( ) ; //make a copy of the array $ keyValuesByWeight = $ this -> keyValues ; array_walk ( $ keyValuesByWeight , function ( & $ value , $ key , $ weightPerToken ) { $ value /= $ weightPerToken ; } , $ this -> totalTokens ) ; $ this -> keysByWeight = $ keyValuesByWeight ; } return $ this -> keysByWeight ; }
Return an array with key weight pairs
@return array
Return an array with key weight pairs