]> source.dussan.org Git - rspamd.git/commitdiff
[Rework] Change logic of fuzzy probabilities scoring
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 21 Jan 2019 14:32:44 +0000 (14:32 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 21 Jan 2019 14:32:44 +0000 (14:32 +0000)
src/plugins/fuzzy_check.c

index bfb6b4d72f8b1423c7a5855639aaa31829454e22..6b0843948c1537874f535ba97afa1c3265cdaf48 100644 (file)
@@ -1903,6 +1903,9 @@ fuzzy_insert_result (struct fuzzy_client_session *session,
                res->type = FUZZY_RESULT_IMG;
        }
        else {
+               /* Calc real probability */
+               nval *= sqrtf (rep->v1.prob);
+
                if (cmd->shingles_count > 0) {
                        type = "txt";
                        res->type = FUZZY_RESULT_TXT;
@@ -1910,8 +1913,6 @@ fuzzy_insert_result (struct fuzzy_client_session *session,
                else {
                        res->type = FUZZY_RESULT_BIN;
                }
-
-               nval *= rspamd_normalize_probability (rep->v1.prob, 0.5);
        }
 
        res->score = nval;