ModErn Text Analysis
META Enumerates Textual Applications
Public Types | Public Member Functions | Private Attributes | List of all members
meta::parser::leaf_node Class Reference

A leaf node (pre-terminal) in a parse tree. More...

#include <leaf_node.h>

Inheritance diagram for meta::parser::leaf_node:
meta::util::multilevel_clonable< Root, Base, Derived >

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.
 

Detailed Description

A leaf node (pre-terminal) in a parse tree.

Constructor & Destructor Documentation

meta::parser::leaf_node::leaf_node ( class_label  cat,
std::string  word 
)

Constructs a new leaf node with the given category and word.

Parameters
catThe category for the new leaf node
wordThe word for the new leaf node

Member Function Documentation

const util::optional< std::string > & meta::parser::leaf_node::word ( ) const
Returns
the (optional) word for this leaf node

The documentation for this class was generated from the following files: