use Treex::Core::Document; use Treex::Core::Phrase::Term; my $document = new Treex::Core::Document; my $bundle = $document->create_bundle(); my $zone = $bundle->create_zone('en'); my $root = $zone->create_atree(); my $phrase = new Treex::Core::Phrase::Term ('node' => $root);
Term is a terminal
Phrase. It contains (refers to) one
Node and it can be part of nonterminal phrases (
NTerm). See Treex::Core::Phrase for more details.
Refers to the
Nodewrapped in this terminal phrase.
Any label describing the type of the dependency relation between this phrase (its node) and the governing phrase (node of the first ancestor phrase where this one does not act as head). This label is typically taken from the underlying node when the phrase is built, but it may be translated or modified and it is not kept synchronized with the underlying dependency tree during transformations of the phrase structure. Nevertheless it is assumed that once the transformations are done, the final dependency relations will be projected back to the dependency tree.
deprelattribute can also be supplied separately when creating the
Phrase::Term. If it is not supplied, it will be copied from the
Nodeto which the
Returns the list of dependents of the phrase. Terminal phrases return an empty list by definition.
Returns the list of children of the phrase. Terminal phrases return an empty list by definition.
Projects dependencies between the head and the dependents back to the underlying dependency structure. There is not much to do in the terminal phrase as it does not have any dependents. However, we will attach all nodes to the root, to prevent temporary cycles during the tree construction.
Returns a textual representation of the phrase and all subphrases. Useful for debugging.
Daniel Zeman <firstname.lastname@example.org>
Copyright © 2013, 2015 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.