diff --git a/src/Support/Tokenizer.php b/src/Support/Tokenizer.php index 8166e27..2cef252 100644 --- a/src/Support/Tokenizer.php +++ b/src/Support/Tokenizer.php @@ -7,7 +7,7 @@ class Tokenizer extends AbstractTokenizer implements TokenizerInterface public function tokenize($text, $stopwords = []) { - $text = mb_strtolower($text); + $text = mb_strtolower($text ?? ''); $split = preg_split($this->getPattern(), $text, -1, PREG_SPLIT_NO_EMPTY); return array_diff($split, $stopwords); }