kgrams  0.1.0
Public Member Functions | Friends | List of all members
SBOSmoother Class Reference

Stupid Backoff continuation probability smoother. More...

#include <Smoothers.h>

Public Member Functions

 SBOSmoother (kgramFreqs &f, const double &lambda)
 Initialize a SBOSmoother from a kgramFreqs object with a fixed backoff penalization. More...
 
double operator() (const std::string &word, std::string context)
 Return Stupid Backoff continuation score of a word given a context. More...
 

Friends

class Sampler< SBOSmoother >
 

Detailed Description

Stupid Backoff continuation probability smoother.

Constructor & Destructor Documentation

◆ SBOSmoother()

SBOSmoother::SBOSmoother ( kgramFreqs f,
const double &  lambda 
)
inline

Initialize a SBOSmoother from a kgramFreqs object with a fixed backoff penalization.

Parameters
fa kgramFreqs class object. k-gram frequency table from which "bare" k-gram counts are read off.
lambdapositive number. Penalization in Stupid Backoff recursion.

Member Function Documentation

◆ operator()()

double SBOSmoother::operator() ( const std::string &  word,
std::string  context 
)
inline

Return Stupid Backoff continuation score of a word given a context.

Parameters
wordA string. Word for which the continuation score is to be computed.
contextA string. Context conditioning the score of 'word'.
Returns
a positive number. Stupid Backoff continuation score of 'word' given 'context'.

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