Split and Rtimes
[FreeRecite.git] / src / core / Reciter.h
blobb69b684c0c7990424ee263ae319678f019a204a3
1 /**
2 * FileName: Reciter.h.
3 * Used to define the class Reciter which is used to test or recite the words.
5 * Copyright (C) 2008 Kermit Mei (中文名:梅延涛).
6 * All Rights Reserved.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation.
22 * Written by Kermit Mei <kermit.mei@gmail.com>
24 * Many of the ideas implemented here are from the author's experiment.
25 * But the dictionary's format coincide with the other word recite software
26 * to help the users get more available data. And the review times designed
27 * by means of the theory named Forgetting Curve which dicoveried by the
28 * German psychologist named Hermann Ebbinghaus(1850–1909).
30 **/
32 #ifndef RECITER_H_
33 #define RECITER_H_
35 #include "Scanner.h"
37 namespace freeRecite {
39 class Reciter : public Scanner
41 public:
42 Reciter()
43 { /* Do Nothing Here! */ }
44 ~Reciter()
45 { /* Do Nothing Here! */ }
47 //Reimplement the virtual method from class Scanner.
48 unsigned times() const;
50 //Do this test again with an random order.
51 bool redo(bool Random = false);
53 /**
54 * Test with the result. The argument 'result' is true
55 * when the word which the user input is correct.
56 **/
57 void test(bool result);
60 inline
61 unsigned Reciter::times() const {
62 return static_cast<unsigned>(words.size()*5 + r_times);
65 } //namespace freeRecite end
67 #endif //RECITER_H_