From fd9b6722a9d5e05a1c4451213924b2249ba41bd5 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 28 May 2017 20:12:10 +0200 Subject: [PATCH] Fix noun chunks iterator for new stringstore --- spacy/syntax/iterators.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/syntax/iterators.pyx b/spacy/syntax/iterators.pyx index e1c44da7f..75610ca8e 100644 --- a/spacy/syntax/iterators.pyx +++ b/spacy/syntax/iterators.pyx @@ -12,9 +12,9 @@ def english_noun_chunks(obj): labels = ['nsubj', 'dobj', 'nsubjpass', 'pcomp', 'pobj', 'attr', 'ROOT'] doc = obj.doc # Ensure works on both Doc and Span. - np_deps = [doc.vocab.strings[label] for label in labels] - conj = doc.vocab.strings['conj'] - np_label = doc.vocab.strings['NP'] + np_deps = [doc.vocab.strings.add(label) for label in labels] + conj = doc.vocab.strings.add('conj') + np_label = doc.vocab.strings.add('NP') seen = set() for i, word in enumerate(obj): if word.pos not in (NOUN, PROPN, PRON):