The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Treex::Core::Node::A

VERSION

version 0.08663

DESCRIPTION

a-layer (analytical) node

ATTRIBUTES

For each attribute (e.g. tag), there is a getter method (my $tag = $anode->tag();) and a setter method ($anode->set_tag('NN');).

Original w-layer and m-layer attributes

form
lemma
tag
no_space_after

Original a-layer attributes

afun
is_parenthesis_root
edge_to_collapse
is_auxiliary

METHODS

$node->get_terminal_pnode

Returns a terminal node from the phrase-structure tree that corresponds to the a-node.

$node->set_terminal_pnode($pnode)

Set the given terminal node from the phrase-structure tree as corresponding to the a-node.

$node->get_nonterminal_pnodes

Returns an array of non-terminal nodes from the phrase-structure tree that correspond to the a-node.

$node->get_pnodes

Returns the corresponding terminal node and all non-terminal nodes.

Other

reset_morphcat
get_pml_type_name

Root and non-root nodes have different PML type in the pml schema (a-root.type, a-node.type)

is_coap_root

Is this node a root (or head) of a coordination/apposition construction? On a-layer this is decided based on afun =~ /^(Coord|Apos)$/.

get_real_afun()

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).

set_real_afun($new_afun)

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).

copy_atree()

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.

get_n_node()

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
$node->get_subtree_string

Return the string corresponding to a subtree rooted in $node. It's computed based on attributes form and no_space_after.

AUTHOR

Zdeněk Žabokrtský <zabokrtsky@ufal.mff.cuni.cz>

Martin Popel <popel@ufal.mff.cuni.cz>

COPYRIGHT AND LICENSE

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.