diff --git a/honoka/plugins/simpleprediction.cpp b/honoka/plugins/simpleprediction.cpp index 637910f..c3257b8 100644 --- a/honoka/plugins/simpleprediction.cpp +++ b/honoka/plugins/simpleprediction.cpp @@ -44,7 +44,7 @@ SimplePrediction::SimplePrediction(ConfigPointer cfg) : Predictor(cfg) { size = cfg->read(HONOKA_CONFIG_SIMPLEPREDICTION_SIZE,HONOKA_DEFAULT_SIMPLEPREDICTION_SIZE); - if (size < 0) size = 0; + if (size < 1) size = HONOKA_DEFAULT_SIMPLEPREDICTION_SIZE; } @@ -125,8 +125,8 @@ void SimplePrediction::update(const WideString str,const WideString yomi) { if ((!yomi.length()) || (!str.length())) return; - for(multimap::iterator it = data.find(yomi);it != data.end();data.find(yomi)) - if (it->second == str) return; + for(multimap::iterator it = data.begin();it != data.end();it++) + if ((it->first == yomi) &&(it->second == str)) return; data.insert(pair(yomi,str)); if (data.size() > size) data.erase(data.begin()); return;