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 | Protected Member Functions | Protected Attributes | Friends | List of all members
semantics::Tree_event Class Referenceabstract

#include <Tree_event.h>

Inheritance diagram for semantics::Tree_event:
semantics::Semantic_step_event semantics::Syntactic_event semantics::Head_semantic_event semantics::Mod_semantic_event semantics::Null_semantic_event semantics::Dependency_event semantics::Punctuation_event semantics::Root_event semantics::TOP_event semantics::Unary_event

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_typeData_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_dblexicon ()
 
static Nonterminal_dbnt_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::Mapvar_map () const =0
 return reference to the map between variable names and positions More...
 
const Key_typedata_as_word (const Key_type &variable) const
 look up data entry in position <variable> and return as word More...
 
const Key_typedata_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_typedata_as_semantic_head (const Key_type &variable) const
 look up data entry in position <variable> and return as semhead More...
 
const Key_typedata_as_semantic_args (const Key_type &variable) const
 look up data entry in position <variable> and return as semargs More...
 
const Value_typedata_as_code (const Key_type &variable) const
 look up data entry in position <variable> and return as code More...
 
Value_typedata_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)
 

Member Typedef Documentation

typedef boost::shared_ptr<Tree_event> semantics::Tree_event::Self_ptr

Constructor & Destructor Documentation

semantics::Tree_event::Tree_event ( bool  learn)
protected

construct an empty event with data to be filled at derived level

semantics::Tree_event::Tree_event ( const Data_type data,
bool  learn 
)
protected

construct an event with data prespecified

virtual semantics::Tree_event::~Tree_event ( )
inlinevirtual

virtual destructor

Member Function Documentation

const Tree_event::Value_type & semantics::Tree_event::data_as_code ( const Key_type variable) const
protected

look up data entry in position <variable> and return as code

const Tree_event::Key_type & semantics::Tree_event::data_as_nonterminal ( const Key_type variable) const
protected

look up data entry in position <variable> and return as nt

const Tree_event::Key_type & semantics::Tree_event::data_as_semantic_args ( const Key_type variable) const
protected

look up data entry in position <variable> and return as semargs

const Tree_event::Key_type & semantics::Tree_event::data_as_semantic_head ( const Key_type variable) const
protected

look up data entry in position <variable> and return as semhead

const Tree_event::Key_type semantics::Tree_event::data_as_semantic_step ( const Key_type variable) const
protected

look up data entry in position <variable> and return as step code

const Tree_event::Key_type & semantics::Tree_event::data_as_word ( const Key_type variable) const
protected

look up data entry in position <variable> and return as word

Tree_event::Value_type & semantics::Tree_event::data_in_slot ( const Key_type variable)
protected

return data in position as lvalue

Lexicon_db & semantics::Tree_event::lexicon ( )
static
virtual double semantics::Tree_event::log_probability ( const bool &  collins = false) const
pure virtual
Nonterminal_db & semantics::Tree_event::nt_lexicon ( )
static
virtual void semantics::Tree_event::print ( std::ostream &  os) const
pure virtual
virtual void semantics::Tree_event::print_view_counts ( std::ostream &  ) const
pure virtual
virtual void semantics::Tree_event::print_with_links ( std::ostream &  ) const
inlinevirtual
virtual void semantics::Tree_event::reacquire_view_counts ( )
inlinevirtual
virtual void semantics::Tree_event::release_view_counts ( )
inlinevirtual
virtual void semantics::Tree_event::resample_table_assignments ( )
pure virtual
virtual void semantics::Tree_event::update_event_views ( )
pure virtual

update event views

Implemented in semantics::Syntactic_event, and semantics::Null_semantic_event.

virtual void semantics::Tree_event::update_semantic_context ( const Sem_hash_pair ,
const Sem_hash_pair  
)
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.

virtual const Key_slots::Map& semantics::Tree_event::var_map ( ) const
protectedpure virtual

return reference to the map between variable names and positions

Implemented in semantics::Syntactic_event, and semantics::Null_semantic_event.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
Tree_event e 
)
friend

display this node in tree context

std::ostream& operator<< ( std::ostream &  os,
Tree_event e 
)
friend
std::ostream& operator<< ( std::ostream &  os,
Self_ptr  e 
)
friend

Member Data Documentation

const int semantics::Tree_event::ARGS = 1
static
Data_type semantics::Tree_event::data_
protected
const int semantics::Tree_event::HEAD = 0
static
const int semantics::Tree_event::LABEL = 2
static
bool semantics::Tree_event::learn_
protected
const int semantics::Tree_event::TAG = 1
static
bool semantics::Tree_event::VERBOSE = false
static
const int semantics::Tree_event::WORD = 0
static

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