update dict
[QFreeRecite.git] / src / core / DictItem.h
blob0b5d6c1d8bbaa62a5c4c9efd543b41cd32f68fd4
1 /**
2 * FileName: DictItem.h.
3 * Used to define the class DictItem to declare the items from the dictionary.
5 * Copyright (C) 2008 Kermit Mei <kermit.mei@gmail.com>
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 version 3 as
10 * published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation.
21 * Written by Kermit Mei <kermit.mei@gmail.com>
23 * Many of the ideas implemented here are from the author's experiment.
24 * But the dictionary's format coincide with the other word recite software
25 * to help the users get more available data. And the review times designed
26 * by means of the theory named Forgetting Curve which dicoveried by the
27 * German psychologist named Hermann Ebbinghaus(1850–1909).
29 **/
31 #ifndef DICTITEM_HPP
32 #define DICTITEM_HPP
34 #include <string>
36 namespace freeRecite {
38 class DictItem
40 public:
41 DictItem() : strItem(0)
42 { /* Do Nothing! */ }
43 ~DictItem()
44 { /* Do Nothing! */ }
46 bool refer(const std::string &str);
48 const std::string & getW() const
49 { return bufW; }
50 const std::string & getT() const
51 { return bufT; }
52 const std::string & getM() const
53 { return bufM; }
54 const std::string & getE() const
55 { return bufE; }
57 private:
59 const std::string *strItem;
61 const static std::string sW;
62 const static std::string sT;
63 const static std::string sM;
64 const static std::string sE;
65 const static int offset;
67 size_t posW;
68 size_t posT;
69 size_t posM;
70 size_t posE;
72 std::string bufW;
73 std::string bufT;
74 std::string bufM;
75 std::string bufE;
78 } // namespace freeRecite end
79 #endif