diff --git a/spacy/syntax/iterators.pyx b/spacy/syntax/iterators.pyx index 75610ca8e..29cdbf89e 100644 --- a/spacy/syntax/iterators.pyx +++ b/spacy/syntax/iterators.pyx @@ -48,9 +48,9 @@ def english_noun_chunks(obj): def german_noun_chunks(obj): labels = ['sb', 'oa', 'da', 'nk', 'mo', 'ag', 'ROOT', 'root', 'cj', 'pd', 'og', 'app'] doc = obj.doc # Ensure works on both Doc and Span. - np_label = doc.vocab.strings['NP'] - np_deps = set(doc.vocab.strings[label] for label in labels) - close_app = doc.vocab.strings['nk'] + np_label = doc.vocab.strings.add('NP') + np_deps = set(doc.vocab.strings.add(label) for label in labels) + close_app = doc.vocab.strings.add('nk') rbracket = 0 for i, word in enumerate(obj):