Function: spam-stat-compute-score

spam-stat-compute-score is a byte-compiled function defined in spam-stat.el.gz.

Signature

(spam-stat-compute-score ENTRY)

Documentation

Compute the score of this word. 1.0 means spam.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/spam-stat.el.gz
;; Computing

(defun spam-stat-compute-score (entry)
  "Compute the score of this word.  1.0 means spam."
   ;; promote all numbers to floats for the divisions
   (let* ((g (* 2.0 (spam-stat-good entry)))
	  (b (float (spam-stat-bad entry))))
     (cond ((< (+ g b) 5)
	    .2)
	   ((= 0 spam-stat-ngood)
	    .99)
	   ((= 0 spam-stat-nbad)
	    .01)
	   (t
	    (max .01
		 (min .99 (/ (/ b spam-stat-nbad)
			     (+ (/ g spam-stat-ngood)
				(/ b spam-stat-nbad)))))))))