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

NAME

Treex::Core::Phrase::Builder

VERSION

version 2.20160629

DESCRIPTION

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

The tree of phrases is constructed bottom-up and after every new nonterminal phrase is created, the method detect_special_constructions() is called. It is empty by default but derived classes may use it to implement detection of special phrase types in particular annotation styles, such as the Prague-style coordination. See Treex::Tool::PhraseBuilder for an example.

METHODS

build

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

detect_special_constructions

Takes a phrase and returns either the same phrase, or a new phrase that should replace it.

Examines a nonterminal phrase and tries to recognize certain special phrase types. This part will be different for different builders. It depends both on the expected input style and the desired output style. This method is always called after a new nonterminal phrase is built. It can be defined as empty if the builder does not do anything special.

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.