aboutsummaryrefslogtreecommitdiff
path: root/source/utils.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-03-15 08:00:40 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-03-15 08:00:40 +0100
commitedc7ba164fcb99347d9824eeecd8665f7135e820 (patch)
tree591942aa5a761325741d521a8c99de62bee64cc5 /source/utils.py
parentUpdated 'meta' HTML tag of the authentication page. (diff)
downloadnewspipe-edc7ba164fcb99347d9824eeecd8665f7135e820.tar.gz
newspipe-edc7ba164fcb99347d9824eeecd8665f7135e820.tar.bz2
newspipe-edc7ba164fcb99347d9824eeecd8665f7135e820.zip
Improved code readability.
Diffstat (limited to 'source/utils.py')
-rwxr-xr-xsource/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/utils.py b/source/utils.py
index 9b52ce4b..09056bbe 100755
--- a/source/utils.py
+++ b/source/utils.py
@@ -119,7 +119,9 @@ def top_words(articles, n=10, size=5):
words = Counter()
wordre = re.compile(r'\b\w{%s,}\b' % size, re.I)
for article in articles:
- for word in [elem.lower() for elem in wordre.findall(clear_string(article["article_content"])) if elem.lower() not in stop_words]:
+ for word in [elem.lower() for elem in
+ wordre.findall(clear_string(article["article_content"])) \
+ if elem.lower() not in stop_words]:
words[word] += 1
return words.most_common(n)
bgstack15