jaclearn.nlp.tree.node#

The definition for tree Nodes.

Classes

Class Node

class Node[source]#

Bases: object

__init__(vtype, etype=None)[source]#
__new__(**kwargs)#
append_child(node)[source]#
attach(father, sibling_ind=-1)[source]#

Attach to a new father.

clone()[source]#
detach()[source]#

Detach from the father.

insert_child(pos, node)[source]#
remove_child(node)[source]#
property breadth#

Breadth is defined as the maximum number of children of nodes in the tree.

property depth#

Depth is defined as the number of nodes on the maximum distance with the root of nodes + 1. (Thus a single nodes will have depth 1.)

property is_leaf#
property lson#
property nr_children#
property nr_leaves#
property rson#
property size#