mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-10 16:22:29 +03:00
Return Doc if noun chunks merger component if Doc is not parsed
This commit is contained in:
parent
e2f13ec722
commit
987ee27af7
|
@ -79,7 +79,7 @@ def merge_noun_chunks(doc):
|
||||||
RETURNS (Doc): The Doc object with merged noun chunks.
|
RETURNS (Doc): The Doc object with merged noun chunks.
|
||||||
"""
|
"""
|
||||||
if not doc.is_parsed:
|
if not doc.is_parsed:
|
||||||
return
|
return doc
|
||||||
spans = [(np.start_char, np.end_char, np.root.tag, np.root.dep)
|
spans = [(np.start_char, np.end_char, np.root.tag, np.root.dep)
|
||||||
for np in doc.noun_chunks]
|
for np in doc.noun_chunks]
|
||||||
for start, end, tag, dep in spans:
|
for start, end, tag, dep in spans:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user