[Spambayes] nothing gets updated

Richie Hindle richie at entrian.com
Mon Jan 20 22:18:31 EST 2003


[Skip]
> I'd like to switch back to pop3proxy and start folding my user interface
> changes into it, but I still have trouble running it
>     [...]
> DeprecationWarning
>     [...]
> KeyError: '__coerce__'

Looks like I need to test this with 2.3a1... I'm downloading it now.

> Looking through the code in both pop3proxy and proxytrainer, I see calls to
> self._doSave() or self.doSave() at the end of onReview(), but all they do is
> call self.bayes.store().  Where is the actual decision about a message's
> status translated into a change in the state of the database, either
> in-memory or on-disk?

In pop3proxy, the training (ie. the calling of Classifier.learn()) is done
when messages are moved from the Unknown corpus to one of the Ham or Spam
corpuses.  This code:

            # Create the Trainers.
            self.spamTrainer = storage.SpamTrainer(self.bayes)
            self.hamTrainer = storage.HamTrainer(self.bayes)
            self.spamCorpus.addObserver(self.spamTrainer)
            self.hamCorpus.addObserver(self.hamTrainer)

sets up trainers which automatically train the classifier when messages are
moved between corpuses using Corpus.takeMessage(), which is called by
onReview().  This code is missing from proxytrainer.py - overzealous code
trimming?  8-)

-- 
Richie Hindle
richie at entrian.com




More information about the Spambayes mailing list