From: yamaoka Date: Thu, 9 Jan 2003 01:37:10 +0000 (+0000) Subject: Synch with Oort Gnus. X-Git-Tag: t-gnus-6_15_12-00-quimby~20 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=00ca279ae701ad929fa7496bac65c19d5e353df7;p=elisp%2Fgnus.git- Synch with Oort Gnus. --- diff --git a/lisp/spam-stat.el b/lisp/spam-stat.el index fb1c3e5..7a01ec3 100644 --- a/lisp/spam-stat.el +++ b/lisp/spam-stat.el @@ -1,14 +1,12 @@ ;;; spam-stat.el --- detecting spam based on statistics -;; Copyright (C) 2002 Alex Schroeder +;; Copyright (C) 2002 Free Software Foundation, Inc. ;; Author: Alex Schroeder -;; Maintainer: Alex Schroeder -;; Version: 0.3.5 -;; Keywords: spam filtering gnus +;; Keywords: network ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SpamStat -;; This file is NOT part of GNU Emacs. +;; This file is part of GNU Emacs. ;; This is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by @@ -41,7 +39,7 @@ ;; considered to be a new spam mail; use this for new mail that has ;; not been processed before ;; -;; `spam-stat-buffer-is-no-spam' -- called in a buffer, that buffer +;; `spam-stat-buffer-is-non-spam' -- called in a buffer, that buffer ;; is considered to be a new non-spam mail; use this for new mail that ;; has not been processed before ;; @@ -77,7 +75,7 @@ ;; Typical test will involve calls to the following functions: ;; -;; Reset: (setq spam-stat (make-hash-table :test 'equal)) +;; Reset: (spam-stat-reset) ;; Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam") ;; Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc") ;; Save table: (spam-stat-save) @@ -98,7 +96,7 @@ ;; rules in `nnmail-split-fancy'. Somewhere among these rules, you ;; will filter spam. Here is how you would create your dictionary: -;; Reset: (setq spam-stat (make-hash-table :test 'equal)) +;; Reset: (spam-stat-reset) ;; Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam") ;; Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc") ;; Repeat for any other non-spam group you need... @@ -118,6 +116,8 @@ ;; Ted Zlatanov ;; Jesper Harder ;; Dan Schmidt +;; Lasse Rasinen +;; Milan Zamazal @@ -386,17 +386,17 @@ Use `spam-stat-ngood', `spam-stat-nbad', `spam-stat-good', (interactive) (with-temp-buffer (let ((standard-output (current-buffer))) - (insert "(setq spam-stat (spam-stat-to-hash-table '(") + (insert "(setq spam-stat-ngood " + (number-to-string spam-stat-ngood) + " spam-stat-nbad " + (number-to-string spam-stat-nbad) + " spam-stat (spam-stat-to-hash-table '(") (maphash (lambda (word entry) (prin1 (list word (spam-stat-good entry) (spam-stat-bad entry)))) spam-stat) - (insert ")) spam-stat-ngood " - (number-to-string spam-stat-ngood) - " spam-stat-nbad " - (number-to-string spam-stat-nbad) - ")")) + (insert ")))")) (write-file spam-stat-file))) (defun spam-stat-load () @@ -422,7 +422,9 @@ has appeared in bad mails." "Reset `spam-stat' to an empty hash-table. This deletes all the statistics." (interactive) - (setq spam-stat (make-hash-table :test 'equal))) + (setq spam-stat (make-hash-table :test 'equal) + spam-stat-ngood 0 + spam-stat-nbad 0)) ;; Scoring buffers