[Python-checkins] python/nondist/sandbox/spambayes classifier.py,1.4,1.5

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sat, 31 Aug 2002 13:47:30 -0700


Update of /cvsroot/python/python/nondist/sandbox/spambayes
In directory usw-pr-cvs1:/tmp/cvs-serv25564

Modified Files:
	classifier.py 
Log Message:
spamprob():  Removed useless check that wordstream isn't empty.  For one
thing, it didn't work, since wordstream is often an iterator.  Even if
it did work, it isn't needed -- the probability of an empty wordstream
gets computed as 0.5 based on the total absence of evidence.


Index: classifier.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/spambayes/classifier.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** classifier.py	31 Aug 2002 17:25:10 -0000	1.4
--- classifier.py	31 Aug 2002 20:47:28 -0000	1.5
***************
*** 120,126 ****
              print "spamprob(%r)" % wordstream
  
-         if not wordstream:
-             raise ValueError("non-empty wordstream required")
- 
          # A priority queue to remember the MAX_DISCRIMINATORS best
          # probabilities, where "best" means largest distance from 0.5.
--- 120,123 ----