kgrams
0.1.0
|
Add-k continuation probability smoother. More...
#include <Smoothers.h>
Public Member Functions | |
AddkSmoother (kgramFreqs &f, const double &k) | |
Initialize an AddkSmoother from a kgramFreqs object with a fixed constant 'k'. More... | |
double | operator() (const std::string &word, std::string context) |
Return Add-k continuation probability of a word given a context. More... | |
Friends | |
class | Sampler< AddkSmoother > |
Add-k continuation probability smoother.
|
inline |
Initialize an AddkSmoother from a kgramFreqs object with a fixed constant 'k'.
f | a kgramFreqs class object. k-gram frequency table from which "bare" k-gram counts are read off. |
k | positive number. Constant weight added to k-gram counts. |
|
inline |
Return Add-k continuation probability of a word given a context.
word | A string. Word for which the continuation probability is to be computed. |
context | A string. Context conditioning the probability of 'word'. |