15 #include <boost/make_shared.hpp>
16 #include <boost/array.hpp>
17 #include <boost/tuple/tuple.hpp>
33 typedef boost::shared_ptr<Tree_event>
Self_ptr;
41 typedef boost::tuple<Word_type, Label_type, Label_type>
Node_data;
52 static const int TAG = 1;
84 const bool& collins =
false
123 virtual void print(std::ostream& os)
const = 0;
198 std::ostream& operator<<(std::ostream& os, const std::vector<T>& c)
201 for(
typename std::vector<T>::const_iterator it = c.begin();
boost::shared_ptr< Tree_event > Self_ptr
Definition: Tree_event.h:33
const Value_type & data_as_code(const Key_type &variable) const
look up data entry in position <variable> and return as code
Definition: Tree_event.cpp:99
boost::tuple< size_t, size_t > Hash_pair
Definition: Semantic_elaboration.h:114
Tree_event(bool learn)
construct an empty event with data to be filled at derived level
Definition: Tree_event.cpp:37
virtual void release_view_counts()
turn off learn_ and remove counts from database
Definition: Tree_event.h:93
int verbose
Definition: triangle.c:724
std::vector< Value_type > Data_type
Definition: Tree_event.h:36
static bool VERBOSE
Definition: Tree_event.h:48
const Key_type data_as_semantic_step(const Key_type &variable) const
look up data entry in position <variable> and return as step code
Definition: Tree_event.cpp:57
bool learn_
Definition: Tree_event.h:183
virtual ~Tree_event()
virtual destructor
Definition: Tree_event.h:74
virtual void update_event_views()=0
update event views
static const int LABEL
Definition: Tree_event.h:53
friend std::ostream & operator<<(std::ostream &os, Tree_event *e)
Definition: Tree_event.h:143
const Key_type & data_as_nonterminal(const Key_type &variable) const
look up data entry in position <variable> and return as nt
Definition: Tree_event.cpp:50
Value_type & data_in_slot(const Key_type &variable)
return data in position as lvalue
Definition: Tree_event.cpp:119
void set_verbosity(bool verbose)
Definition: Tree_event.h:192
virtual void print(std::ostream &os) const =0
display this node's data in human readable form
std::string Key_type
Definition: Token_map.h:23
virtual void print_view_counts(std::ostream &) const =0
pure virtual dummy — instantiated versions display count data
Definition: Tree_event.h:26
Value_type Label_type
Definition: Tree_event.h:39
Semantic_data_base::Hash_pair Sem_hash_pair
Definition: Tree_event.h:42
friend std::ostream & operator<<(std::ostream &os, Self_ptr e)
Definition: Tree_event.h:150
Value_type Distance_type
Definition: Tree_event.h:40
static const int TAG
Definition: Tree_event.h:52
size_t Val_type
Definition: Token_map.h:24
virtual void update_semantic_context(const Sem_hash_pair &, const Sem_hash_pair &)
update semantic parent and head (if they exist)
Definition: Tree_event.h:104
virtual void reacquire_view_counts()
turn on learn_ and add counts to database
Definition: Tree_event.h:96
static const int ARGS
Definition: Tree_event.h:55
virtual double log_probability(const bool &collins=false) const =0
compute log probability of this event
const Key_type & data_as_semantic_head(const Key_type &variable) const
look up data entry in position <variable> and return as semhead
Definition: Tree_event.cpp:66
virtual void print_with_links(std::ostream &) const
virtual function, does nothing at base level
Definition: Tree_event.h:127
Data_type data_
Definition: Tree_event.h:182
Definition: Lexicon_db.h:17
static const int WORD
Definition: Tree_event.h:51
virtual void resample_table_assignments()=0
resample CRP table assignments for all component event views
Value_type Tag_type
Definition: Tree_event.h:38
static const int HEAD
Definition: Tree_event.h:54
Token_map::Key_type Key_type
Definition: Tree_event.h:35
boost::tuple< Word_type, Label_type, Label_type > Node_data
Definition: Tree_event.h:41
static Lexicon_db & lexicon()
Definition: Tree_event.cpp:20
virtual const Key_slots::Map & var_map() const =0
return reference to the map between variable names and positions
Definition: Nonterminal_db.h:16
boost::bimap< int, std::string > Map
Definition: Event_traits.h:34
friend std::ostream & operator<<(std::ostream &os, Tree_event &e)
display this node in tree context
Definition: Tree_event.h:136
const Key_type & data_as_semantic_args(const Key_type &variable) const
look up data entry in position <variable> and return as semargs
Definition: Tree_event.cpp:82
Token_map::Val_type Value_type
Definition: Tree_event.h:34
const Key_type & data_as_word(const Key_type &variable) const
look up data entry in position <variable> and return as word
Definition: Tree_event.cpp:43
static Nonterminal_db & nt_lexicon()
Definition: Tree_event.cpp:26
Value_type Word_type
Definition: Tree_event.h:37