[Spambayes-checkins] spambayes classifier.py,1.45,1.46

Tim Peters tim_one@users.sourceforge.net
Fri Nov 1 16:01:20 2002


Update of /cvsroot/spambayes/spambayes
In directory usw-pr-cvs1:/tmp/cvs-serv7943

Modified Files:
	classifier.py 
Log Message:
WordInfo.__init__:  if an initial spamprob isn't specified, set it to
options.robinson_probability_x (the "unknown word" probability) instead
of to None.  If threads exist such that scoring can happen in parallel
with training, None could cause scoring to raise an exception.  "A real"
spamprob can't be computed until update_probabilities is called to
recalculate the entire database; before then, giving a new word the
unknown-word spamprob is thoroughly appropriate.


Index: classifier.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/classifier.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** classifier.py	27 Oct 2002 17:11:00 -0000	1.45
--- classifier.py	1 Nov 2002 16:01:14 -0000	1.46
***************
*** 62,66 ****
      # a word is no longer being used, it's just wasting space.
  
!     def __init__(self, atime, spamprob=None):
          self.atime = atime
          self.spamcount = self.hamcount = self.killcount = 0
--- 62,66 ----
      # a word is no longer being used, it's just wasting space.
  
!     def __init__(self, atime, spamprob=options.robinson_probability_x):
          self.atime = atime
          self.spamcount = self.hamcount = self.killcount = 0