]> git.wh0rd.org - tt-rss.git/commitdiff
apparently classifier may return NaN
authorAndrew Dolgov <noreply@fakecake.org>
Thu, 18 Jun 2015 15:53:52 +0000 (18:53 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Thu, 18 Jun 2015 15:53:52 +0000 (18:53 +0300)
plugins/af_sort_bayes/init.php

index 2293ea4905789548a639e0e26cbd50ad8db653a8..51867f08ea8cb7a40d783be82e2ce586b0224a99 100644 (file)
@@ -315,10 +315,10 @@ class Af_Sort_Bayes extends Plugin {
                                        $prob_good = $result[$id_good];
                                        $prob_bad = $result[$id_bad];
 
-                                       if ($prob_good > 0.90) {
+                                       if (!is_nan($prob_good) && $prob_good > 0.90) {
                                                $dst_category = $id_good;
                                                $article["score_modifier"] += $this->score_modifier;
-                                       } else if ($prob_bad > 0.90) {
+                                       } else if (!is_nan($prob_bad) && $prob_bad > 0.90) {
                                                $dst_category = $id_bad;
                                                $article["score_modifier"] -= $this->score_modifier;
                                        }