Beispiel #1
0
	def __init__(self, cdbfile=None):

        Classifier.__init__(self)

        if cdbfile is not None:

            self.wordinfo = cdb.Cdb(cdbfile)
Beispiel #2
0
    def __init__(self):
        Classifier.__init__(self)

        # Set state from DB stored value.
        state = self.get_state()
        self.nspam = state.spam_count
        self.nham = state.ham_count
Beispiel #3
0
    def __init__(self, *args, **kwargs):
        Classifier.__init__(self)

        self.redis = self.redis_class(**kwargs)
        # Set state from Redis stored value.
        state = self.get_state()
        self.nspam = state.spam_count
        self.nham = state.ham_count
Beispiel #4
0
    def __init__(self, Model):
        """ 
        Note that this class is initialized with a 'Django Model' rather than
        a db name. It expects the Model itself, not an instance. Therefore, 
        one needs to do:

            from sbayes.models import Bayes
            db = DjangoClassifier(Bayes)

        """
        Classifier.__init__(self)
        self.statekey = 'save state'
        self.Model = Model
        self.load()
 def __init__(self, cdbfile=None):
     Classifier.__init__(self)
     if cdbfile is not None:
         self.wordinfo = cdb.Cdb(cdbfile)