-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc.print_tree(flat=True) broken in spacy 2.0.18 #3150
Comments
When the argument flat = True, the key "modifiers" of the dict containing the tree is deleted. I guess putting an if statement in the function POS_tree could fixed the issue. def POS_tree(root, light=False, flat=False):
"""Helper: generate a POS tree for a root token. The doc must have
`merge_ents(doc)` ran on it.
"""
subtree = format_POS(root, light=light, flat=flat)
if not flat:
for c in root.children:
subtree["modifiers"].append(POS_tree(c))
return subtree If the solution is approved, I can submit a small PR. |
Yes, a PR would be nice! One thing to note re However, |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
How to reproduce the behaviour
doc.print_tree() is the following:
Your Environment
The text was updated successfully, but these errors were encountered: