diff options
-rwxr-xr-x | pyAggr3g470r.py | 6 | ||||
-rwxr-xr-x | utils.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index f1cd70c6..3b7b9501 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -310,7 +310,7 @@ class Root: in the description of the article. """ param, _, value = querystring.partition(':') - wordre = re.compile(r'\b%s\b' % param.lower()) + wordre = re.compile(r'\b%s\b' % param, re.I) feed_id = None if param == "Feed": feed_id, _, querystring = value.partition(':') @@ -325,7 +325,7 @@ class Root: article_content = utils.clear_string(article[4].encode('utf-8')) if not article_content: utils.clear_string(article[2].encode('utf-8')) - if wordre.findall(article_content.lower()) != []: + if wordre.findall(article_content) != []: if article[5] == "0": # not readed articles are in bold not_read_begin = "<b>" @@ -346,7 +346,7 @@ class Root: article_content = utils.clear_string(article[4].encode('utf-8')) if not article_content: utils.clear_string(article[2].encode('utf-8')) - if wordre.findall(article_content.lower()) != []: + if wordre.findall(article_content) != []: if new_feed_section is True: new_feed_section = False html += """<h2><a name="%s"><a href="%s" rel="noreferrer" @@ -162,7 +162,7 @@ def top_words(dic_articles, n=10, size=5): Return the n most frequent words in a list. """ words = Counter() - wordre = re.compile(r'\b\w{%s,}\b' % size) + wordre = re.compile(r'\b\w{%s,}\b' % size, re.I) for rss_feed_id in dic_articles.keys(): for article in dic_articles[rss_feed_id]: for word in wordre.findall(clear_string(article[4].encode('utf-8'))): |