NAME

Treex::Core::Phrase::Builder

VERSION

version 2.20150928

DESCRIPTION

A Builder provides methods to construct a phrase structure tree around a dependency tree. It takes a Node and returns a Phrase.

METHODS

build

Wraps a node (and its subtree, if any) in a phrase.

detect_prague_pp

Examines a nonterminal phrase in the Prague style. If it recognizes a prepositional phrase, transforms the general nonterminal to PP. Returns the resulting phrase (if nothing has been changed, returns the original phrase).

detect_prague_coordination

Examines a nonterminal phrase in the Prague style (with analytical functions converted to dependency relation labels based on Universal Dependencies). If it recognizes a coordination, transforms the general NTerm to Coordination.

detect_name_phrase

Looks for name phrases, i.e. two or more proper nouns connected by the name relation. Makes sure that the leftmost name is the head (usually the opposite to PDT where family names are heads and given names are dependents). The method currently does not search for nested name phrases (which, if they they exist, we might want to merge with the current level).

detect_colon_predicate

The colon is sometimes treated as a substitute for the main predicate in PDT (usually the hypothetical predicate would equal to is).

Example: Veletrh GOLF 94 München: 2. – 4. 9. (“GOLF 94 fair Munich: September 2 – 9”)

We will make the first part the main constituent, and attach the second part as apposition. In some cases the colon is analyzed as copula (and the second part is a nominal predicate) so we want to do this before copulas are processed. Otherwise the scene will be reshaped and we will not recognize it.

detect_root_phrase

Checks whether the head node of a phrase is the artificial root of the dependency tree. If so, then it makes sure that there is only one dependent and its deprel is "root" (there is a consensus in Universal Dependencies that there should be always just one node attached to the artificial root and labeled "root"). If there were multiple dependents, the leftmost will be kept and the others will be made its dependents (and grandchildren of the artificial root node).

AUTHORS

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

COPYRIGHT AND LICENSE

Copyright © 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.