KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
semantics::Event_db Class Reference

Database class to read and count parse tree events. More...

#include <Event_parser.h>

Public Member Functions

 Event_db ()
 default ctor, creates empty database More...
 
 Event_db (std::string event_file, std::string lexicon_file, bool learn=true, int num_lines=10000)
 constructs an event database object More...
 
Event_ptr get_tree (const int &i) const
 gets pointer to tree in position i in the list More...
 
void print_tree (const int &i, std::ostream &os) const
 print tree in position i to ostream os More...
 
size_t num_trees () const
 returns number of trees in list More...
 
size_t num_events () const
 returns number of events More...
 

Static Public Member Functions

static Lexicon_dblexicon ()
 returns a reference to the map between words and codes More...
 
static Nonterminal_dbnt_lexicon ()
 returns a reference to the map between nonterminals and codes More...
 
static LF_map_t & lf_word_map ()
 accessor to a global map flagging low frequency words More...
 

Static Public Attributes

static bool VERBOSE = false
 

Detailed Description

Database class to read and count parse tree events.

Constructor & Destructor Documentation

semantics::Event_db::Event_db ( )
inline

default ctor, creates empty database

semantics::Event_db::Event_db ( std::string  event_file,
std::string  lexicon_file,
bool  learn = true,
int  num_lines = 10000 
)
inline

constructs an event database object

Parameters
event_file(path-to-)filename as string
learnif true, counts events and builds a probability model

Member Function Documentation

Event_ptr semantics::Event_db::get_tree ( const int &  i) const
inline

gets pointer to tree in position i in the list

Returns
pointer to the root event of tree i
static Lexicon_db& semantics::Event_db::lexicon ( )
inlinestatic

returns a reference to the map between words and codes

static LF_map_t& semantics::Event_db::lf_word_map ( )
inlinestatic

accessor to a global map flagging low frequency words

static Nonterminal_db& semantics::Event_db::nt_lexicon ( )
inlinestatic

returns a reference to the map between nonterminals and codes

size_t semantics::Event_db::num_events ( ) const
inline

returns number of events

size_t semantics::Event_db::num_trees ( ) const
inline

returns number of trees in list

void semantics::Event_db::print_tree ( const int &  i,
std::ostream &  os 
) const
inline

print tree in position i to ostream os

Member Data Documentation

bool semantics::Event_db::VERBOSE = false
static

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