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

Maximum-Likelihood continuation probability smoother. More...

#include <Smoothers.h>

Public Member Functions

 MLSmoother (kgramFreqs &f)
 Initialize an AddkSmoother from a kgramFreqs object with a fixed constant 'k'. More...
 
double operator() (const std::string &word, std::string context)
 Return Maximum-Likelihood continuation probability of a word given a context. More...
 

Friends

class Sampler< MLSmoother >
 

Detailed Description

Maximum-Likelihood continuation probability smoother.

Constructor & Destructor Documentation

◆ MLSmoother()

MLSmoother::MLSmoother ( kgramFreqs f)
inline

Initialize an AddkSmoother from a kgramFreqs object with a fixed constant 'k'.

Parameters
fa kgramFreqs class object. k-gram frequency table from which "bare" k-gram counts are read off.

Member Function Documentation

◆ operator()()

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

Return Maximum-Likelihood continuation probability of a word given a context.

Parameters
wordA string. Word for which the continuation probability is to be computed.
contextA string. Context conditioning the probability of 'word'.
Returns
a positive number. Maximum-Likelihood continuation probability of 'word' given 'context'.

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