瀏覽代碼

Merge pull request #234 from Schnouki/patch-2

[post_stats] Python 3 compatibility
Justin Mayer 10 年之前
父節點
當前提交
ade0c98505
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      post_stats/readability.py

+ 1 - 1
post_stats/readability.py

@@ -30,7 +30,7 @@ def normalize(text):
 def text_stats(text, wc):
     text = normalize(text)
     stcs = [s.split(" ") for s in text.split(". ")]
-    stcs = filter(lambda s: len(s) >= 2, stcs)
+    stcs = [s for s in stcs if len(s) >= 2]
 
     if wc:
         words = wc