Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion memorynetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def tokenize(sent):
>>> tokenize('Bob dropped the apple. Where is the apple?')
['Bob', 'dropped', 'the', 'apple', '.', 'Where', 'is', 'the', 'apple', '?']
'''
return [x.strip() for x in re.split('(\W+)?', sent) if x.strip()]
return [x.strip() for x in re.split('(\w+)?', sent) if x and not x.isspace()]


def parse_stories(lines, only_supporting=False):
Expand Down