NAME

Treex::Core::Node::P

VERSION

version 2.20151210

DESCRIPTION

Representation of nodes of phrase structure (constituency) trees.

METHODS

$node->is_terminal()

Is $node a terminal node? Does its get_pml_type_name eq 'p-terminal.type'?

my $child_phrase = $node->create_nonterminal_child()

Create a new non-terminal child node, i.e. a node representing a constituent (phrase).

my $child_terminal = $node->create_terminal_child()

Create a new terminal child node, i.e. a node representing a token.

my $node->create_from_mrg($mrg_string)

Fill $node's attributes and create its subtree from the serialized string in the PennTB mrg format. E.g.: (NP (DT a) (JJ nonexecutive) (NN director)).

my $mrg_string = $node->stringify_as_mrg()

Serialize the tree structure of $node and its subtree as a string in the PennTB mrg format. E.g.: (NP (DT a) (JJ nonexecutive) (NN director)).

my $tokenized_text = $node->stringify_as_text()

Get the text representing $node's subtree. The text is tokenized, i.e. all tokens are separated by a space.

$node->copy_ptree($target_node)

Recursively copy children from $node to $target_node. This method is specific to the P layer because it contains the list of attributes. If we could figure out the list automatically, the method would become general enough to reside directly in Node.pm.

AUTHOR

Martin Popel <popel@ufal.mff.cuni.cz> Zdeněk Žabokrtský <zabokrtsky@ufal.mff.cuni.cz> Daniel Zeman <zeman@ufal.mff.cuni.cz>

COPYRIGHT AND LICENSE

Copyright © 2011 by Institute of Formal and Applied Linguistics, Charles University in Prague

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.