From 5109bba91018729952a3263418ad0f5ab114fce1 Mon Sep 17 00:00:00 2001 From: ines Date: Sat, 3 Jun 2017 11:31:11 +0200 Subject: [PATCH] Port over fix from #1070 --- spacy/tokens/doc.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/tokens/doc.pyx b/spacy/tokens/doc.pyx index 84b39d454..e22a35875 100644 --- a/spacy/tokens/doc.pyx +++ b/spacy/tokens/doc.pyx @@ -437,7 +437,8 @@ cdef class Doc: """ def __get__(self): if 'sents' in self.user_hooks: - return self.user_hooks['sents'](self) + yield from self.user_hooks['sents'](self) + return if not self.is_parsed: raise ValueError(