[Spambayes-checkins] spambayes/spambayes XMLRPCPlugin.py, 1.1.2.4, 1.1.2.5
Skip Montanaro
montanaro at users.sourceforge.net
Tue Jun 5 04:18:15 CEST 2007
Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv30513
Modified Files:
Tag: CORESVR
XMLRPCPlugin.py
Log Message:
Couple minor tweaks
Index: XMLRPCPlugin.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/Attic/XMLRPCPlugin.py,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** XMLRPCPlugin.py 4 Jun 2007 12:28:33 -0000 1.1.2.4
--- XMLRPCPlugin.py 5 Jun 2007 02:18:13 -0000 1.1.2.5
***************
*** 16,20 ****
which provides the necessary authentication support.
! The XML-RPC server exposes the following two methods:
score(form_dict, extra_tokens) -> (score, evidence)
--- 16,20 ----
which provides the necessary authentication support.
! The XML-RPC server exposes the following methods:
score(form_dict, extra_tokens) -> (score, evidence)
***************
*** 42,46 ****
set_corpus(string, is_spam) -> ''
! Set the current ham or spam corpus (string in Unix mbox format).
Should normally be followed by a call to retrain().
--- 42,46 ----
set_corpus(string, is_spam) -> ''
! Set the current ham or spam corpus (a string in Unix mbox format).
Should normally be followed by a call to retrain().
***************
*** 112,121 ****
"""Train the form and extra tokens."""
mime_message = form_to_mime(form_dict, extra_tokens)
! return self.train_mime(mime_message, is_spam)
! def train_mime(self, msg, is_spam):
"""Train the message."""
tokens = self.tokenize(msg, encoding)
! return self.state.bayes.learn(tokens, is_spam)
def tokenize(self, msg, encoding):
--- 112,122 ----
"""Train the form and extra tokens."""
mime_message = form_to_mime(form_dict, extra_tokens)
! return self.train_mime(mime_message, "ascii", is_spam)
! def train_mime(self, msg, encoding, is_spam):
"""Train the message."""
tokens = self.tokenize(msg, encoding)
! self.state.bayes.learn(tokens, is_spam)
! return ""
def tokenize(self, msg, encoding):
More information about the Spambayes-checkins
mailing list