def get_tree_type ( tree ) : tree_type = tree . label ( ) assert tree_type in SUBTREE_TYPES , "tree_type: {}" . format ( tree_type ) return tree_type
how to check if a tree is a bst in python
returns the type of the ( sub ) tree : Root Nucleus or Satellite
def get_tree_type(tree):
    """
    returns the type of the (sub)tree: Root, Nucleus or Satellite

    Parameters
    ----------
    tree : nltk.tree.ParentedTree
        a tree representing a rhetorical structure (or a part of it)
    """
    tree_type = tree.label()
    assert tree_type in SUBTREE_TYPES, "tree_type: {}".format(tree_type)
    return tree_type