mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Fix german noun chunks iterator
This commit is contained in:
parent
fd9b6722a9
commit
9239f06ed3
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user