nltk.tgrep.ancestors

nltk.tgrep.ancestors(node)[source]

Returns the list of all nodes dominating the given tree node. This method will not work with leaf nodes, since there is no way to recover the parent.