nip.utils.malt_forest.forest.MaltTree#

class nip.utils.malt_forest.forest.MaltTree[source]#

A tree in a MALT forest, which is a collection children of a root node.

Methods Summary

__getitem__(index)

Get a child node by index.

__init__()

__iter__()

Iterate over the child nodes.

__len__()

Get the number of child nodes.

add_child(child)

Add a child to this tree.

Methods

__getitem__(index: int) MaltNode[source]#

Get a child node by index.

Parameters:

index (int) – The index of the child node to get.

Returns:

MaltNode – The child node at the given index.

__init__()[source]#
__iter__() Iterator[MaltNode][source]#

Iterate over the child nodes.

Returns:

Iterator[MaltNode] – An iterator over the child nodes.

__len__() int[source]#

Get the number of child nodes.

Returns:

int – The number of child nodes.

add_child(child: MaltNode)[source]#

Add a child to this tree.

Parameters:

child (MaltNode) – The child node to add.