37 logger(
"Selector", std::cerr),
58 std::vector<std::string> result;
60 for (
size_t i=0 ; i<p.
size() ; i++) {
62 result.push_back(token);
63 logger << DEBUG <<
"Added token to selector consideration set: " << token <<
endl;
68 logger << DEBUG <<
"Context change detected." <<
endl;
71 logger << DEBUG <<
"No context change detected." <<
endl;
84 result.erase (result.begin() +
suggestions, result.end());
111 std::vector<std::string>::const_iterator i = v.begin();
112 while( i != v.end() ) {
113 logger << DEBUG <<
"Adding token to suggested token set: " << *i <<
endl;
118 logger << DEBUG <<
"Suggested words: ";
133 logger << DEBUG <<
"Clearing previously suggested tokens set." <<
endl;
147 std::vector< std::string > temp;
149 for( std::vector<std::string>::iterator i = v.begin();
153 temp.push_back( *i );
154 logger << DEBUG <<
"Token passed repetition filter: " << *i <<
endl;
156 logger << DEBUG <<
"Token failed repetition filter: " << *i <<
endl;
178 std::vector<std::string>::iterator i = v.begin();
179 while (i != v.end()) {
181 logger << INFO <<
"Removing token: " << *i <<
endl;
197 logger << INFO <<
"LOGGER: " << value <<
endl;
206 logger << INFO <<
"SUGGESTIONS: " << value <<
endl;
209 logger << ERROR <<
"Presage.Selector.SUGGESTIONS value out of range!/a" <<
endl;
223 logger << INFO <<
"REPEAT_SUGGESTIONS: " << value <<
endl;
235 logger << INFO <<
"GREEDY_SUGGESTION_THRESHOLD: " << value <<
endl;
238 logger << ERROR <<
"GREEDY_SUGGESTION_THRESHOLD value out of range." << value <<
endl;
bool get_repeat_suggestions() const
std::string getWord() const
static int toInt(const std::string)
void set_greedy_suggestion_threshold(const std::string &value)
void dispatch(const Observable *var)
size_t greedy_suggestion_threshold
Dispatcher< Selector > dispatcher
static const char * GREEDY_SUGGESTION_THRESHOLD
Selector(Configuration *, ContextTracker *)
void clearSuggestedWords()
void thresholdFilter(std::vector< std::string > &)
void set_logger(const std::string &value)
_SetLevel setlevel(std::string __l)
Manipulator for level.
Variable * find(const std::string &variable) const
size_t get_greedy_suggestion_threshold() const
Suggestion getSuggestion(int=0) const
std::string previous_prefix
void repetitionFilter(std::vector< std::string > &)
static const char * REPEAT_SUGGESTIONS
static const char * SUGGESTIONS
virtual std::string get_name() const =0
void updateSuggestedWords(const std::vector< std::string > &)
ContextTracker * contextTracker
void map(Observable *var, const mbr_func_ptr_t &ptr)
void set_suggestions(const std::string &value)
static const char * LOGGER
static bool isYes(const char *)
std::vector< std::string > select(Prediction)
Tracks user interaction and context.
size_t get_suggestions() const
void set_repeat_suggestions(const std::string &value)
std::string getPrefix() const
const Logger< _charT, _Traits > & endl(const Logger< _charT, _Traits > &lgr)