ModErn Text Analysis
META Enumerates Textual Applications
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
parser
trees
visitors
head_finder.h
Go to the documentation of this file.
1
9
#ifndef META_PARSER_HEAD_FINDER_H_
10
#define META_PARSER_HEAD_FINDER_H_
11
12
#include <unordered_map>
13
14
#include "
meta.h
"
15
#include "parser/trees/visitors/visitor.h"
16
#include "
util/shim.h
"
17
18
namespace
meta
19
{
20
namespace
parser
21
{
22
23
struct
head_rule
24
{
25
virtual
uint64_t find_head(
const
internal_node
&)
const
= 0;
26
virtual
~
head_rule
() =
default
;
27
};
28
37
class
head_finder
:
public
visitor
<void>
38
{
39
public
:
43
using
rule_table
44
= std::unordered_map<class_label, std::unique_ptr<head_rule>>;
45
50
head_finder
();
51
55
head_finder
(
rule_table
&& table);
56
57
void
operator()
(
leaf_node
&)
override
;
58
void
operator()
(
internal_node
&)
override
;
59
60
private
:
64
rule_table
rules_
;
65
};
66
}
67
}
68
69
#endif
meta.h
Contains top-level namespace documentation for the META toolkit.
meta::parser::head_finder::rule_table
std::unordered_map< class_label, std::unique_ptr< head_rule >> rule_table
The storage type used for holding the head finding rules.
Definition:
head_finder.h:44
meta::parser::head_finder::head_finder
head_finder()
Constructs a default head finder, using the head finding rules for English from Michael Collins' thes...
Definition:
head_finder.cpp:159
meta::parser::visitor
Abstract base class for visitors over parse trees that are allowed to modify the underlying tree...
Definition:
visitor.h:50
meta::parser::internal_node
An internal node in a parse tree.
Definition:
internal_node.h:28
meta::parser::head_rule
Definition:
head_finder.h:23
meta::parser::head_finder
A visitor that annotates the internal nodes of parse trees with their head constituents/lexicons.
Definition:
head_finder.h:37
meta
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
Definition:
analyzer.h:24
meta::parser::head_finder::rules_
rule_table rules_
The head finding rules used for this head_finder.
Definition:
head_finder.h:64
shim.h
meta::parser::head_finder::operator()
void operator()(leaf_node &) override
Definition:
head_finder.cpp:249
meta::parser::leaf_node
A leaf node (pre-terminal) in a parse tree.
Definition:
leaf_node.h:24
Generated on Tue Mar 3 2015 23:20:16 for ModErn Text Analysis by
1.8.9.1