diff options
Diffstat (limited to 'verbly/lib/adjective.h')
-rw-r--r-- | verbly/lib/adjective.h | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/verbly/lib/adjective.h b/verbly/lib/adjective.h new file mode 100644 index 0000000..3dcab9b --- /dev/null +++ b/verbly/lib/adjective.h | |||
@@ -0,0 +1,143 @@ | |||
1 | #ifndef ADJECTIVE_H_87B3FB75 | ||
2 | #define ADJECTIVE_H_87B3FB75 | ||
3 | |||
4 | namespace verbly { | ||
5 | |||
6 | class adjective_query; | ||
7 | class adverb_query; | ||
8 | class noun_query; | ||
9 | |||
10 | class adjective : public word { | ||
11 | public: | ||
12 | enum class positioning { | ||
13 | undefined, | ||
14 | predicate, | ||
15 | attributive, | ||
16 | postnominal | ||
17 | }; | ||
18 | |||
19 | private: | ||
20 | std::string _base_form; | ||
21 | std::string _comparative_form; | ||
22 | std::string _superlative_form; | ||
23 | positioning _position = positioning::undefined; | ||
24 | |||
25 | friend class adjective_query; | ||
26 | |||
27 | public: | ||
28 | adjective(const data& _data, int _id); | ||
29 | |||
30 | std::string base_form() const; | ||
31 | std::string comparative_form() const; | ||
32 | std::string superlative_form() const; | ||
33 | positioning position() const; | ||
34 | |||
35 | bool has_comparative_form() const; | ||
36 | bool has_superlative_form() const; | ||
37 | bool has_position() const; | ||
38 | |||
39 | adjective_query antonyms() const; | ||
40 | adjective_query synonyms() const; | ||
41 | adjective_query generalizations() const; | ||
42 | adjective_query specifications() const; | ||
43 | noun_query anti_pertainyms() const; | ||
44 | adverb_query mannernyms() const; | ||
45 | noun_query attributes() const; | ||
46 | }; | ||
47 | |||
48 | class adjective_query { | ||
49 | public: | ||
50 | adjective_query(const data& _data); | ||
51 | |||
52 | adjective_query& limit(int _limit); | ||
53 | adjective_query& random(bool _random); | ||
54 | adjective_query& except(const adjective& _word); | ||
55 | adjective_query& rhymes_with(const word& _word); | ||
56 | adjective_query& has_pronunciation(bool _has_prn); | ||
57 | |||
58 | adjective_query& requires_comparative_form(bool req); | ||
59 | adjective_query& requires_superlative_form(bool req); | ||
60 | adjective_query& position(adjective::positioning pos); | ||
61 | |||
62 | adjective_query& is_variant(bool _is_variant); | ||
63 | adjective_query& variant_of(const noun& _noun); | ||
64 | adjective_query& not_variant_of(const noun& _noun); | ||
65 | |||
66 | adjective_query& has_antonyms(bool _is_antonymic); | ||
67 | adjective_query& antonym_of(const adjective& _adj); | ||
68 | adjective_query& not_antonym_of(const adjective& _adj); | ||
69 | |||
70 | adjective_query& has_synonyms(bool _is_synonymic); | ||
71 | adjective_query& synonym_of(const adjective& _adj); | ||
72 | adjective_query& not_synonym_of(const adjective& _adj); | ||
73 | |||
74 | adjective_query& is_generalization(bool _is_generalization); | ||
75 | adjective_query& generalization_of(const adjective& _adj); | ||
76 | adjective_query& not_generalization_of(const adjective& _adj); | ||
77 | |||
78 | adjective_query& is_specification(bool _is_specification); | ||
79 | adjective_query& specification_of(const adjective& _adj); | ||
80 | adjective_query& not_specification_of(const adjective& _adj); | ||
81 | |||
82 | adjective_query& is_pertainymic(bool _is_pertainymic); | ||
83 | adjective_query& pertainym_of(const noun& _noun); | ||
84 | |||
85 | adjective_query& is_mannernymic(bool _is_mannernymic); | ||
86 | adjective_query& anti_mannernym_of(const adverb& _adv); | ||
87 | |||
88 | adjective_query& derived_from(const word& _w); | ||
89 | adjective_query& not_derived_from(const word& _w); | ||
90 | |||
91 | std::list<adjective> run() const; | ||
92 | |||
93 | const static int unlimited = -1; | ||
94 | |||
95 | protected: | ||
96 | const data& _data; | ||
97 | int _limit = unlimited; | ||
98 | bool _random = false; | ||
99 | std::list<std::string> _rhymes; | ||
100 | std::list<adjective> _except; | ||
101 | bool _has_prn = false; | ||
102 | |||
103 | bool _requires_comparative_form = false; | ||
104 | bool _requires_superlative_form = false; | ||
105 | adjective::positioning _position = adjective::positioning::undefined; | ||
106 | |||
107 | bool _is_variant = false; | ||
108 | std::list<noun> _variant_of; | ||
109 | std::list<noun> _not_variant_of; | ||
110 | |||
111 | bool _is_antonymic = false; | ||
112 | std::list<adjective> _antonym_of; | ||
113 | std::list<adjective> _not_antonym_of; | ||
114 | |||
115 | bool _is_synonymic = false; | ||
116 | std::list<adjective> _synonym_of; | ||
117 | std::list<adjective> _not_synonym_of; | ||
118 | |||
119 | bool _is_generalization = false; | ||
120 | std::list<adjective> _generalization_of; | ||
121 | std::list<adjective> _not_generalization_of; | ||
122 | |||
123 | bool _is_specification = false; | ||
124 | std::list<adjective> _specification_of; | ||
125 | std::list<adjective> _not_specification_of; | ||
126 | |||
127 | bool _is_pertainymic = false; | ||
128 | std::list<noun> _pertainym_of; | ||
129 | |||
130 | bool _is_mannernymic = false; | ||
131 | std::list<adverb> _anti_mannernym_of; | ||
132 | |||
133 | std::list<adjective> _derived_from_adjective; | ||
134 | std::list<adjective> _not_derived_from_adjective; | ||
135 | std::list<adverb> _derived_from_adverb; | ||
136 | std::list<adverb> _not_derived_from_adverb; | ||
137 | std::list<noun> _derived_from_noun; | ||
138 | std::list<noun> _not_derived_from_noun; | ||
139 | }; | ||
140 | |||
141 | }; | ||
142 | |||
143 | #endif /* end of include guard: ADJECTIVE_H_87B3FB75 */ | ||