private function extractLocations(array $words, $fulltext)
{
$locations = [];
foreach ($words as $word) {
$wordLen = strlen($word);
$loc = stripos($fulltext, $word);
while ($loc !== false) {
$locations[] = $loc;
$loc = stripos($fulltext, $word, $loc + $wordLen);
}
}
$locations = array_unique($locations);
sort($locations);
return $locations;
}