From a52e195a0ac7061966893906451a822947dbcea7 Mon Sep 17 00:00:00 2001 From: Motoki Wu Date: Fri, 17 Nov 2017 17:13:13 -0800 Subject: [PATCH] Fixes Issue #1207 where `noun_chunks` of `Span` gives an error. Make sure to reference `self.doc` when getting the noun chunks. Same fix as 9750a0128cf211dac80217eee38e41c38f2c761c --- spacy/tokens/span.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/tokens/span.pyx b/spacy/tokens/span.pyx index 4056ef615..9759c10a9 100644 --- a/spacy/tokens/span.pyx +++ b/spacy/tokens/span.pyx @@ -370,7 +370,7 @@ cdef class Span: spans = [] cdef attr_t label for start, end, label in self.doc.noun_chunks_iterator(self): - spans.append(Span(self, start, end, label=label)) + spans.append(Span(self.doc, start, end, label=label)) for span in spans: yield span