update dict
[QFreeRecite.git] / src / core / Stress.cpp
blob1965d0c658acbbca62ee5745fc0b6fffc17eb1f2
1 #include "ConfigHolder.h"
2 #include "Stress.h"
4 namespace freeRecite {
6 bool Stress::load() {
7 if( loadWords(configHolder.keyFile().c_str(),true) ) {
8 wordList = new WordList(words.size(),configHolder.s_list());
9 std::vector<std::string>::const_iterator itr = words.begin();
10 while(itr != words.end()) {
11 errWords.insert(*itr);
12 ++itr;
14 return true;
15 }else {
16 return false;
20 void Stress::test(bool result) {
21 if(result) {
22 if(wordList->status() == 0) {
23 errWords.erase(getWord());
24 ++score;
26 wordList->pass();
27 } else {
28 wordList->lose();
32 bool Stress::remove(const std::string &word) {
33 errWords.erase(word);
34 Scanner::remove(word);
37 } //End of namespace freeRecite