[Spambayes-checkins] spambayes/Outlook2000 addin.py, 1.144, 1.145 filter.py, 1.41, 1.42 manager.py, 1.101, 1.102 msgstore.py, 1.96, 1.97 train.py, 1.40, 1.41 oastats.py, 1.11, NONE

Tony Meyer anadelonbrin at users.sourceforge.net
Tue Dec 21 22:48:41 CET 2004


Update of /cvsroot/spambayes/spambayes/Outlook2000
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26759/Outlook2000

Modified Files:
	addin.py filter.py manager.py msgstore.py train.py 
Removed Files:
	oastats.py 
Log Message:
Use spambayes.Stats instead of out own oastats module.  The central one has changed
 to be much like the oastats one was, except that it uses the messageinfo database
 and not another pickle.

We also now stored the 'classified' (c) attribute in the message info database for
 Outlook.

Index: addin.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v
retrieving revision 1.144
retrieving revision 1.145
diff -C2 -d -r1.144 -r1.145
*** addin.py	20 Dec 2004 04:24:54 -0000	1.144
--- addin.py	21 Dec 2004 21:48:30 -0000	1.145
***************
*** 695,700 ****
          for msgstore_message in msgstore_messages:
              # Record this recovery in our stats.
!             self.manager.stats.RecordManualClassification(False,
!                                     self.manager.score(msgstore_message))
              # Record the original folder, in case this message is not where
              # it was after filtering, or has never been filtered.
--- 695,700 ----
          for msgstore_message in msgstore_messages:
              # Record this recovery in our stats.
!             self.manager.stats.RecordTraining(False,
!                                 self.manager.score(msgstore_message))
              # Record the original folder, in case this message is not where
              # it was after filtering, or has never been filtered.
***************
*** 763,767 ****
  
                  # Record this recovery in our stats.
!                 self.manager.stats.RecordManualClassification(True,
                                          self.manager.score(msgstore_message))
                  # Must train before moving, else we lose the message!
--- 763,767 ----
  
                  # Record this recovery in our stats.
!                 self.manager.stats.RecordTraining(True,
                                          self.manager.score(msgstore_message))
                  # Must train before moving, else we lose the message!
***************
*** 1144,1148 ****
          self.explorers_collection = None
          self.toolbar = None
-         self.manager.stats.Store() # save stats
          self.close() # disconnect events.
  
--- 1144,1147 ----
***************
*** 1505,1513 ****
              # Report some simple stats, for session, and for total.
              print "Session:"
!             print "\r\n".join(self.manager.stats.GetStats(True))
              print "Total:"
              print "\r\n".join(self.manager.stats.GetStats())
-             # Save stats.
-             self.manager.stats.Store()
              self.manager.Close()
              self.manager = None
--- 1504,1510 ----
              # Report some simple stats, for session, and for total.
              print "Session:"
!             print "\r\n".join(self.manager.stats.GetStats(session_only=True))
              print "Total:"
              print "\r\n".join(self.manager.stats.GetStats())
              self.manager.Close()
              self.manager = None

Index: filter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/filter.py,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** filter.py	8 Dec 2004 04:27:59 -0000	1.41
--- filter.py	21 Dec 2004 21:48:37 -0000	1.42
***************
*** 17,26 ****
--- 17,29 ----
          disposition = "Yes"
          attr_prefix = "spam"
+         msg.c = "spam"
      elif prob_perc >= config.unsure_threshold:
          disposition = "Unsure"
          attr_prefix = "unsure"
+         msg.c = "unsure"
      else:
          disposition = "No"
          attr_prefix = "ham"
+         msg.c = "ham"
  
      ms = mgr.message_store

Index: manager.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v
retrieving revision 1.101
retrieving revision 1.102
diff -C2 -d -r1.101 -r1.102
*** manager.py	20 Dec 2004 03:37:38 -0000	1.101
--- manager.py	21 Dec 2004 21:48:37 -0000	1.102
***************
*** 17,21 ****
  
  import msgstore
- import oastats
  
  try:
--- 17,20 ----
***************
*** 123,127 ****
  def import_core_spambayes_stuff(ini_filenames):
      global bayes_classifier, bayes_tokenize, bayes_storage, bayes_options, \
!            bayes_message
      if "spambayes.Options" in sys.modules:
          # The only thing we are worried about here is spambayes.Options
--- 122,126 ----
  def import_core_spambayes_stuff(ini_filenames):
      global bayes_classifier, bayes_tokenize, bayes_storage, bayes_options, \
!            bayes_message, bayes_stats
      if "spambayes.Options" in sys.modules:
          # The only thing we are worried about here is spambayes.Options
***************
*** 150,157 ****
--- 149,158 ----
      from spambayes import storage
      from spambayes import message
+     from spambayes import Stats
      bayes_classifier = classifier
      bayes_tokenize = tokenize
      bayes_storage = storage
      bayes_message = message
+     bayes_stats = Stats
      assert "spambayes.Options" in sys.modules, \
          "Expected 'spambayes.Options' to be loaded here"
***************
*** 454,458 ****
              self.ReportFatalStartupError("Failed to load bayes database")
              self.classifier_data.InitNew()
!         self.stats = oastats.Stats(self.config, self.data_directory)
  
      # Logging - this should be somewhere else.
--- 455,463 ----
              self.ReportFatalStartupError("Failed to load bayes database")
              self.classifier_data.InitNew()
!         s_thres = self.config.filter.spam_threshold
!         u_thres = self.config.filter.unsure_threshold
!         mdb = self.classifier_data.message_db
!         self.stats = bayes_stats.Stats(s_thres, u_thres, mdb, "ham",
!                                        "unsure", "spam")
  
      # Logging - this should be somewhere else.

Index: msgstore.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v
retrieving revision 1.96
retrieving revision 1.97
diff -C2 -d -r1.96 -r1.97
*** msgstore.py	20 Dec 2004 04:23:33 -0000	1.96
--- msgstore.py	21 Dec 2004 21:48:37 -0000	1.97
***************
*** 809,814 ****
  
          # For use with the spambayes.message messageinfo database.
!         self.stored_attributes = ['t', 'original_folder']
          self.t = None
          self.original_folder = None
  
--- 809,815 ----
  
          # For use with the spambayes.message messageinfo database.
!         self.stored_attributes = ['c', 't', 'original_folder']
          self.t = None
+         self.c = None
          self.original_folder = None
  

Index: train.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Outlook2000/train.py,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** train.py	25 Nov 2004 23:26:58 -0000	1.40
--- train.py	21 Dec 2004 21:48:38 -0000	1.41
***************
*** 172,179 ****
          # If we are rebuilding, then we reset the statistics, too.
          # (But output them to the log for reference).
!         mgr.LogDebug(1, "Session:" + "\r\n".join(mgr.stats.GetStats(False)))
          mgr.LogDebug(1, "Total:" + "\r\n".join(mgr.stats.GetStats()))
          mgr.stats.Reset()
!         mgr.stats.ResetTotal(True)
  
      progress.tick()
--- 172,180 ----
          # If we are rebuilding, then we reset the statistics, too.
          # (But output them to the log for reference).
!         mgr.LogDebug(1, "Session:" + "\r\n".join(\
!             mgr.stats.GetStats(session_only=True)))
          mgr.LogDebug(1, "Total:" + "\r\n".join(mgr.stats.GetStats()))
          mgr.stats.Reset()
!         mgr.stats.ResetTotal(permanently=True)
  
      progress.tick()

--- oastats.py DELETED ---



More information about the Spambayes-checkins mailing list