From 878cc9a9581d1b672d73eef5242ad81e7e43e434 Mon Sep 17 00:00:00 2001 From: Teodor Zlatanov Date: Tue, 5 Nov 2002 02:26:07 +0000 Subject: [PATCH] (spam-stat-process-directory): add dir to message (spam-stat-reduce-size): No longer remove words with values close to 0.5, because the default value is 0.2. --- lisp/spam-stat.el | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/lisp/spam-stat.el b/lisp/spam-stat.el index 0a0fcf923..fb1c3e513 100644 --- a/lisp/spam-stat.el +++ b/lisp/spam-stat.el @@ -4,7 +4,7 @@ ;; Author: Alex Schroeder ;; Maintainer: Alex Schroeder -;; Version: 0.3.4 +;; Version: 0.3.5 ;; Keywords: spam filtering gnus ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SpamStat @@ -435,7 +435,6 @@ The default score for unknown words is stored in `spam-stat-unknown-word-score'." (spam-stat-score (gethash word spam-stat))) - (defun spam-stat-buffer-words-with-scores () "Process current buffer, return the 15 most conspicuous words. These are the words whose spam-stat differs the most from 0.5. @@ -491,7 +490,7 @@ check the variable `spam-stat-score-data'." (when (and (file-readable-p f) (file-regular-p f)) (setq count (1+ count)) - (message "Reading %.2f%%" (/ count max)) + (message "Reading %s: %.2f%%" dir (/ count max)) (insert-file-contents f) (funcall func) (erase-buffer)))))) @@ -537,25 +536,19 @@ You can use this to determine error rates." ;; Shrinking the dictionary -(defun spam-stat-reduce-size (&optional count distance) +(defun spam-stat-reduce-size (&optional count) "Reduce the size of `spam-stat'. This removes all words that occur less than COUNT from the dictionary. -COUNT defaults to 5. It also removes all words whose spam score -is less than DISTANCE from 0.5. DISTANCE defaults to 0.1, meaning that -all words with score between 0.4 and 0.6 are removed." +COUNT defaults to 5" (interactive) - (setq count (or count 5) - distance (or distance 0.1)) + (setq count (or count 5)) (maphash (lambda (key entry) - (when (or (< (+ (spam-stat-good entry) - (spam-stat-bad entry)) - count) - (< (abs (- (spam-stat-score entry) 0.5)) - distance)) + (when (< (+ (spam-stat-good entry) + (spam-stat-bad entry)) + count) (remhash key spam-stat))) spam-stat)) (provide 'spam-stat) ;;; spam-stat.el ends here - -- 2.34.1