[Spambayes-checkins] spambayes/spambayes classifier.py,1.3,1.4
Tim Stone
timstone4 at users.sourceforge.net
Sat Feb 8 09:18:40 EST 2003
Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs1:/tmp/cvs-serv21717
Modified Files:
classifier.py
Log Message:
Somehow, nham and nspam became strings in a user's database. This fix
ensures that this event doesn't break classification, and corrects the
database in the process.
Index: classifier.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/classifier.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** classifier.py 29 Jan 2003 03:23:34 -0000 1.3
--- classifier.py 8 Feb 2003 17:18:37 -0000 1.4
***************
*** 385,391 ****
self.probcache = {} # nuke the prob cache
if is_spam:
! self.nspam += 1
else:
! self.nham += 1
for word in Set(wordstream):
--- 385,391 ----
self.probcache = {} # nuke the prob cache
if is_spam:
! self.nspam = int(self.nspam) + 1 # account for string nspam
else:
! self.nham = int(self.nham) + 1 # account for string nham
for word in Set(wordstream):
More information about the Spambayes-checkins
mailing list