KJB
|
Template class to represent different "views" of syntactic events. More...
#include <Event_view.h>
Public Types | |
typedef Event_view< T, Traits > | Self |
typedef T | Event |
typedef Traits | Event_traits |
typedef Marginal_cell< Self, Traits::context_levels > | M_cell |
typedef M_cell::Key_type | Key_type |
typedef Key_type::Data_type | Data_type |
typedef M_cell::Map | Map |
Public Member Functions | |
Event_view (const bool learn=true) | |
Event_view (typename Data_type::iterator first, typename Data_type::iterator last, bool learn=true) | |
Constructs an event from two container iterators. More... | |
Event_view (const Self &other) | |
Copy constructor. More... | |
virtual | ~Event_view () |
Destructor. More... | |
Self & | operator= (const Self &source) |
Assignment operator. More... | |
std::vector< int > | get_numerators () const |
get counts of event at various smoothing levels More... | |
std::vector< int > | get_denominators () const |
get counts of context at various smoothing levels More... | |
std::vector< int > | get_diversities () const |
get counts of how many different events occur at this context More... | |
double | smoothed_probability (const bool &collins=false) const |
get smoothed conditional probability via Collins' method More... | |
double | predictive_probability () const |
get predictive prob according to HCRP model More... | |
void | display_conditioning_expression (std::ostream &os) const |
show output and context variables More... | |
void | unlearn () |
remove counts from database (treat as unobserved) More... | |
void | learn () |
add counts to database (treat as observed) More... | |
void | resample_table_assignment () |
resample the CRP table assignment for this event More... | |
Static Public Member Functions | |
static const double & | prior_prob (const size_t &val, const size_t &type) |
unconditional prior probability of a particular outcome More... | |
static const double & | diversity_weight () |
hard-coded diversity-weight parameter for this event type More... | |
Static Public Attributes | |
static Map & | map |
static const size_t & | smoothing_levels = Traits::context_levels |
static bool | VERBOSE = false |
Template class to represent different "views" of syntactic events.
typedef Key_type::Data_type semantics::Event_view< T, Traits >::Data_type |
typedef T semantics::Event_view< T, Traits >::Event |
typedef Traits semantics::Event_view< T, Traits >::Event_traits |
typedef M_cell::Key_type semantics::Event_view< T, Traits >::Key_type |
typedef Marginal_cell<Self, Traits::context_levels> semantics::Event_view< T, Traits >::M_cell |
typedef M_cell::Map semantics::Event_view< T, Traits >::Map |
typedef Event_view<T, Traits> semantics::Event_view< T, Traits >::Self |
|
inline |
semantics::Event_view< T, Traits >::Event_view | ( | typename Data_type::iterator | first, |
typename Data_type::iterator | last, | ||
bool | learn = true |
||
) |
Constructs an event from two container iterators.
Implementation of member functions.
|
inline |
Copy constructor.
|
inlinevirtual |
Destructor.
void semantics::Event_view< T, Traits >::display_conditioning_expression | ( | std::ostream & | os | ) | const |
show output and context variables
|
inlinestatic |
hard-coded diversity-weight parameter for this event type
std::vector< int > semantics::Event_view< T, Traits >::get_denominators | ( | ) | const |
get counts of context at various smoothing levels
std::vector< int > semantics::Event_view< T, Traits >::get_diversities | ( | ) | const |
get counts of how many different events occur at this context
std::vector< int > semantics::Event_view< T, Traits >::get_numerators | ( | ) | const |
get counts of event at various smoothing levels
|
inline |
add counts to database (treat as observed)
Event_view< T, Traits > & semantics::Event_view< T, Traits >::operator= | ( | const Self & | source | ) |
Assignment operator.
|
inline |
get predictive prob according to HCRP model
|
inlinestatic |
unconditional prior probability of a particular outcome
val | the code associated with the outcome whose probability is being computed |
type | contextual information; used for only some types |
|
inline |
resample the CRP table assignment for this event
|
inline |
get smoothed conditional probability via Collins' method
|
inline |
remove counts from database (treat as unobserved)
|
static |
|
static |
|
static |