Fix german noun chunks iterator
@@ -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):
