words
This commit is contained in:
parent
8f826c4ac3
commit
4cfd74b4b9
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue