[Spambayes-checkins] spambayes/scripts sb_notesfilter.py,1.3,1.4

Richie Hindle richiehindle at users.sourceforge.net
Mon Nov 10 15:21:54 EST 2003


Update of /cvsroot/spambayes/spambayes/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv6062

Modified Files:
	sb_notesfilter.py 
Log Message:
The header_x_string options now live in the Headers section, not the
Hammie section.  I'm not able to test this edit, but it ought to be a no-
brainer and it can't make it any less broken.  8-)

Bugfix candidate.


Index: sb_notesfilter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_notesfilter.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sb_notesfilter.py	21 Oct 2003 21:46:31 -0000	1.3
--- sb_notesfilter.py	10 Nov 2003 20:21:52 -0000	1.4
***************
*** 202,213 ****
  
                  if prob < options["Categorization", "ham_cutoff"]:
!                     disposition = options["Hammie", "header_ham_string"]
                      numham += 1
                  elif prob > options["Categorization", "spam_cutoff"]:
!                     disposition = options["Hammie", "header_spam_string"]
                      docstomove += [doc]
                      numspam += 1
                  else:
!                     disposition = options["Hammie", "header_unsure_string"]
                      numuns += 1
  
--- 202,213 ----
  
                  if prob < options["Categorization", "ham_cutoff"]:
!                     disposition = options["Headers", "header_ham_string"]
                      numham += 1
                  elif prob > options["Categorization", "spam_cutoff"]:
!                     disposition = options["Headers", "header_spam_string"]
                      docstomove += [doc]
                      numspam += 1
                  else:
!                     disposition = options["Headers", "header_unsure_string"]
                      numuns += 1
  
***************
*** 235,241 ****
  
      if is_spam:
!         str = options["Hammie", "header_spam_string"]
      else:
!         str = options["Hammie", "header_ham_string"]
  
      print "Training %s" % (str)
--- 235,241 ----
  
      if is_spam:
!         str = options["Headers", "header_spam_string"]
      else:
!         str = options["Headers", "header_ham_string"]
  
      print "Training %s" % (str)
***************
*** 262,270 ****
          if notesindex.has_key(nid):
              trainedas = notesindex[nid]
!             if trainedas == options["Hammie", "header_spam_string"] and \
                 not is_spam:
                  # msg is trained as spam, is to be retrained as ham
                  bayes.unlearn(tokens, True)
!             elif trainedas == options["Hammie", "header_ham_string"] and \
                   is_spam:
                  # msg is trained as ham, is to be retrained as spam
--- 262,270 ----
          if notesindex.has_key(nid):
              trainedas = notesindex[nid]
!             if trainedas == options["Headers", "header_spam_string"] and \
                 not is_spam:
                  # msg is trained as spam, is to be retrained as ham
                  bayes.unlearn(tokens, True)
!             elif trainedas == options["Headers", "header_ham_string"] and \
                   is_spam:
                  # msg is trained as ham, is to be retrained as spam





More information about the Spambayes-checkins mailing list