def execute(self):
        pl = []
        db = Db()

        d = db.get_doctype_counts()
        self.doctype1_count = d.get(self.doctype1)
        self.doctype2_count = d.get(self.doctype2)

        self.doctype1_word_count = db.get_words_count(self.doctype1)
        self.doctype2_word_count = db.get_words_count(self.doctype2)

        for word in self.words:
            p = self.p_for_word(db, word)
            pl.append(p)

        result = self.p_from_list(pl)

        return result
Beispiel #2
0
    def execute(self):
        pl = []
        db = Db()

        d = db.get_doctype_counts()
        self.doctype1_count = d.get(self.doctype1)
        self.doctype2_count = d.get(self.doctype2)

        self.doctype1_word_count = db.get_words_count(self.doctype1)
        self.doctype2_word_count = db.get_words_count(self.doctype2)

        for word in self.words:
            p = self.p_for_word(db, word)
            pl.append(p)

        result = self.p_from_list(pl)

        return result
 def execute(self):
     db = Db()
     return db.get_doctype_counts().items()
Beispiel #4
0
 def execute(self):
     db = Db()
     return db.get_doctype_counts().items()