Treex::Core::Node::A
version 0.08157
a-layer (analytical) node
For each attribute (e.g. tag), there is a getter method (my $tag = $anode->tag();) and a setter method ($anode->set_tag('NN');).
tag
my $tag = $anode->tag();
$anode->set_tag('NN');
Returns a terminal node from the phrase-structure tree that corresponds to the a-node.
Set the given terminal node from the phrase-structure tree as corresponding to the a-node.
Returns an array of non-terminal nodes from the phrase-structure tree that correspond to the a-node.
Returns the corresponding terminal node and all non-terminal nodes.
Root and non-root nodes have different PML type in the pml schema (a-root.type, a-node.type)
a-root.type
a-node.type
Is this node a root (or head) of a coordination/apposition construction? On a-layer this is decided based on afun =~ /^(Coord|Apos)$/.
afun =~ /^(Coord|Apos)$/
Figures out the real function of the subtree. If its own afun is AuxP or AuxC, finds the first descendant with a real afun and returns it. If this is a coordination or apposition root, finds the first member and returns its afun (but note that members of the same coordination can differ in afuns if some of them have ExD).
AuxP
AuxC
ExD
Sets the real function of the subtree. If its current afun is AuxP or AuxC, finds the first descendant with a real afun replaces it. If this is a coordination or apposition root, finds all the members and replaces their afuns (but note that members of the same coordination can differ in afuns if some of them have ExD; this method can only set the same afun for all).
Recursively copy children from myself to another node. This method is specific to the A 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.
If this a-node is a part of a named entity, this method returns the corresponding n-node (Treex::Core::Node::N). If this node is a part of more than one named entities, only the most nested one is returned. For example: "Bank of China"
$n_node_for_china = $a_node_china->get_n_node(); print $n_node_for_china->get_attr('normalized_name'); # China $n_node_for_bank_of_china = $n_node_for_china->get_parent(); print $n_node_for_bank_of_china->get_attr('normalized_name'); # Bank of China
Return the string corresponding to a subtree rooted in $node. It's computed based on attributes form and no_space_after.
$node
form
no_space_after
Zdeněk Žabokrtský <zabokrtsky@ufal.mff.cuni.cz>
Martin Popel <popel@ufal.mff.cuni.cz>
Copyright © 2011-2012 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.
To install Treex::Core, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Treex::Core
CPAN shell
perl -MCPAN -e shell install Treex::Core
For more information on module installation, please visit the detailed CPAN module installation guide.