ZGen  0.2.0
a linearization system for natural language.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
ZGen::ShiftReduce::ScoreMap< ScoreType > Class Template Reference

#include <score_map.h>

Public Member Functions

 ScoreMap (extractor_t _extractor)
 
floatval_t score (const ScoreContext &ctx, const Action &act, bool avg, floatval_t default_return_value=0.)
 
void update (const ScoreContext &ctx, const Action &act, int now, floatval_t scale=1.)
 
void flush (int now)
 
void save (boost::archive::text_oarchive &oa)
 
void load (boost::archive::text_iarchive &ia)
 

Constructor & Destructor Documentation

template<class ScoreType >
ZGen::ShiftReduce::ScoreMap< ScoreType >::ScoreMap ( extractor_t  _extractor)
inline

Member Function Documentation

template<class ScoreType >
void ZGen::ShiftReduce::ScoreMap< ScoreType >::flush ( int  now)
inline
template<class ScoreType >
void ZGen::ShiftReduce::ScoreMap< ScoreType >::load ( boost::archive::text_iarchive &  ia)
inline

Loading the score map from the archive.

Parameters
[in]iaThe input archive.
template<class ScoreType >
void ZGen::ShiftReduce::ScoreMap< ScoreType >::save ( boost::archive::text_oarchive &  oa)
inline

Saving the score map to the archive.

template<class ScoreType >
floatval_t ZGen::ShiftReduce::ScoreMap< ScoreType >::score ( const ScoreContext ctx,
const Action act,
bool  avg,
floatval_t  default_return_value = 0. 
)
inline

Get the score for the (context, action) pair

Parameters
[in]ctxThe scoring context.
[in]actThe action.
[in]avgIf avg is true return the averaged parameter, else return the non-averaged parameter.
[in]default_return_valueThe default return value.
Returns
floatval_t The score.
template<class ScoreType >
void ZGen::ShiftReduce::ScoreMap< ScoreType >::update ( const ScoreContext ctx,
const Action act,
int  now,
floatval_t  scale = 1. 
)
inline

Update the parameter for the (context, action) pair

Parameters
[in]ctxThe scoring context.
[in]actThe action
[in]nowThe current timestamp.
[in]scaleThe updated scale.

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