[Spambayes-checkins] spambayes classifier.py,1.59,1.60

Neale Pickett npickett@users.sourceforge.net
Tue Nov 26 20:22:08 2002


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

Modified Files:
	classifier.py 
Log Message:
* MetaInfo doesn't need the revision anymore, so it's gone.  This
  makes the class much simpler.


Index: classifier.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/classifier.py,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** classifier.py	26 Nov 2002 17:16:52 -0000	1.59
--- classifier.py	26 Nov 2002 20:22:05 -0000	1.60
***************
*** 52,58 ****
      """Information about the corpora.
  
!     Contains nham and nspam, used for calculating probabilities.  Also
!     has a revision, incremented every time nham or nspam is adjusted.
!     Nothing uses this, currently, but it's there if you want it.
  
      """
--- 52,56 ----
      """Information about the corpora.
  
!     Contains nham and nspam, used for calculating probabilities.
  
      """
***************
*** 66,94 ****
  
      def __getstate__(self):
!         return (PICKLE_VERSION, self._nspam, self._nham)
  
      def __setstate__(self, t):
          if t[0] != PICKLE_VERSION:
              raise ValueError("Can't unpickle -- version %s unknown" % t[0])
!         self._nspam, self._nham = t[1:]
          self.revision = 0
- 
-     def incr_rev(self):
-         self.revision += 1
- 
-     def get_nham(self):
-         return self._nham
-     def set_nham(self, val):
-         self._nham = val
-         self.incr_rev()
-     nham = property(get_nham, set_nham)
- 
-     def set_nspam(self, val):
-         self._nspam = val
-     def get_nspam(self):
-         return self._nspam
-     nspam = property(get_nspam, set_nspam)
- 
- 
  
  
--- 64,74 ----
  
      def __getstate__(self):
!         return (PICKLE_VERSION, self.nspam, self.nham)
  
      def __setstate__(self, t):
          if t[0] != PICKLE_VERSION:
              raise ValueError("Can't unpickle -- version %s unknown" % t[0])
!         self.nspam, self.nham = t[1:]
          self.revision = 0
  
  





More information about the Spambayes-checkins mailing list