[Spambayes-checkins] spambayes classifier.py,1.53.2.10,1.53.2.11

Neale Pickett npickett@users.sourceforge.net
Sun Nov 24 09:31:09 2002


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

Modified Files:
      Tag: hammie-playground
	classifier.py 
Log Message:
* changed (nham, nspam) to (nspam, nham) to reflect the ordering
  used everywhere else in the classifier.  Unfortunately, this
  requires incrementing the pickle version.  Better now than after
  the merge though.


Index: classifier.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/classifier.py,v
retrieving revision 1.53.2.10
retrieving revision 1.53.2.11
diff -C2 -d -r1.53.2.10 -r1.53.2.11
*** classifier.py	23 Nov 2002 23:57:22 -0000	1.53.2.10
--- classifier.py	24 Nov 2002 09:31:06 -0000	1.53.2.11
***************
*** 47,51 ****
  LN2 = math.log(2)       # used frequently by chi-combining
  
! PICKLE_VERSION = 3
  
  class MetaInfo(object):
--- 47,51 ----
  LN2 = math.log(2)       # used frequently by chi-combining
  
! PICKLE_VERSION = 4
  
  class MetaInfo(object):
***************
*** 61,75 ****
  
      def __repr__(self):
!         return "MetaInfo%r" % repr((self._nham,
!                                     self._nspam,
                                      self.revision))
  
      def __getstate__(self):
!         return (PICKLE_VERSION, self._nham, self._nspam)
  
      def __setstate__(self, t):
          if t[0] != PICKLE_VERSION:
              raise ValueError("Can't unpickle -- version %s unknown" % t[0])
!         (self._nham, self._nspam) = t[1:]
          self.revision = 0
  
--- 61,75 ----
  
      def __repr__(self):
!         return "MetaInfo%r" % repr((self._nspam,
!                                     self._nham,
                                      self.revision))
  
      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