[Spambayes-checkins] spambayes Bayes.py,1.5.2.1,1.5.2.2

Tim Stone timstone4@users.sourceforge.net
Wed Nov 20 04:29:58 2002


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

Modified Files:
      Tag: hammie-playground
	Bayes.py 
Log Message:
Minor tweaks to accomodate LSDBDict usage

Index: Bayes.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/Bayes.py,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -C2 -d -r1.5.2.1 -r1.5.2.2
*** Bayes.py	19 Nov 2002 23:45:24 -0000	1.5.2.1
--- Bayes.py	20 Nov 2002 04:29:55 -0000	1.5.2.2
***************
*** 6,10 ****
      PersistentBayes - subclass of Bayes, adds auto persistence
      PickledBayes - PersistentBayes that uses a pickle db
!     DBDictBayes - PersistentBayes that uses a (hammie.) DB_Dict db
      Trainer - Bayes training observer
      SpamTrainer - Trainer for spam
--- 6,10 ----
      PersistentBayes - subclass of Bayes, adds auto persistence
      PickledBayes - PersistentBayes that uses a pickle db
!     DBDictBayes - PersistentBayes that uses a LSDBDict db
      Trainer - Bayes training observer
      SpamTrainer - Trainer for spam
***************
*** 23,30 ****
      databases.
  
!     DBDictBayes is a concrete PersistentBayes class that uses a DB_Dict
!     datastore.  DB_Dict is currently definied in hammie.py, and wraps
!     an anydbm with some very convenient dictionary functionality, such as
!     the ability to skip particular keys or key patterns during iteration.
  
      Trainer is concrete class that observes a Corpus and trains a
--- 23,28 ----
      databases.
  
!     DBDictBayes is a concrete PersistentBayes class that uses a LSDBDict
!     datastore.
  
      Trainer is concrete class that observes a Corpus and trains a
***************
*** 53,57 ****
  
  __author__ = "Tim Stone <tim@fourstonesExpressions.com>"
! __credits__ = "Richie Hindle, Tim Peters, Neil Gunton, \
  all the spambayes contributors."
  
--- 51,55 ----
  
  __author__ = "Tim Stone <tim@fourstonesExpressions.com>"
! __credits__ = "Richie Hindle, Tim Peters, Neale Pickett, \
  all the spambayes contributors."
  
***************
*** 62,67 ****
  import dbdict
  import errno
- import copy
- import anydbm
  
  PICKLE_TYPE = 1
--- 60,63 ----
***************
*** 169,174 ****
  
  
! class WIDict(dbdict.DBDict):
!     """DBDict optimized for holding lots of WordInfo objects.
  
      Normally, the pickler can figure out that you're pickling the same
--- 165,170 ----
  
  
! class WIDict(dbdict.LSDBDict):
!     """LSDBDict optimized for holding lots of WordInfo objects.
  
      Normally, the pickler can figure out that you're pickling the same
***************
*** 246,249 ****
--- 242,246 ----
  
          self.wordinfo[self.statekey] = (self.nham, self.nspam)
+         self.wordinfo.store()
  
  





More information about the Spambayes-checkins mailing list