Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv8063/spambayes
Modified Files:
Tag: CORESVR
CorePlugin.py CoreUI.py XMLRPCPlugin.py
Log Message:
a step closer - actually scored a message!
Index: CorePlugin.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/Attic/CorePlugin.py,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** CorePlugin.py 29 May 2007 01:27:17 -0000 1.1.2.2
--- CorePlugin.py 2 Jun 2007 21:42:08 -0000 1.1.2.3
***************
*** 12,19 ****
self.name = name
self.ui = ui
- self.hammie = None
-
- def set_hammie(self, hammie):
- self.hammie = hammie
class PluginUI:
--- 12,15 ----
Index: CoreUI.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/Attic/CoreUI.py,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -C2 -d -r1.1.2.5 -r1.1.2.6
*** CoreUI.py 24 May 2007 03:19:34 -0000 1.1.2.5
--- CoreUI.py 2 Jun 2007 21:42:08 -0000 1.1.2.6
***************
*** 949,953 ****
possibly overridden by the driver code, create the Bayes object,
the Corpuses, the Trainers and so on."""
- print "Loading database...",
if self.is_test:
self.use_db = "pickle"
--- 949,952 ----
Index: XMLRPCPlugin.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/Attic/XMLRPCPlugin.py,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** XMLRPCPlugin.py 29 May 2007 01:27:17 -0000 1.1.2.2
--- XMLRPCPlugin.py 2 Jun 2007 21:42:08 -0000 1.1.2.3
***************
*** 8,11 ****
--- 8,12 ----
from spambayes.OptionsClass import *
from spambayes.Options import _, options
+ from spambayes.tokenizer import tokenize
class XMLRPCUI(PluginUI):
***************
*** 36,48 ****
return self.score_mime(mime_message)
! def score_mime(self, msg):
! try:
! if isinstance(msg, (str, unicode)):
! msg = message_from_string(msg)
! tokens = tokenizer.tokenize(msg)
! return self.state.bayes.spamprob(tokens, evidence=True)
! except:
! import traceback
! traceback.print_exc()
def form_to_mime(form, attachments, extra_tokens):
--- 37,47 ----
return self.score_mime(mime_message)
! def score_mime(self, msg, mime_type):
! if self.state.bayes is None:
! self.state.create_workers()
! msg = unicode(msg, mime_type)
! msg = message_from_string(msg)
! tokens = tokenize(msg)
! return self.state.bayes.spamprob(tokens, evidence=True)
def form_to_mime(form, attachments, extra_tokens):
_______________________________________________
Spambayes-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/spambayes-checkins