Go to the documentation of this file.
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);
171 #endif // PRESAGE_ARPAPREDICTOR
float computeTrigramBackoff(int, int, int) const
virtual void learn(const std::vector< std::string > &change)
ProgressBar< char > * trigramProg
bool operator==(const TrigramKey &right) const
bool operator<(const TrigramKey &right) const
void set_vocab_filename(const std::string &value)
std::string VOCABFILENAME
void addUnigram(std::string)
ARPAData(float lp, float la)
bool operator()(const float &f1, const float &f2) const
BigramKey(int wd1, int wd2)
std::map< std::string, int > vocabCode
Dispatcher< ARPAPredictor > dispatcher
Tracks user interaction and context.
bool operator<(const BigramKey &right) const
virtual void update(const Observable *variable)
bool matchesPrefixAndFilter(std::string, std::string, const char **) const
std::map< TrigramKey, float > trigramMap
virtual Prediction predict(const size_t size, const char **filter) const
Generate prediction.
float computeBigramBackoff(int, int) const
std::map< int, ARPAData > unigramMap
std::string vocabFilename
void addBigram(std::string)
void addTrigram(std::string)
std::map< BigramKey, ARPAData > bigramMap
void set_timeout(const std::string &value)
bool operator==(const TrigramKey &right) const
ProgressBar< char > * unigramProg
ARPAPredictor(Configuration *, ContextTracker *, const char *)
std::map< int, std::string > vocabDecode
ProgressBar< char > * bigramProg
void set_arpa_filename(const std::string &value)
TrigramKey(int wd1, int wd2, int wd3)