Skip to content

Commit

Permalink
check if argument flat is true or not (#3156)
Browse files Browse the repository at this point in the history
  • Loading branch information
mauryaland authored and honnibal committed Jan 14, 2019
1 parent d97661d commit 214c2ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spacy/tokens/printers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ def POS_tree(root, light=False, flat=False):
`merge_ents(doc)` ran on it.
"""
subtree = format_POS(root, light=light, flat=flat)
for c in root.children:
subtree["modifiers"].append(POS_tree(c))
if not flat:
for c in root.children:
subtree["modifiers"].append(POS_tree(c))
return subtree


Expand Down

0 comments on commit 214c2ec

Please sign in to comment.