[Spambayes-checkins] spambayes/spambayes classifier.py,1.15,1.16

Tim Peters tim_one at users.sourceforge.net
Tue Dec 16 00:36:43 EST 2003


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

Modified Files:
	classifier.py 
Log Message:
learn() and unlearn():  when x-use_bigrams is in effect, the *type* of
wordstream shouldn't make any difference, so don't test it.  In general,
the only assumption about streams made in classifier.py is that they're
iterable objects (generators, lists, doesn't matter).


Index: classifier.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/classifier.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** classifier.py	16 Dec 2003 05:19:08 -0000	1.15
--- classifier.py	16 Dec 2003 05:36:41 -0000	1.16
***************
*** 211,216 ****
          else that it's definitely not spam.
          """
!         if options["Classifier", "x-use_bigrams"] and \
!            isinstance(wordstream, types.GeneratorType):
              wordstream = self._enhance_wordstream(wordstream)
          self._add_msg(wordstream, is_spam)
--- 211,215 ----
          else that it's definitely not spam.
          """
!         if options["Classifier", "x-use_bigrams"]:
              wordstream = self._enhance_wordstream(wordstream)
          self._add_msg(wordstream, is_spam)
***************
*** 221,226 ****
          Pass the same arguments you passed to learn().
          """
!         if options["Classifier", "x-use_bigrams"] and \
!            isinstance(wordstream, types.GeneratorType):
              wordstream = self._enhance_wordstream(wordstream)
          self._remove_msg(wordstream, is_spam)
--- 220,224 ----
          Pass the same arguments you passed to learn().
          """
!         if options["Classifier", "x-use_bigrams"]:
              wordstream = self._enhance_wordstream(wordstream)
          self._remove_msg(wordstream, is_spam)





More information about the Spambayes-checkins mailing list