code: def word_wrap_tree(parented_tree, width=0):
      
      if width != 0:
          for i, leaf_text in enumerate(parented_tree.leaves()):
              dedented_text = textwrap.dedent(leaf_text).strip()
              parented_tree[parented_tree.leaf_treeposition(i)] = textwrap.fill(dedented_text, width=width)
      return parented_tree
docs: line-wrap an NLTK ParentedTree for pretty-printing