public function get_words($text)
{
$detect = $this->getClassifier();
$stopwords = $this->getStopwords();
$lang = $detect->detect($text);
if (!is_string($lang)) {
throw new \RuntimeException("Cannot detect the language of the text");
}
if (empty($stopwords[$lang])) {
throw new \RuntimeException("We dont have an stop word for {$lang}, please add it in " . __DIR__ . "/Stopword/{$lang}-stopwords.txt and run generate.php");
}
$this->stopword = $stopwords[$lang];
$this->lang = $lang;
return parent::get_words($text);
}