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 | List of all members
semantics::Event_view< T, Traits > Class Template Reference

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...
 
Selfoperator= (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 Mapmap
 
static const size_t & smoothing_levels = Traits::context_levels
 
static bool VERBOSE = false
 

Detailed Description

template<class T, class Traits = View_traits<T>>
class semantics::Event_view< T, Traits >

Template class to represent different "views" of syntactic events.

Member Typedef Documentation

template<class T, class Traits = View_traits<T>>
typedef Key_type::Data_type semantics::Event_view< T, Traits >::Data_type
template<class T, class Traits = View_traits<T>>
typedef T semantics::Event_view< T, Traits >::Event
template<class T, class Traits = View_traits<T>>
typedef Traits semantics::Event_view< T, Traits >::Event_traits
template<class T, class Traits = View_traits<T>>
typedef M_cell::Key_type semantics::Event_view< T, Traits >::Key_type
template<class T, class Traits = View_traits<T>>
typedef Marginal_cell<Self, Traits::context_levels> semantics::Event_view< T, Traits >::M_cell
template<class T, class Traits = View_traits<T>>
typedef M_cell::Map semantics::Event_view< T, Traits >::Map
template<class T, class Traits = View_traits<T>>
typedef Event_view<T, Traits> semantics::Event_view< T, Traits >::Self

Constructor & Destructor Documentation

template<class T, class Traits = View_traits<T>>
semantics::Event_view< T, Traits >::Event_view ( const bool  learn = true)
inline
template<class T , class Traits >
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.

template<class T, class Traits = View_traits<T>>
semantics::Event_view< T, Traits >::Event_view ( const Self other)
inline

Copy constructor.

template<class T, class Traits = View_traits<T>>
virtual semantics::Event_view< T, Traits >::~Event_view ( )
inlinevirtual

Destructor.

Member Function Documentation

template<class T , class Traits >
void semantics::Event_view< T, Traits >::display_conditioning_expression ( std::ostream &  os) const

show output and context variables

template<class T, class Traits = View_traits<T>>
static const double& semantics::Event_view< T, Traits >::diversity_weight ( )
inlinestatic

hard-coded diversity-weight parameter for this event type

Returns
the value of the 'u' diversity parameter in Collins (2003)
template<class T , class Traits >
std::vector< int > semantics::Event_view< T, Traits >::get_denominators ( ) const

get counts of context at various smoothing levels

template<class T , class Traits >
std::vector< int > semantics::Event_view< T, Traits >::get_diversities ( ) const

get counts of how many different events occur at this context

template<class T , class Traits >
std::vector< int > semantics::Event_view< T, Traits >::get_numerators ( ) const

get counts of event at various smoothing levels

template<class T, class Traits = View_traits<T>>
void semantics::Event_view< T, Traits >::learn ( )
inline

add counts to database (treat as observed)

template<class T , class Traits >
Event_view< T, Traits > & semantics::Event_view< T, Traits >::operator= ( const Self source)

Assignment operator.

template<class T, class Traits = View_traits<T>>
double semantics::Event_view< T, Traits >::predictive_probability ( ) const
inline

get predictive prob according to HCRP model

template<class T, class Traits = View_traits<T>>
static const double& semantics::Event_view< T, Traits >::prior_prob ( const size_t &  val,
const size_t &  type 
)
inlinestatic

unconditional prior probability of a particular outcome

Parameters
valthe code associated with the outcome whose probability is being computed
typecontextual information; used for only some types
template<class T, class Traits = View_traits<T>>
void semantics::Event_view< T, Traits >::resample_table_assignment ( )
inline

resample the CRP table assignment for this event

template<class T, class Traits = View_traits<T>>
double semantics::Event_view< T, Traits >::smoothed_probability ( const bool &  collins = false) const
inline

get smoothed conditional probability via Collins' method

template<class T, class Traits = View_traits<T>>
void semantics::Event_view< T, Traits >::unlearn ( )
inline

remove counts from database (treat as unobserved)

Member Data Documentation

template<class T, class Traits = View_traits<T>>
Event_view< T, Traits >::Map & semantics::Event_view< T, Traits >::map
static
Initial value:
=
Marginal_cell<Event_view<T,Traits>, Traits::context_levels>::map
template<class T, class Traits = View_traits<T>>
const size_t & semantics::Event_view< T, Traits >::smoothing_levels = Traits::context_levels
static
template<class T, class Traits = View_traits<T>>
bool semantics::Event_view< T, Traits >::VERBOSE = false
static

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