From cd59979ab446d7613ec7df5d5737539464918edf Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Mon, 3 Aug 2020 13:53:15 +0200 Subject: [PATCH] Fix span boundary handling in Spanish noun_chunks (#5860) --- spacy/lang/es/syntax_iterators.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spacy/lang/es/syntax_iterators.py b/spacy/lang/es/syntax_iterators.py index 5fda35211..d4572b682 100644 --- a/spacy/lang/es/syntax_iterators.py +++ b/spacy/lang/es/syntax_iterators.py @@ -20,8 +20,7 @@ def noun_chunks(doclike): np_left_deps = [doc.vocab.strings.add(label) for label in left_labels] np_right_deps = [doc.vocab.strings.add(label) for label in right_labels] stop_deps = [doc.vocab.strings.add(label) for label in stop_labels] - token = doc[0] - while token and token.i < len(doclike): + for token in doclike: if token.pos in [PROPN, NOUN, PRON]: left, right = noun_bounds( doc, token, np_left_deps, np_right_deps, stop_deps