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

NAME

Treex::Core::Phrase::NTerm

VERSION

version 2.20210102

SYNOPSIS

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

DESCRIPTION

NTerm is a nonterminal Phrase. It contains (refers to) one or more child Phrases. See Treex::Core::Phrase for more details.

ATTRIBUTES

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.

METHODS

set_head ($child_phrase);

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.

replace_core_child ($old_head, $new_head);

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.

as_string

Returns a textual representation of the phrase and all subphrases. Useful for debugging.

AUTHORS

Daniel Zeman <zeman@ufal.mff.cuni.cz>

COPYRIGHT AND LICENSE

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.