diff options
Diffstat (limited to 'lib/verb.h')
-rw-r--r-- | lib/verb.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/lib/verb.h b/lib/verb.h new file mode 100644 index 0000000..7cc87e2 --- /dev/null +++ b/lib/verb.h | |||
@@ -0,0 +1,73 @@ | |||
1 | #ifndef VERB_H_BCC929AD | ||
2 | #define VERB_H_BCC929AD | ||
3 | |||
4 | namespace verbly { | ||
5 | |||
6 | /*class frame_part { | ||
7 | |||
8 | }; | ||
9 | |||
10 | class frame { | ||
11 | private: | ||
12 | std::list<frame_part> content; | ||
13 | std::map<std::string, std::vector<std::list<frame_part>::iterator>> predicates; | ||
14 | |||
15 | public: | ||
16 | frame(std::list<frame_part> content) : content(content) | ||
17 | { | ||
18 | |||
19 | } | ||
20 | |||
21 | std::unique_ptr<token> make_utterance() const | ||
22 | { | ||
23 | |||
24 | } | ||
25 | };*/ | ||
26 | |||
27 | class verb : public word { | ||
28 | private: | ||
29 | std::string _infinitive; | ||
30 | std::string _past_tense; | ||
31 | std::string _past_participle; | ||
32 | std::string _ing_form; | ||
33 | std::string _s_form; | ||
34 | |||
35 | friend class verb_query; | ||
36 | |||
37 | public: | ||
38 | verb(const data& _data, int _id); | ||
39 | |||
40 | std::string base_form() const; | ||
41 | std::string infinitive_form() const; | ||
42 | std::string past_tense_form() const; | ||
43 | std::string past_participle_form() const; | ||
44 | std::string ing_form() const; | ||
45 | std::string s_form() const; | ||
46 | }; | ||
47 | |||
48 | class verb_query { | ||
49 | public: | ||
50 | verb_query(const data& _data); | ||
51 | |||
52 | verb_query& limit(int _limit); | ||
53 | verb_query& random(bool _random); | ||
54 | verb_query& except(const verb& _word); | ||
55 | verb_query& rhymes_with(const word& _word); | ||
56 | verb_query& has_pronunciation(bool _has_prn); | ||
57 | |||
58 | std::list<verb> run() const; | ||
59 | |||
60 | const static int unlimited = -1; | ||
61 | |||
62 | private: | ||
63 | const data& _data; | ||
64 | int _limit = unlimited; | ||
65 | bool _random = false; | ||
66 | std::list<std::string> _rhymes; | ||
67 | std::list<verb> _except; | ||
68 | bool _has_prn = false; | ||
69 | }; | ||
70 | |||
71 | }; | ||
72 | |||
73 | #endif /* end of include guard: VERB_H_BCC929AD */ | ||