ModErn Text Analysis
META Enumerates Textual Applications
|
A leaf node (pre-terminal) in a parse tree. More...
#include <leaf_node.h>
Public Types | |
using | base = util::clonable< node, leaf_node > |
Public Member Functions | |
leaf_node (class_label cat, std::string word) | |
Constructs a new leaf node with the given category and word. More... | |
const util::optional< std::string > & | word () const |
bool | is_leaf () const override |
bool | equal (const node &other) const override |
Public Member Functions inherited from meta::util::multilevel_clonable< Root, Base, Derived > | |
virtual std::unique_ptr< Root > | clone () const |
Clones the given object. More... | |
Private Attributes | |
const util::optional< std::string > | word_ |
The optional word for this leaf node. | |
A leaf node (pre-terminal) in a parse tree.
meta::parser::leaf_node::leaf_node | ( | class_label | cat, |
std::string | word | ||
) |
Constructs a new leaf node with the given category and word.
cat | The category for the new leaf node |
word | The word for the new leaf node |
const util::optional< std::string > & meta::parser::leaf_node::word | ( | ) | const |