Explorar el Código

Merge pull request #234 from Schnouki/patch-2

[post_stats] Python 3 compatibility
Justin Mayer hace 10 años
padre
commit
ade0c98505
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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