From 2a5e7b5e92cc1f5015b029055e85806c10f85308 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Wed, 8 Sep 2010 23:32:05 +0200 Subject: Articles are now stored in the Python blist high performance data-structure. if blist module not present, simple lists are used. --- pyAggr3g470r.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'pyAggr3g470r.py') diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 7666c819..b5169268 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -234,15 +234,10 @@ class Root: self.top_words = utils.top_words(self.articles, n=50, size=int(word_size)) html += "

Statistics

\n
\n" if "oice" not in utils.IMPORT_ERROR: - nb_french = 0 - nb_english = 0 + counter = Counter() for rss_feed_id in self.articles.keys(): for article in self.articles[rss_feed_id]: - if article[6] == 'french': - nb_french += 1 - elif article[6] == 'english': - nb_english += 1 - nb_other = self.nb_articles - nb_french - nb_english + counter[article[6]] += 1 html += "Minimum size of a word: " html += """