;ELC   
;;; Compiled
;;; in Emacs version 29.4
;;; with all optimizations.



(byte-code "\300\301!\210\302\303\304\305\306\307\310\311&\210\312\313\314\315\316DD\317\320\321%\210\312\322\314\315\323DD\324\320\325%\210\312\326\314\315\327DD\330\320\331%\210\312\332\314\315\333DD\334\320\331%\210\312\335\314\315\336DD\337\320\340%\210\312\341\314\315\342DD\343\320\325%\210\312\344\314\315\345DD\346\320\347%\210\312\350\314\315\351DD\352\320\353%\210\312\354\314\315\355DD\356\320\331%\207" [require mail-parse custom-declare-group spam-stat nil "Statistical spam detection for Emacs.\nUse the functions to build a dictionary of words and their statistical\ndistribution in spam and non-spam mails.  Then use a function to determine\nwhether a buffer contains spam or not." :version "22.1" :group gnus custom-declare-variable spam-stat-file funcall function #[0 "\300\207" ["~/.spam-stat.el"] 1 #1=""] "File used to save and load the dictionary.\nSee `spam-stat-to-hash-table' for the format of the file." :type file spam-stat-unknown-word-score #[0 "\300\207" [0.2] 1 #1#] "The score to use for unknown words.\nAlso used for words that don't appear often enough." number spam-stat-max-word-length #[0 "\300\207" [15] 1 #1#] "Only words shorter than this will be considered." integer spam-stat-max-buffer-length #[0 "\300\207" [10240] 1 #1#] "Only the beginning of buffers will be analyzed.\nThis variable says how many characters this will be." spam-stat-split-fancy-spam-group #[0 "\300\207" ["mail.spam"] 1 #1#] "Name of the group where spam should be stored.\nIf `spam-stat-split-fancy' is used in fancy splitting rules.  Has\nno effect when spam-stat is invoked through spam.el." string spam-stat-split-fancy-spam-threshold #[0 "\300\207" [0.9] 1 #1#] "Spam score threshold in spam-stat-split-fancy." spam-stat-washing-hook #[0 "\300\207" [nil] 1 #1#] "Hook applied to each message before analysis." hook spam-stat-score-buffer-user-functions #[0 "\300\207" [nil] 1 #1#] "List of additional scoring functions.\nCalled one by one on the buffer.\n\nIf all of these functions return non-nil answers, these numerical\nanswers are added to the computed spam stat score on the buffer.  If\nyou defun such functions, make sure they don't return the buffer in a\nnarrowed state or such: use, for example, `save-excursion'.  Each of\nyour functions is also passed the initial spam-stat score which might\naid in your scoring.\n\nAlso be careful when defining such functions.  If they take a long\ntime, they will slow down your mail splitting.  Thus, if the buffer is\nlarge, don't forget to use smaller regions, by wrapping your work in,\nsay, `with-spam-stat-max-buffer-size'." (repeat sexp) spam-stat-process-directory-age #[0 "\300\207" [90] 1 #1#] "Max. age of files to be processed in directory, in days.\nWhen using `spam-stat-process-spam-directory' or\n`spam-stat-process-non-spam-directory', only files that have\nbeen touched in this many days will be considered.  Without\nthis filter, re-training spam-stat with several thousand messages\nwill start to take a very long time."] 8)#@57 Time stamp of last change of spam-stat-file on this run
(defvar spam-stat-last-saved-at nil (#$ . 3098))#@129 Syntax table used when processing mails for statistical analysis.
The important part is which characters are word constituents.
(defvar spam-stat-syntax-table (byte-code "\301!\302\303\304#\210\302\305\304#\210\302\306\304#\210\302\307\304#\210\302\310\304#\210\302\311\304#\210\207" [text-mode-syntax-table copy-syntax-table modify-syntax-entry 45 "w" 95 46 33 63 43] 5) (#$ . 3209))#@46 Whether the spam-stat database needs saving.
(defvar spam-stat-dirty nil (#$ . 3606))#@78 Buffer to use for scoring while splitting.
This is set by hooking into Gnus.
(defvar spam-stat-buffer nil (#$ . 3697))#@33 Name of the `spam-stat-buffer'.
(defvar spam-stat-buffer-name " *spam stat buffer*" (#$ . 3821))#@42 Coding system used for `spam-stat-file'.
(defvar spam-stat-coding-system (byte-code "\300\301!\203 \301\207\302\207" [mm-coding-system-p emacs-mule raw-text] 2) (#$ . 3923))#@59 Store a copy of the current buffer in `spam-stat-buffer'.
(defalias 'spam-stat-store-current-buffer #[0 "pr\302!q\210\303 \210\304!\210p\211)\207" [spam-stat-buffer-name spam-stat-buffer get-buffer-create erase-buffer insert-buffer-substring] 3 (#$ . 4103)])#@93 Store a copy of the current article in `spam-stat-buffer'.
This uses `gnus-article-buffer'.
(defalias 'spam-stat-store-gnus-article-buffer #[0 "rq\210\301 )\207" [gnus-original-article-buffer spam-stat-store-current-buffer] 1 (#$ . 4370)])#@269 Hash table used to store the statistics.
Use `spam-stat-load' to load the file.
Every word is used as a key in this table.  The value is a vector.
Use `spam-stat-ngood', `spam-stat-nbad', `spam-stat-good',
`spam-stat-bad', and `spam-stat-score' to access this vector.
(defvar spam-stat (make-hash-table :test 'equal) (#$ . 4617))#@45 The number of good mails in the dictionary.
(defvar spam-stat-ngood 0 (#$ . 4952))#@44 The number of bad mails in the dictionary.
(defvar spam-stat-nbad 0 (#$ . 5040))#@73 Return the number of times this word belongs to good mails.

(fn ENTRY)
(defalias 'spam-stat-good #[257 "\211\300H\207" [0] 3 (#$ . 5126)])
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put spam-stat-good speed -1 put byte-optimizer byte-compile-inline-expand] 5)#@72 Return the number of times this word belongs to bad mails.

(fn ENTRY)
(defalias 'spam-stat-bad #[257 "\211\300H\207" [1] 3 (#$ . 5411)])
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put spam-stat-bad speed -1 put byte-optimizer byte-compile-inline-expand] 5)#@41 Set the score of this word.

(fn ENTRY)
(defalias 'spam-stat-score #[257 "\211\203 \211\301H\207\207" [spam-stat-unknown-word-score 2] 3 (#$ . 5693)])
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put spam-stat-score speed -1 put byte-optimizer byte-compile-inline-expand] 5)#@76 Set the number of times this word belongs to good mails.

(fn ENTRY VALUE)
(defalias 'spam-stat-set-good #[514 "\300I\207" [0] 5 (#$ . 5992)])
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put spam-stat-set-good speed -1 put byte-optimizer byte-compile-inline-expand] 5)#@75 Set the number of times this word belongs to bad mails.

(fn ENTRY VALUE)
(defalias 'spam-stat-set-bad #[514 "\300I\207" [1] 5 (#$ . 6286)])
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put spam-stat-set-bad speed -1 put byte-optimizer byte-compile-inline-expand] 5)#@47 Set the score of this word.

(fn ENTRY VALUE)
(defalias 'spam-stat-set-score #[514 "\300I\207" [2] 5 (#$ . 6577)])
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put spam-stat-set-score speed -1 put byte-optimizer byte-compile-inline-expand] 5)#@59 Return a vector with the given properties.

(fn GOOD BAD)
(defalias 'spam-stat-make-entry #[514 "\300\301#\211\302!\303I\266\207" [vector nil spam-stat-compute-score 2] 8 (#$ . 6844)])
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put spam-stat-make-entry speed -1 put byte-optimizer byte-compile-inline-expand] 5)#@62 Compute the score of this word.  1.0 means spam.

(fn ENTRY)
(defalias 'spam-stat-compute-score #[257 "\302\211\303H\262_\304\211\305H\262!\\\306W\203 \307\207\303U\203\" \310\207	\303U\203* \311\207\311\310	\245\245	\245\\\245^]\207" [spam-stat-ngood spam-stat-nbad 2.0 0 float 1 5 0.2 0.99 0.01] 9 (#$ . 7186)])#@89 Narrow the buffer down to the first 4k characters, then evaluate BODY.

(fn &rest BODY)
(defalias 'with-spam-stat-max-buffer-size '(macro . #[128 "\300\301BB\207" [save-restriction (when (> (- (point-max) (point-min)) spam-stat-max-buffer-length) (narrow-to-region (point-min) (+ (point-min) spam-stat-max-buffer-length)))] 4 (#$ . 7517)]))#@71 Return a hash table of words and number of occurrences in the buffer.
(defalias 'spam-stat-buffer-words #[0 "\303\304!\210\214deZV\203 ee\\}\210\305 p\306\307#\216\310	!\210eb\210\311\312\313\"\314\211\315\316\314\317#\203N \320\321!\262\322\321#T\262G\nW\203) \323#\210\202) \266\203)\266\202)\207" [spam-stat-max-buffer-length spam-stat-syntax-table spam-stat-max-word-length run-hooks spam-stat-washing-hook syntax-table make-closure #[0 "r\300q\210\302\301!)\207" [V0 V1 set-syntax-table] 2] set-syntax-table make-hash-table :test equal nil re-search-forward "\\w+" t match-string-no-properties 0 gethash puthash] 9 (#$ . 7864)])#@48 Consider current buffer to be a new spam mail.
(defalias 'spam-stat-buffer-is-spam #[0 "T\302\303\304 \"\210\305\211\207" [spam-stat-nbad spam-stat-dirty maphash #[514 "\301\"\211\203 \211\211\302H\262\\\302I\266\202/ \303\304\305#\211\306!\307I\266\266\202\262\211\306!\307I\266\310#\207" [spam-stat gethash 1 0 vector nil spam-stat-compute-score 2 puthash] 11 "\n\n(fn WORD COUNT)"] spam-stat-buffer-words t] 3 (#$ . 8517)])#@52 Consider current buffer to be a new non-spam mail.
(defalias 'spam-stat-buffer-is-non-spam #[0 "T\302\303\304 \"\210\305\211\207" [spam-stat-ngood spam-stat-dirty maphash #[514 "\301\"\211\203 \211\211\302H\262\\\302I\266\202/ \302\303\304#\211\305!\306I\266\266\202\262\211\305!\306I\266\307#\207" [spam-stat gethash 0 vector nil spam-stat-compute-score 2 puthash] 11 "\n\n(fn WORD COUNT)"] spam-stat-buffer-words t] 3 (#$ . 8976)])
(autoload 'gnus-message "gnus-util")#@57 Consider current buffer no longer normal mail but spam.
(defalias 'spam-stat-buffer-change-to-spam #[0 "T	S\303\304\305 \"\210\306\211\207" [spam-stat-nbad spam-stat-ngood spam-stat-dirty maphash #[514 "\301\"\211\204 \302\303\304\"\207\211\211\305H\262Z\305I\266\211\211\306H\262\\\306I\266\211\307!\310I\266\311#\207" [spam-stat gethash gnus-message 8 "This buffer has unknown words in it" 0 1 spam-stat-compute-score 2 puthash] 8 "\n\n(fn WORD COUNT)"] spam-stat-buffer-words t] 3 (#$ . 9479)])#@57 Consider current buffer no longer spam but normal mail.
(defalias 'spam-stat-buffer-change-to-non-spam #[0 "S	T\303\304\305 \"\210\306\211\207" [spam-stat-nbad spam-stat-ngood spam-stat-dirty maphash #[514 "\301\"\211\204 \302\303\304\"\207\211\211\305H\262\\\305I\266\211\211\306H\262Z\306I\266\211\307!\310I\266\311#\207" [spam-stat gethash gnus-message 8 "This buffer has unknown words in it" 0 1 spam-stat-compute-score 2 puthash] 8 "\n\n(fn WORD COUNT)"] spam-stat-buffer-words t] 3 (#$ . 10008)])#@114 Save the `spam-stat' hash table as lisp file.
With a prefix argument save unconditionally.

(fn &optional FORCE)
(defalias 'spam-stat-save #[256 "\211\204 \205R 	\306\307\310\"\311\312\"\216r\211q\210p\313\314	\"c\210\313\315#c\210\316\317\"\210\320c*\210r\211q\210\321\322\211\322\323%+\266\324\325\"\210\322\326!\3278\262\211\207" [spam-stat-dirty spam-stat-coding-system coding-system-for-write spam-stat-file standard-output spam-stat-ngood generate-new-buffer " *temp file*" t make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] format ";-*- coding: %s; -*-\n" "(setq spam-stat-ngood %d spam-stat-nbad %d\nspam-stat (spam-stat-to-hash-table '(" maphash #[514 "\300\211\301H\262\211\302H\262E!\207" [prin1 0 1] 8 "\n\n(fn WORD ENTRY)"] ")))" write-region nil 0 message "Saved %s." file-attributes 5 spam-stat-nbad spam-stat spam-stat-last-saved-at] 9 (#$ . 10543) "P"])#@44 Read the `spam-stat' hash table from disk.
(defalias 'spam-stat-load #[0 "\n\203\f \305\306!\202: \307\303!\203$ \203$ \310\311\f!\3128\262\"\2047 \313\f!\210\314\311\f!\3128\262\211\202: \305\315!)\207" [spam-stat-coding-system coding-system-for-read spam-stat-dirty spam-stat-last-saved-at spam-stat-file message "Spam stat not loaded: spam-stat-dirty t" boundp time-equal-p file-attributes 5 load-file nil "Spam stat file not loaded: no change in disk."] 5 (#$ . 11475)])#@384 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.

(fn ENTRIES)
(defalias 'spam-stat-to-hash-table #[257 "\300\301G\302\303$\304\305\306\"\"\210\207" [make-hash-table :size :test equal mapc make-closure #[257 "\301@A@\3028\303\304#\211\305!\302I\266\266\202\300#\207" [V0 puthash 2 vector nil spam-stat-compute-score] 11 "\n\n(fn L)"]] 6 (#$ . 11966)])#@76 Reset `spam-stat' to an empty hash-table.
This deletes all the statistics.
(defalias 'spam-stat-reset #[0 "\304\305\306\"\307\211\310\211\207" [spam-stat spam-stat-ngood spam-stat-nbad spam-stat-dirty make-hash-table :test equal 0 t] 4 (#$ . 12655) nil])#@60 Raw data used in the last run of `spam-stat-score-buffer'.
(defvar spam-stat-score-data nil (#$ . 12919))#@116 Return score for WORD.
The default score for unknown words is stored in
`spam-stat-unknown-word-score'.

(fn WORD)
(defalias 'spam-stat-score-word #[257 "\302\"\211\203\f \211\303H\207	\207" [spam-stat spam-stat-unknown-word-score gethash 2] 4 (#$ . 13031)])
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put spam-stat-score-word speed -1 put byte-optimizer byte-compile-inline-expand] 5)#@245 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.
(defalias 'spam-stat-buffer-words-with-scores #[0 "\300C\300C\301\302\303#\304 \"\210\305\242\306\"\240\210\307\242\233\300\241\210\242\207" [nil maphash make-closure #[514 "\300\304\n\"\211\203 \211\305H\266\202\202 \266\202\240\210\301\300\242\306\300\242\307Z!E\301\242B\240\207" [V0 V1 spam-stat spam-stat-unknown-word-score gethash 2 abs 0.5] 8 "\n\n(fn WORD IGNORE)"] spam-stat-buffer-words sort #[514 "\3008\3008W\207" [2] 5 "\n\n(fn A B)"] 14] 7 (#$ . 13444)])#@110 Return a score describing the spam-probability for this buffer.
Add user supplied modifications if supplied.
(defalias 'spam-stat-score-buffer #[0 "\301 \302\303\"\304\305\"\211\304\305\302\306\"\"\\\245\3071\" \310!0\202$ \210\311\211\203. \\\202/ \312\313!\203: \314\315\"\210\207" [spam-stat-score-data spam-stat-buffer-words-with-scores mapcar cadr apply * #[257 "\300Z\207" [1] 3 "\n\n(fn X)"] (error) spam-stat-score-buffer-user nil called-interactively-p any message "%S"] 9 (#$ . 14177) nil])#@19 

(fn &rest ARGS)
(defalias 'spam-stat-score-buffer-user #[128 "\301\302\303\"\"\304>?\205 \305\306\"\207" [spam-stat-score-buffer-user-functions mapcar make-closure #[257 "\301\300\"\207" [V0 apply] 4 "\n\n(fn FN)"] nil apply +] 5 (#$ . 14695)])#@240 Return the name of the spam group if the current mail is spam.
Use this function on `nnmail-split-fancy'.  If you are interested in
the raw data used for the last run of `spam-stat-score-buffer',
check the variable `spam-stat-score-data'.
(defalias 'spam-stat-split-fancy #[0 "\3041 q\210eb\210\305 	V\205 \306\307!\203 \310\311\n\"\2100\207\312\313\"\210\314\207" [spam-stat-buffer spam-stat-split-fancy-spam-threshold spam-stat-score-data spam-stat-split-fancy-spam-group (error) spam-stat-score-buffer boundp nnmail-split-trace mapc #[257 "\211B\211\207" [nnmail-split-trace] 3 "\n\n(fn ENTRY)"] message "Error in spam-stat-split-fancy: %S" nil] 4 (#$ . 14954)])#@24 Strip the Xref header.
(defalias 'spam-stat-strip-xref #[0 "\214\300 \210\301\302\303\304#\205 \305\224\305\225|)\207" [mail-narrow-to-head re-search-forward "^Xref:.*\n" nil t 0] 4 (#$ . 15633)])
(autoload 'time-to-number-of-days "time-date")#@84 Process all the regular files in directory DIR using function FUNC.

(fn DIR FUNC)
(defalias 'spam-stat-process-directory #[514 "\301\302\303#\211G\304\245\305\306\307\302\"r\211q\210\310\311\"\216\211\205l \211@\312!\203e \313!\203e \314!\3158\262\305V\203e \316\317\314!\3208\262!!W\203e T\262\321\322	\245#\210\323!\210\324 \210 \210\325 \210A\266\202\202 *\207" [spam-stat-process-directory-age directory-files t "\\`[^.]" 100.0 0 generate-new-buffer " *temp*" make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] file-readable-p file-regular-p file-attributes 7 time-to-number-of-days time-since 5 message "Reading %s: %.2f%%" insert-file-contents-literally spam-stat-strip-xref erase-buffer] 13 (#$ . 15883)])#@67 Process all the regular files in directory DIR as spam.

(fn DIR)
(defalias 'spam-stat-process-spam-directory #[257 "\300\301\"\207" [spam-stat-process-directory spam-stat-buffer-is-spam] 4 (#$ . 16655) "D"])#@71 Process all the regular files in directory DIR as non-spam.

(fn DIR)
(defalias 'spam-stat-process-non-spam-directory #[257 "\300\301\"\207" [spam-stat-process-directory spam-stat-buffer-is-non-spam] 4 (#$ . 16870) "D"])#@29 Return size of `spam-stat'.
(defalias 'spam-stat-count #[0 "\301!\207" [spam-stat hash-table-count] 2 (#$ . 17097)])#@423 Test all the regular files in directory DIR for spam.
If the result is 1.0, then all files are considered spam.
If the result is 0.0, non of the files is considered spam.
You can use this to determine error rates.

If VERBOSE is non-nil display names of files detected as spam or
non-spam in a temporary buffer.  If it is the symbol `ham',
display non-spam files; otherwise display spam files.

(fn DIR &optional VERBOSE)
(defalias 'spam-stat-test-directory #[513 "\306\307\310#\311\211G\312\313\245\314\315\316\307\"r\211q\210\317\320\"\216\211\203\223 \211@\321!\203\214 \322!\203\214 \323!\3248\262\314V\203\214 T\262\325\326\245\245#\210\327!\210\330 \262\331V\203` T\262\n\203\211 \331V\203| \n\332=\204\211 \211	B\262	\202\211 \n\332=\203\211 \211	B\262	\333 \210A\266\202\202 *\266\203\331 r\334\335!q\210p\336 \210\311\211\307\211\307\333 \210\337\340!+\210\211%\211\203\322 \211@\341!\210\342 \210A\266\202\202\276 \210\343!)\266\325\344\245$\207" [default-directory buffer-read-only buffer-file-name buffer-undo-list inhibit-modification-hooks inhibit-read-only directory-files t "\\`[^.]" nil 0.0 100.0 0 generate-new-buffer " *temp*" make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] file-readable-p file-regular-p file-attributes 7 message "Reading %.2f%%, score %.2f" insert-file-contents-literally spam-stat-score-buffer 0.9 ham erase-buffer get-buffer-create "*spam-stat results*" kill-all-local-variables run-hooks temp-buffer-setup-hook princ terpri internal-temp-output-buffer-show "Final score: %d / %d = %f" standard-output] 18 (#$ . 17221) "DDirectory: "])#@146 Reduce the size of `spam-stat'.
This removes all words that occur less than COUNT from the dictionary.
COUNT defaults to 5

(fn &optional COUNT)
(defalias 'spam-stat-reduce-size #[256 "\211C\211\242\206	 \302\240\210\303\304\305\"\"\210\306\211\207" [spam-stat spam-stat-dirty 5 maphash make-closure #[514 "\211\211\302H\262\211\303H\262\\\300\242W\205 \304	\"\207" [V0 spam-stat 0 1 remhash] 6 "\n\n(fn KEY ENTRY)"] t] 6 (#$ . 18895) nil])#@39 Install the spam-stat function hooks.
(defalias 'spam-stat-install-hooks-function #[0 "\300\301\302\"\210\300\303\304\"\207" [add-hook nnmail-prepare-incoming-message-hook spam-stat-store-current-buffer gnus-select-article-hook spam-stat-store-gnus-article-buffer] 3 (#$ . 19350) nil])#@41 Uninstall the spam-stat function hooks.
(defalias 'spam-stat-unload-hook #[0 "\300\301\302\"\210\300\303\304\"\207" [remove-hook nnmail-prepare-incoming-message-hook spam-stat-store-current-buffer gnus-select-article-hook spam-stat-store-gnus-article-buffer] 3 (#$ . 19641) nil])
(byte-code "\300\301\211\"\210\302\303!\207" [add-hook spam-stat-unload-hook provide spam-stat] 3)
