Function: spam-stat-to-hash-table

spam-stat-to-hash-table is a byte-compiled function defined in spam-stat.el.gz.

Signature

(spam-stat-to-hash-table ENTRIES)

Documentation

Turn list ENTRIES into a hash table and store as spam-stat.

Every element in ENTRIES has the form (WORD GOOD BAD) where WORD is the word string, NGOOD is the number of good mails it has appeared in, NBAD is the number of bad mails it has appeared in, GOOD is the number of times it appeared in good mails, and BAD is the number of times it has appeared in bad mails.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/spam-stat.el.gz
(defun spam-stat-to-hash-table (entries)
  "Turn list ENTRIES into a hash table and store as `spam-stat'.
Every element in ENTRIES has the form \(WORD GOOD BAD) where WORD is
the word string, NGOOD is the number of good mails it has appeared in,
NBAD is the number of bad mails it has appeared in, GOOD is the number
of times it appeared in good mails, and BAD is the number of times it
has appeared in bad mails."
  (let ((table (make-hash-table :size (length entries)
				:test 'equal)))
    (mapc (lambda (l)
	    (puthash (car l)
		     (spam-stat-make-entry (nth 1 l) (nth 2 l))
		     table))
	  entries)
    table))