소스 검색

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