Treex::Core::Phrase::NTerm
version 2.20151210
use Treex::Core::Document; use Treex::Core::Phrase::Term; use Treex::Core::Phrase::NTerm; my $document = new Treex::Core::Document; my $bundle = $document->create_bundle(); my $zone = $bundle->create_zone('en'); my $root = $zone->create_atree(); my $node = $root->create_child(); my $tphrase = new Treex::Core::Phrase::Term ('node' => $node); my $ntphrase = new Treex::Core::Phrase::NTerm ('head' => $tphrase);
NTerm is a nonterminal Phrase. It contains (refers to) one or more child Phrases. See Treex::Core::Phrase for more details.
NTerm
Phrase
A sub-Phrase of this phrase that is at the moment considered the head phrase (in the sense of dependency syntax). Head is a special case of child (sub-) phrase. The (one) head must always exist; other children are optional.
Sets a new head child for this phrase. The new head must be already a child of this phrase. The old head will become an ordinary non-head child.
Replaces the head by another phrase. This is used when we want to transform the head to a different class of phrases. The replacement must not have a parent yet.
Returns a textual representation of the phrase and all subphrases. Useful for debugging.
Daniel Zeman <zeman@ufal.mff.cuni.cz>
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.
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.