ModErn Text Analysis
META Enumerates Textual Applications
leaf_node.h
Go to the documentation of this file.
1 
9 #ifndef META_PARSE_LEAF_NODE_H_
10 #define META_PARSE_LEAF_NODE_H_
11 
12 #include "parser/trees/node.h"
13 #include "util/clonable.h"
14 #include "util/optional.h"
15 
16 namespace meta
17 {
18 namespace parser
19 {
20 
24 class leaf_node : public util::clonable<node, leaf_node>
25 {
26  public:
29  using base::base;
30 
36  leaf_node(class_label cat, std::string word);
37 
41  const util::optional<std::string>& word() const;
42 
43  bool is_leaf() const override;
44 
45  bool equal(const node& other) const override;
46 
47  private:
52 };
53 }
54 }
55 
56 #endif
A single node in a parse tree for a sentence.
Definition: node.h:24
leaf_node(class_label cat, std::string word)
Constructs a new leaf node with the given category and word.
Definition: leaf_node.cpp:13
const util::optional< std::string > word_
The optional word for this leaf node.
Definition: leaf_node.h:51
Template class to facilitate polymorphic cloning.
Definition: clonable.h:28
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
const util::optional< std::string > & word() const
Definition: leaf_node.cpp:19
A leaf node (pre-terminal) in a parse tree.
Definition: leaf_node.h:24