bugfix: `Doc.noun_chunks` call `Doc.noun_chunks_iterator` without checking (closes #2194)

This commit is contained in:
Xiaoquan Kong 2018-04-09 05:44:05 +08:00 committed by Ines Montani
parent e5055e3cf6
commit e2f13ec722
1 changed files with 3 additions and 2 deletions

View File

@ -500,6 +500,7 @@ cdef class Doc:
# its tokenisation changing, so it's okay once we have the Span # its tokenisation changing, so it's okay once we have the Span
# objects. See Issue #375. # objects. See Issue #375.
spans = [] spans = []
if self.noun_chunks_iterator is not None:
for start, end, label in self.noun_chunks_iterator(self): for start, end, label in self.noun_chunks_iterator(self):
spans.append(Span(self, start, end, label=label)) spans.append(Span(self, start, end, label=label))
for span in spans: for span in spans: