25 #ifndef PRESAGE_ARPAPREDICTOR
26 #define PRESAGE_ARPAPREDICTOR
29 #include "../core/logger.h"
30 #include "../core/progress.h"
31 #include "../core/dispatcher.h"
40 bool operator() (
const float& f1,
const float& f2 )
const {
120 virtual void learn(
const std::vector<std::string>& change);
ARPAData(float lp, float la)
virtual Prediction predict(const size_t size, const char **filter) const
Generate prediction.
void addBigram(std::string)
ProgressBar< char > * bigramProg
void addUnigram(std::string)
std::string vocabFilename
std::map< std::string, int > vocabCode
std::map< TrigramKey, float > trigramMap
void set_arpa_filename(const std::string &value)
virtual void update(const Observable *variable)
float computeBigramBackoff(int, int) const
std::string VOCABFILENAME
Dispatcher< ARPAPredictor > dispatcher
std::map< int, std::string > vocabDecode
ProgressBar< char > * unigramProg
bool matchesPrefixAndFilter(std::string, std::string, const char **) const
float computeTrigramBackoff(int, int, int) const
ProgressBar< char > * trigramProg
virtual void learn(const std::vector< std::string > &change)
void set_vocab_filename(const std::string &value)
ARPAPredictor(Configuration *, ContextTracker *, const char *)
void addTrigram(std::string)
void set_timeout(const std::string &value)
std::map< int, ARPAData > unigramMap
std::map< BigramKey, ARPAData > bigramMap
bool operator<(const BigramKey &right) const
bool operator==(const TrigramKey &right) const
BigramKey(int wd1, int wd2)
Tracks user interaction and context.
TrigramKey(int wd1, int wd2, int wd3)
bool operator<(const TrigramKey &right) const
bool operator==(const TrigramKey &right) const
bool operator()(const float &f1, const float &f2) const