aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-10-21 13:53:23 +0200
committercedricbonhomme <devnull@localhost>2010-10-21 13:53:23 +0200
commit6d6b6c57f8496597f7495e3e3a5b6a616518e368 (patch)
tree842719d62d8ddac237b6ee96e7a4e54daaae5b32
parentImprovements of the result page for the search). (diff)
downloadnewspipe-6d6b6c57f8496597f7495e3e3a5b6a616518e368.tar.gz
newspipe-6d6b6c57f8496597f7495e3e3a5b6a616518e368.tar.bz2
newspipe-6d6b6c57f8496597f7495e3e3a5b6a616518e368.zip
Improvements of the regular expression for tag clouds and search.
-rwxr-xr-xpyAggr3g470r.py6
-rwxr-xr-xutils.py2
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"
diff --git a/utils.py b/utils.py
index 0b33b4dd..34f3423a 100755
--- a/utils.py
+++ b/utils.py
@@ -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'))):
bgstack15