updated from Atlas repo
This commit is contained in:
@@ -12,12 +12,14 @@ class Sentence:
|
||||
|
||||
def __init__(self, text):
|
||||
self.text = text
|
||||
self.words = RE_WORD.findall(text)
|
||||
|
||||
def __repr__(self):
|
||||
return 'Sentence(%s)' % reprlib.repr(self.text)
|
||||
|
||||
def __iter__(self):
|
||||
for match in RE_WORD.finditer(self.text): # <1>
|
||||
yield match.group() # <2>
|
||||
for word in self.words: # <1>
|
||||
yield word # <2>
|
||||
return # <3>
|
||||
|
||||
# done! <3>
|
||||
# done! <4>
|
||||
|
||||
Reference in New Issue
Block a user