public function randomWord($minLength = null, $maxLength = null)
{
if (is_null($minLength)) {
$minLength = $this->getMinWordLength();
}
if (is_null($maxLength)) {
$maxLength = $this->getMaxWordLength();
}
$wordList = $this->generateWordListSubset($minLength, $maxLength);
$words = \count($wordList);
if (!$words) {
throw new NotEnoughWordsException(sprintf('No words with a length between %d and %d', $minLength, $maxLength));
}
return $wordList[$this->randomInteger(0, $words - 1)];
}