Closed vincentsch closed 6 years ago
I'm running into this as well when attempting to do something simple like:
$api->getOnlyKeyWords("Nothing to look at here");
@vincentsch @khalwat thank for the report. I'll fix it soon.
Fixed in the last release: 1.0.4, https://github.com/DavidBelicza/PHP-Science-TextRank/releases/tag/1.0.4
src/Tool/Score.php:
protected function normalize(int $value, int $min, int $max): float { $normalized = ($value - $min) / ($max - $min); return $normalized; }
When $max and $min have the same value there's a division by zero.