ModErn Text Analysis
META Enumerates Textual Applications
|
A visitor that annotates the internal nodes of parse trees with their head constituents/lexicons. More...
#include <head_finder.h>
Public Types | |
using | rule_table = std::unordered_map< class_label, std::unique_ptr< head_rule >> |
The storage type used for holding the head finding rules. | |
Public Types inherited from meta::parser::visitor< void > | |
using | result_type = void |
The result of running the visitor over the tree. | |
Public Member Functions | |
head_finder () | |
Constructs a default head finder, using the head finding rules for English from Michael Collins' thesis. More... | |
head_finder (rule_table &&table) | |
Constructs a head finder using the supplied head finding rules. | |
void | operator() (leaf_node &) override |
void | operator() (internal_node &) override |
Private Attributes | |
rule_table | rules_ |
The head finding rules used for this head_finder. | |
A visitor that annotates the internal nodes of parse trees with their head constituents/lexicons.
This follows the head finding rules given in Michael Collins' thesis and has been designed only for English using Penn Treebank annotations.
meta::parser::head_finder::head_finder | ( | ) |
Constructs a default head finder, using the head finding rules for English from Michael Collins' thesis.
|
overridevirtual |
Implements meta::parser::visitor< void >.
|
overridevirtual |
Implements meta::parser::visitor< void >.