34 "DictionaryPredictor, dictionary lookup",
35 "DictionaryPredictor, a dictionary based predictor that generates a prediction by extracting tokens that start with the current prefix from a given dictionary"
57 logger << INFO <<
"DICTIONARY: " << value <<
endl;
64 logger << INFO <<
"PROBABILITY: " << value <<
endl;
71 std::string candidate;
74 std::ifstream dictionary_file;
78 assert(dictionary_file);
81 unsigned int count = 0;
82 while(dictionary_file >> candidate && count < max_partial_predictions_size) {
83 if(candidate.find(prefix) == 0) {
84 logger << NOTICE <<
"Found valid token: " << candidate <<
endl;
86 logger << NOTICE <<
"Filter check satisfied by token: " << candidate <<
endl;
90 logger << NOTICE <<
"Filter check failed, discarding token: " << candidate <<
endl;
93 logger << INFO <<
"Discarding invalid token: " << candidate <<
endl;
97 dictionary_file.close();
104 std::cout <<
"DictionaryPredictor::learn() method called" <<
std::endl;
105 std::cout <<
"DictionaryPredictor::learn() method exited" <<
std::endl;