KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
semantics::Semspear_tree_parser< T > Class Template Reference

#include <Semspear_tree_parser.h>

Public Types

typedef std::istream Input_stream
 
typedef std::string Token_contents
 
typedef int Token_code
 
typedef boost::tuple
< Token_contents, Token_code
Token_tuple
 
typedef std::list< Token_tupleTuple_stack
 
typedef boost::shared_ptr< T > Constituent_ptr
 

Public Member Functions

 Semspear_tree_parser (Input_stream &tree_stream, Input_stream &lexicon_stream, bool learn=true)
 construct a parser object with text input 'istream' More...
 
Constituent_ptr parse_constituent (bool at_root=true)
 parse the next edge in the stream More...
 

Static Public Member Functions

static Lexicon_dblexicon ()
 
static Nonterminal_dbnt_lexicon ()
 

Static Public Attributes

static bool VERBOSE = false
 Static initialization. More...
 

Detailed Description

template<class T>
class semantics::Semspear_tree_parser< T >

Parses an edge of type T. The type T must have these methods: set_label(), set_word(), add_child(), and optionally set_head() to enable functionality for reading in head marker indices from the input stream. T must also have a public container of children or child pointers, accessible with a public children() method. T should have a complete_tree() method to signal that tree is built

Member Typedef Documentation

template<class T>
typedef boost::shared_ptr<T> semantics::Semspear_tree_parser< T >::Constituent_ptr
template<class T>
typedef std::istream semantics::Semspear_tree_parser< T >::Input_stream
template<class T>
typedef int semantics::Semspear_tree_parser< T >::Token_code
template<class T>
typedef std::string semantics::Semspear_tree_parser< T >::Token_contents
template<class T>
typedef boost::tuple<Token_contents, Token_code> semantics::Semspear_tree_parser< T >::Token_tuple
template<class T>
typedef std::list<Token_tuple> semantics::Semspear_tree_parser< T >::Tuple_stack

Constructor & Destructor Documentation

template<class T>
semantics::Semspear_tree_parser< T >::Semspear_tree_parser ( Input_stream tree_stream,
Input_stream lexicon_stream,
bool  learn = true 
)

construct a parser object with text input 'istream'

Implementation of member functions.

Parameters
tree_streaman input stream containing trees to be parsed
lexicon_streaman input stream containing words and freq flags
learngoverns whether to update model using this tree

Member Function Documentation

template<class T>
static Lexicon_db& semantics::Semspear_tree_parser< T >::lexicon ( )
inlinestatic
template<class T>
static Nonterminal_db& semantics::Semspear_tree_parser< T >::nt_lexicon ( )
inlinestatic
template<class T >
Semspear_tree_parser< T >::Constituent_ptr semantics::Semspear_tree_parser< T >::parse_constituent ( bool  at_root = true)

parse the next edge in the stream

Returns
a pointer to an edge object of type T

Member Data Documentation

template<class T>
bool semantics::Semspear_tree_parser< T >::VERBOSE = false
static

Static initialization.


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