This commit is contained in:
j 2011-10-30 12:54:59 +01:00
parent 8f826c4ac3
commit 4cfd74b4b9

View file

@ -375,3 +375,9 @@ def smartSplit(text):
else:
yield bit
def words(text):
"""
returns words in text, removing punctuation
"""
text = text.split()
return map(lambda x: re.sub("(([.!?:-_]|'s)$)", '', x), text)