KJB
|
#include <Tree_event.h>
Public Types | |
typedef boost::shared_ptr < Tree_event > | Self_ptr |
typedef Token_map::Val_type | Value_type |
typedef Token_map::Key_type | Key_type |
typedef std::vector< Value_type > | Data_type |
typedef Value_type | Word_type |
typedef Value_type | Tag_type |
typedef Value_type | Label_type |
typedef Value_type | Distance_type |
typedef boost::tuple < Word_type, Label_type, Label_type > | Node_data |
typedef Semantic_data_base::Hash_pair | Sem_hash_pair |
Public Member Functions | |
virtual | ~Tree_event () |
virtual destructor More... | |
virtual double | log_probability (const bool &collins=false) const =0 |
compute log probability of this event More... | |
virtual void | release_view_counts () |
turn off learn_ and remove counts from database More... | |
virtual void | reacquire_view_counts () |
turn on learn_ and add counts to database More... | |
virtual void | update_event_views ()=0 |
update event views More... | |
virtual void | update_semantic_context (const Sem_hash_pair &, const Sem_hash_pair &) |
update semantic parent and head (if they exist) More... | |
virtual void | resample_table_assignments ()=0 |
resample CRP table assignments for all component event views More... | |
virtual void | print_view_counts (std::ostream &) const =0 |
pure virtual dummy — instantiated versions display count data More... | |
virtual void | print (std::ostream &os) const =0 |
display this node's data in human readable form More... | |
virtual void | print_with_links (std::ostream &) const |
virtual function, does nothing at base level More... | |
Static Public Member Functions | |
static Lexicon_db & | lexicon () |
static Nonterminal_db & | nt_lexicon () |
Static Public Attributes | |
static bool | VERBOSE = false |
static const int | WORD = 0 |
static const int | TAG = 1 |
static const int | LABEL = 2 |
static const int | HEAD = 0 |
static const int | ARGS = 1 |
Protected Member Functions | |
Tree_event (bool learn) | |
construct an empty event with data to be filled at derived level More... | |
Tree_event (const Data_type &data, bool learn) | |
construct an event with data prespecified More... | |
virtual const Key_slots::Map & | var_map () const =0 |
return reference to the map between variable names and positions More... | |
const Key_type & | data_as_word (const Key_type &variable) const |
look up data entry in position <variable> and return as word More... | |
const Key_type & | data_as_nonterminal (const Key_type &variable) const |
look up data entry in position <variable> and return as nt More... | |
const Key_type | data_as_semantic_step (const Key_type &variable) const |
look up data entry in position <variable> and return as step code More... | |
const Key_type & | data_as_semantic_head (const Key_type &variable) const |
look up data entry in position <variable> and return as semhead More... | |
const Key_type & | data_as_semantic_args (const Key_type &variable) const |
look up data entry in position <variable> and return as semargs More... | |
const Value_type & | data_as_code (const Key_type &variable) const |
look up data entry in position <variable> and return as code More... | |
Value_type & | data_in_slot (const Key_type &variable) |
return data in position as lvalue More... | |
Protected Attributes | |
Data_type | data_ |
bool | learn_ |
Friends | |
std::ostream & | operator<< (std::ostream &os, Tree_event &e) |
display this node in tree context More... | |
std::ostream & | operator<< (std::ostream &os, Tree_event *e) |
std::ostream & | operator<< (std::ostream &os, Self_ptr e) |
typedef std::vector<Value_type> semantics::Tree_event::Data_type |
typedef boost::tuple<Word_type, Label_type, Label_type> semantics::Tree_event::Node_data |
typedef boost::shared_ptr<Tree_event> semantics::Tree_event::Self_ptr |
|
protected |
construct an empty event with data to be filled at derived level
|
protected |
construct an event with data prespecified
|
inlinevirtual |
virtual destructor
|
protected |
look up data entry in position <variable> and return as code
|
protected |
look up data entry in position <variable> and return as nt
|
protected |
look up data entry in position <variable> and return as semargs
|
protected |
look up data entry in position <variable> and return as semhead
|
protected |
look up data entry in position <variable> and return as step code
|
protected |
look up data entry in position <variable> and return as word
|
protected |
return data in position as lvalue
|
static |
|
pure virtual |
compute log probability of this event
method | use "Collins" to use Collins' style |
Implemented in semantics::Dependency_event, semantics::Punctuation_event, semantics::Root_event, semantics::TOP_event, semantics::Mod_semantic_event, semantics::Unary_event, semantics::Head_semantic_event, and semantics::Null_semantic_event.
|
static |
|
pure virtual |
display this node's data in human readable form
Implemented in semantics::Syntactic_event, semantics::Unary_event, semantics::TOP_event, semantics::Punctuation_event, semantics::Root_event, semantics::Null_semantic_event, and semantics::Semantic_step_event.
|
pure virtual |
pure virtual dummy — instantiated versions display count data
Implemented in semantics::Dependency_event, semantics::Syntactic_event, semantics::Mod_semantic_event, semantics::Unary_event, semantics::Head_semantic_event, semantics::TOP_event, semantics::Punctuation_event, semantics::Root_event, and semantics::Null_semantic_event.
|
inlinevirtual |
virtual function, does nothing at base level
Reimplemented in semantics::Syntactic_event, semantics::Dependency_event, semantics::TOP_event, semantics::Mod_semantic_event, semantics::Unary_event, semantics::Head_semantic_event, semantics::Punctuation_event, and semantics::Root_event.
|
inlinevirtual |
turn on learn_ and add counts to database
Reimplemented in semantics::Dependency_event, semantics::Root_event, semantics::Mod_semantic_event, semantics::Unary_event, and semantics::Head_semantic_event.
|
inlinevirtual |
turn off learn_ and remove counts from database
Reimplemented in semantics::Dependency_event, semantics::Root_event, semantics::Mod_semantic_event, semantics::Unary_event, and semantics::Head_semantic_event.
|
pure virtual |
resample CRP table assignments for all component event views
Implemented in semantics::Dependency_event, semantics::Root_event, semantics::Mod_semantic_event, semantics::Unary_event, semantics::Head_semantic_event, semantics::TOP_event, semantics::Punctuation_event, and semantics::Null_semantic_event.
|
pure virtual |
update event views
Implemented in semantics::Syntactic_event, and semantics::Null_semantic_event.
|
inlinevirtual |
update semantic parent and head (if they exist)
Reimplemented in semantics::Dependency_event, semantics::Mod_semantic_event, semantics::Unary_event, and semantics::Head_semantic_event.
|
protectedpure virtual |
return reference to the map between variable names and positions
Implemented in semantics::Syntactic_event, and semantics::Null_semantic_event.
|
friend |
display this node in tree context
|
friend |
|
friend |
|
static |
|
protected |
|
static |
|
static |
|
protected |
|
static |
|
static |
|
static |