nltk.ImmutableParentedTree.parent_index¶
-
ImmutableParentedTree.
parent_index
()¶ The index of this tree in its parent. I.e.,
ptree.parent()[ptree.parent_index()] is ptree
. Note thatptree.parent_index()
is not necessarily equal toptree.parent.index(ptree)
, since theindex()
method returns the first child that is equal to its argument.