[Spambayes-checkins] spambayes/Outlook2000 addin.py,1.88,1.89
Mark Hammond
mhammond at users.sourceforge.net
Fri Aug 8 11:11:20 EDT 2003
Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1:/tmp/cvs-serv28837
Modified Files:
addin.py
Log Message:
Fix [ 780612 ] Outlook incorrectly trains on moves messages.
Index: addin.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v
retrieving revision 1.88
retrieving revision 1.89
diff -C2 -d -r1.88 -r1.89
*** addin.py 8 Aug 2003 06:45:47 -0000 1.88
--- addin.py 8 Aug 2003 17:11:18 -0000 1.89
***************
*** 197,209 ****
# otherwise just ignore.
if manager.config.training.train_recovered_spam:
- subject = msgstore_message.GetSubject()
import train
! print "Training on message '%s' - " % subject,
! if train.train_message(msgstore_message, False, manager, rescore = True):
! print "trained as good"
else:
! print "already was trained as good"
! assert train.been_trained_as_ham(msgstore_message, manager)
! manager.SaveBayesPostIncrementalTrain()
return
if manager.config.filter.enabled:
--- 197,226 ----
# otherwise just ignore.
if manager.config.training.train_recovered_spam:
import train
! if train.been_trained_as_spam(msgstore_message, manager):
! need_train = True
else:
! prop = msgstore_message.GetField(manager.config.general.field_score_name)
! # We may not have been able to save the score - re-score now
! if prop is None:
! prop = manager.score(msgstore_message)
! # If it was not previously classified as either 'Spam' or
! # 'Unsure', then this event is unlikely to be the user
! # re-classifying (and in fact it may simply be the Outlook
! # rules moving the item.
! need_train = manager.config.filter.unsure_threshold < prop * 100
!
! subject = msgstore_message.subject
! if need_train:
! print "Training on message '%s' - " % subject,
! if train.train_message(msgstore_message, False, manager, rescore = True):
! print "trained as good"
! else:
! print "already was trained as good"
! assert train.been_trained_as_ham(msgstore_message, manager)
! manager.SaveBayesPostIncrementalTrain()
! else:
! manager.LogDebug(1, "Message '%s' was previously been seen, but " \
! "did not need to be trained as ham" % subject)
return
if manager.config.filter.enabled:
***************
*** 548,552 ****
traceback.print_exc()
print "Tests FAILED. Sorry about that. If I were you, I would do a full re-train ASAP"
! print "Please delete any test messages from your Spam, Unsure or Inbox folders first."
# The "Delete As Spam" and "Recover Spam" button
--- 565,569 ----
traceback.print_exc()
print "Tests FAILED. Sorry about that. If I were you, I would do a full re-train ASAP"
! print "Please delete any test messages from your Spam, Unsure or Inbox/Watch folders first."
# The "Delete As Spam" and "Recover Spam" button
More information about the Spambayes-checkins
mailing list