|
$weightPerToken = $this->getWeightPerToken(); |
|
//make a copy of the array |
|
$keyValuesByWeight = $this->keyValues; |
|
array_walk($keyValuesByWeight, function(&$value, $key, $weightPerToken) { |
|
$value /= $weightPerToken; |
|
}, $this->totalTokens); |
Perhaps there is a mistake.
array_walk: If the optional third parameter is supplied, it will be passed as the third parameter to the callback funcname.
So, $weightPerToken inside callback is just $this->totalTokens not $this->getWeightPerToken().
php-text-analysis/src/Analysis/FreqDist.php
Lines 119 to 124 in 9b96d25
Perhaps there is a mistake.
array_walk: If the optional third parameter is supplied, it will be passed as the third parameter to the callback funcname.So,
$weightPerTokeninside callback is just$this->totalTokensnot$this->getWeightPerToken().