From: Andrew Dolgov Date: Thu, 18 Jun 2015 06:42:20 +0000 (+0300) Subject: experiment: switch to 3-gram tokens X-Git-Tag: 16.3~284 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e0940bfc4fdfad943a111b52569a1917e083b2c0;p=tt-rss.git experiment: switch to 3-gram tokens --- diff --git a/plugins/af_sort_bayes/init.php b/plugins/af_sort_bayes/init.php index fdb573ec..d2e659ca 100644 --- a/plugins/af_sort_bayes/init.php +++ b/plugins/af_sort_bayes/init.php @@ -39,7 +39,7 @@ class Af_Sort_Bayes extends Plugin { $dst_category = "UGLY"; $nbs = new NaiveBayesianStorage($_SESSION["uid"]); - $nb = new NaiveBayesian($nbs); + $nb = new NaiveBayesianNgram($nbs, 3); $result = $this->dbh->query("SELECT score, guid, title, content FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id AND id = " . $article_id . " AND owner_uid = " . $_SESSION["uid"]); @@ -264,7 +264,7 @@ class Af_Sort_Bayes extends Plugin { $owner_uid = $article["owner_uid"]; $nbs = new NaiveBayesianStorage($owner_uid); - $nb = new NaiveBayesian($nbs); + $nb = new NaiveBayesianNgram($nbs, 3); $ref = $nbs->getReference($article["guid"], false); @@ -336,7 +336,7 @@ class Af_Sort_Bayes extends Plugin { $this->dbh->query("COMMIT"); $nbs = new NaiveBayesianStorage($_SESSION["uid"]); - $nb = new NaiveBayesian($nbs); + $nb = new NaiveBayesianNgram($nbs, 3); $nb->updateProbabilities(); }