From 1c60384bed3a640e64d79e33c6e33f7574f6bdfd Mon Sep 17 00:00:00 2001 From: Feng Niu Date: Wed, 21 Feb 2018 15:39:04 -0800 Subject: [PATCH] return on empty doc --- spacy/lang/es/syntax_iterators.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/lang/es/syntax_iterators.py b/spacy/lang/es/syntax_iterators.py index 462d4ccee..b81d1fab0 100644 --- a/spacy/lang/es/syntax_iterators.py +++ b/spacy/lang/es/syntax_iterators.py @@ -6,6 +6,8 @@ from ...symbols import NOUN, PROPN, PRON, VERB, AUX def noun_chunks(obj): doc = obj.doc + if not len(doc): + return np_label = doc.vocab.strings.add('NP') left_labels = ['det', 'fixed', 'neg'] #['nunmod', 'det', 'appos', 'fixed'] right_labels = ['flat', 'fixed', 'compound', 'neg']