KJB
|
#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_tuple > | Tuple_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_db & | lexicon () |
static Nonterminal_db & | nt_lexicon () |
Static Public Attributes | |
static bool | VERBOSE = false |
Static initialization. More... | |
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
typedef boost::shared_ptr<T> semantics::Semspear_tree_parser< T >::Constituent_ptr |
typedef std::istream semantics::Semspear_tree_parser< T >::Input_stream |
typedef int semantics::Semspear_tree_parser< T >::Token_code |
typedef std::string semantics::Semspear_tree_parser< T >::Token_contents |
typedef boost::tuple<Token_contents, Token_code> semantics::Semspear_tree_parser< T >::Token_tuple |
typedef std::list<Token_tuple> semantics::Semspear_tree_parser< T >::Tuple_stack |
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.
tree_stream | an input stream containing trees to be parsed |
lexicon_stream | an input stream containing words and freq flags |
learn | governs whether to update model using this tree |
|
inlinestatic |
|
inlinestatic |
Semspear_tree_parser< T >::Constituent_ptr semantics::Semspear_tree_parser< T >::parse_constituent | ( | bool | at_root = true | ) |
parse the next edge in the stream
|
static |
Static initialization.