[Spambayes-checkins] spambayes/Outlook2000 manager.py,1.37,1.38
Mark Hammond
mhammond at users.sourceforge.net
Fri Dec 13 01:28:12 EST 2002
Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1:/tmp/cvs-serv16930
Modified Files:
manager.py
Log Message:
Some more debugging code to try and track where the database sizes
occasionally get screwed.
Index: manager.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** manager.py 27 Nov 2002 05:49:53 -0000 1.37
--- manager.py 13 Dec 2002 09:28:09 -0000 1.38
***************
*** 225,231 ****
def SaveBayes(self):
bayes = self.bayes
if self.verbose:
! print ("Saving bayes database with %d spam and %d good messages" %
! (bayes.nspam, bayes.nham))
print " ->", self.bayes_filename
cPickle.dump(bayes, open(self.bayes_filename,"wb"), 1)
--- 225,237 ----
def SaveBayes(self):
bayes = self.bayes
+ # Try and work out where this count sometimes goes wrong.
+ if bayes.nspam + bayes.nham != len(self.message_db):
+ print "WARNING: Bayes database has %d messages, " \
+ "but training database has %d" % \
+ (bayes.nspam + bayes.nham, len(self.message_db))
+
if self.verbose:
! print "Saving bayes database with %d spam and %d good messages" %\
! (bayes.nspam, bayes.nham)
print " ->", self.bayes_filename
cPickle.dump(bayes, open(self.bayes_filename,"wb"), 1)
More information about the Spambayes-checkins
mailing list