jaclearn.nlp.tree.constituency#

Constituency Tree.

Classes

Functions

Class StepMaskSelectionMode

class StepMaskSelectionMode[source]#

Bases: JacEnum

__new__(value)#
classmethod assert_valid(value)#

Assert if the value is a valid choice.

classmethod choice_names()#

Returns the list of the name of all possible choices.

classmethod choice_objs()#

Returns the list of the object of all possible choices.

classmethod choice_values()#

Returns the list of the value of all possible choices.

classmethod from_string(value)#
Parameters:

value (str | JacEnum)

Return type:

JacEnum

classmethod is_valid(value)#

Check if the value is a valid choice.

classmethod type_name()#

Return the type name of the enum.

FIRST = 'first'#
RANDOM = 'random'#

Functions

binarize_tree(tree)[source]#
compose_bianry_tree_step_masks(tree, selection='first')[source]#
make_balanced_binary_tree(sequence)[source]#