returns the node type (leaf or span) of a subtree (i.e. Nucleus or Satellite)

    Parameters
    ----------
    tree : nltk.tree.ParentedTree
        a tree representing a rhetorical structure (or a part of it)

def get_node_type(tree):
    """
    returns the node type (leaf or span) of a subtree (i.e. Nucleus or Satellite)

    Parameters
    ----------
    tree : nltk.tree.ParentedTree
        a tree representing a rhetorical structure (or a part of it)
    """
    node_type = tree[0].label()
    assert node_type in NODE_TYPES, "node_type: {}".format(node_type)
    return node_type