nltk.elementtree_indent()

nltk.elementtree_indent(elem, level=0)[source]

Recursive function to indent an ElementTree._ElementInterface used for pretty printing. Run indent on elem and then output in the normal way.

Parameters:
  • elem (ElementTree._ElementInterface) – element to be indented. will be modified.
  • level (nonnegative integer) – level of indentation for this element
Return type:

ElementTree._ElementInterface

Returns:

Contents of elem indented to reflect its structure