Function: spam-stat-buffer-words-with-scores

spam-stat-buffer-words-with-scores is a byte-compiled function defined in spam-stat.el.gz.

Signature

(spam-stat-buffer-words-with-scores)

Documentation

Process current buffer, return the 15 most conspicuous words.

These are the words whose spam-stat differs the most from 0.5. The list returned contains elements of the form (WORD SCORE DIFF), where DIFF is the difference between SCORE and 0.5.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/spam-stat.el.gz
(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.
The list returned contains elements of the form \(WORD SCORE DIFF),
where DIFF is the difference between SCORE and 0.5."
  (let (result score) ;; word
    (maphash (lambda (word _ignore)
	       (setq score (spam-stat-score-word word)
		     result (cons (list word score (abs (- score 0.5)))
				  result)))
	     (spam-stat-buffer-words))
    (setq result (sort result (lambda (a b) (< (nth 2 b) (nth 2 a)))))
    (setcdr (nthcdr 14 result) nil)
    result))