diff options
Diffstat (limited to 'verbly/verb.h')
-rw-r--r-- | verbly/verb.h | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/verbly/verb.h b/verbly/verb.h index 42c8dc2..7cc87e2 100644 --- a/verbly/verb.h +++ b/verbly/verb.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef VERB_H_BCC929AD | 1 | #ifndef VERB_H_BCC929AD |
2 | #define VERB_H_BCC929AD | 2 | #define VERB_H_BCC929AD |
3 | 3 | ||
4 | #include <vector> | ||
5 | |||
6 | namespace verbly { | 4 | namespace verbly { |
7 | 5 | ||
8 | /*class frame_part { | 6 | /*class frame_part { |
@@ -26,42 +24,50 @@ namespace verbly { | |||
26 | } | 24 | } |
27 | };*/ | 25 | };*/ |
28 | 26 | ||
29 | enum class conjugation { | 27 | class verb : public word { |
30 | present_participle, | ||
31 | past_participle, | ||
32 | infinitive | ||
33 | }; | ||
34 | |||
35 | class verb { | ||
36 | private: | 28 | private: |
37 | int id; | 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; | ||
38 | 36 | ||
39 | public: | 37 | public: |
40 | verb(int id) : id(id) | 38 | verb(const data& _data, int _id); |
41 | { | ||
42 | |||
43 | } | ||
44 | 39 | ||
45 | std::string infinitive; | 40 | std::string base_form() const; |
46 | std::string past_tense; | 41 | std::string infinitive_form() const; |
47 | std::string past_participle; | 42 | std::string past_tense_form() const; |
48 | std::string ing_form; | 43 | std::string past_participle_form() const; |
49 | std::string s_form; | 44 | std::string ing_form() const; |
50 | //std::vector<frame> frames; | 45 | std::string s_form() const; |
46 | }; | ||
47 | |||
48 | class verb_query { | ||
49 | public: | ||
50 | verb_query(const data& _data); | ||
51 | 51 | ||
52 | std::string conjugate(conjugation infl) const | 52 | verb_query& limit(int _limit); |
53 | { | 53 | verb_query& random(bool _random); |
54 | switch (infl) | 54 | verb_query& except(const verb& _word); |
55 | { | 55 | verb_query& rhymes_with(const word& _word); |
56 | case conjugation::infinitive: return infinitive; | 56 | verb_query& has_pronunciation(bool _has_prn); |
57 | case conjugation::past_participle: return past_participle; | 57 | |
58 | case conjugation::present_participle: return ing_form; | 58 | std::list<verb> run() const; |
59 | } | 59 | |
60 | } | 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; | ||
61 | }; | 69 | }; |
62 | 70 | ||
63 | }; | 71 | }; |
64 | 72 | ||
65 | #include "token.h" | ||
66 | |||
67 | #endif /* end of include guard: VERB_H_BCC929AD */ | 73 | #endif /* end of include guard: VERB_H_BCC929AD */ |