public function tokenize($string)
{
$delimiters = preg_quote($this->delimiters, '/');
return array_map(function ($token) {
return ['t' => $token, 'w' => 1];
}, array_filter(array_map(function ($t) {
return mb_strtolower($t, 'UTF-8');
}, preg_split("/[\\s{$delimiters}]+/", $string, -1, PREG_SPLIT_NO_EMPTY)), function ($word) {
return !in_array($word, $this->stopWords);
}));
}