public function extractSummary($text = null, $limit = null, $withoutStopWords = true)
{
if (!$text) {
return;
}
$config = new Config();
if ($withoutStopWords) {
$config->addListener(new Stopword());
}
$analyzer = new Summary($config);
try {
$summary = $analyzer->getSummary($this->_cleanupText($text));
if ($summary && is_integer($limit)) {
$summary = mb_strimwidth($summary, 0, $limit, "...");
}
} catch (\RuntimeException $e) {
$summary = $text;
}
if ($summary == "") {
$keywords = $text;
}
return $summary;
}