mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +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.
|
||||
"""
|
||||
if not doc.is_parsed:
|
||||
return
|
||||
return doc
|
||||
spans = [(np.start_char, np.end_char, np.root.tag, np.root.dep)
|
||||
for np in doc.noun_chunks]
|
||||
for start, end, tag, dep in spans:
|
||||
|
|
Loading…
Reference in New Issue
Block a user