[Spambayes-checkins] spambayes hammie.py,1.8,1.9

Guido van Rossum gvanrossum@users.sourceforge.net
Fri, 06 Sep 2002 21:50:47 -0700


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

Modified Files:
	hammie.py 
Log Message:
Use the new tokenize(), which accepts our Message objects.


Index: hammie.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/hammie.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** hammie.py	7 Sep 2002 04:31:08 -0000	1.8
--- hammie.py	7 Sep 2002 04:50:45 -0000	1.9
***************
*** 215,219 ****
          sys.stdout.write("\r%6d" % i)
          sys.stdout.flush()
!         bayes.learn(tokenize(str(msg)), is_spam, False)
      print
  
--- 215,219 ----
          sys.stdout.write("\r%6d" % i)
          sys.stdout.flush()
!         bayes.learn(tokenize(msg), is_spam, False)
      print
  
***************
*** 227,231 ****
      """Filter (judge) a message"""
      msg = email.message_from_file(input)
!     prob, clues = bayes.spamprob(tokenize(str(msg)), True)
      if prob < 0.9:
          disp = "No"
--- 227,231 ----
      """Filter (judge) a message"""
      msg = email.message_from_file(input)
!     prob, clues = bayes.spamprob(tokenize(msg), True)
      if prob < 0.9:
          disp = "No"
***************
*** 245,249 ****
      for msg in mbox:
          i += 1
!         prob, clues = bayes.spamprob(tokenize(str(msg)), True)
          isspam = prob >= 0.9
          print "%6d %4.2f %1s" % (i, prob, isspam and "S" or "."),
--- 245,249 ----
      for msg in mbox:
          i += 1
!         prob, clues = bayes.spamprob(tokenize(msg), True)
          isspam = prob >= 0.9
          print "%6d %4.2f %1s" % (i, prob, isspam and "S" or "."),