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