summary refs log tree commit diff stats
path: root/adjective.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-03-16 11:27:16 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-03-16 11:27:16 -0400
commitae5f75965f8202c8478622763a27ef1848a8ed1a (patch)
treefcbe1a05eeec628118bcf32db9135e101e038cd5 /adjective.h
parente5f284e6cf676fb0e712f568e560b5b8661506f4 (diff)
downloadverbly-ae5f75965f8202c8478622763a27ef1848a8ed1a.tar.gz
verbly-ae5f75965f8202c8478622763a27ef1848a8ed1a.tar.bz2
verbly-ae5f75965f8202c8478622763a27ef1848a8ed1a.zip
Added more inflections, word relationships, and pronunciations
Nouns, adjectives, and adverbs now have inflected forms. A large number of WordNet word relationships (all noun-noun relationships, plus synonymy and antonymy for all word types except verbs) have been added. Additionally, CMUDICT is now being used to store word pronunciations for rhyming purposes. Verbly is now also a compiled library rather than being header-only due to the complexity of the query interface.
Diffstat (limited to 'adjective.h')
-rw-r--r--adjective.h126
1 files changed, 119 insertions, 7 deletions
diff --git a/adjective.h b/adjective.h index 9d7883f..4927d59 100644 --- a/adjective.h +++ b/adjective.h
@@ -3,17 +3,129 @@
3 3
4namespace verbly { 4namespace verbly {
5 5
6 class adjective { 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
7 private: 19 private:
8 int id; 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;
9 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 {
10 public: 49 public:
11 std::string form; 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 std::list<adjective> run() const;
89
90 const static int unlimited = -1;
91
92 protected:
93 const data& _data;
94 int _limit = unlimited;
95 bool _random = false;
96 std::list<std::string> _rhymes;
97 std::list<adjective> _except;
98 bool _has_prn = false;
99
100 bool _requires_comparative_form = false;
101 bool _requires_superlative_form = false;
102 adjective::positioning _position = adjective::positioning::undefined;
103
104 bool _is_variant = false;
105 std::list<noun> _variant_of;
106 std::list<noun> _not_variant_of;
107
108 bool _is_antonymic = false;
109 std::list<adjective> _antonym_of;
110 std::list<adjective> _not_antonym_of;
111
112 bool _is_synonymic = false;
113 std::list<adjective> _synonym_of;
114 std::list<adjective> _not_synonym_of;
115
116 bool _is_generalization = false;
117 std::list<adjective> _generalization_of;
118 std::list<adjective> _not_generalization_of;
119
120 bool _is_specification = false;
121 std::list<adjective> _specification_of;
122 std::list<adjective> _not_specification_of;
123
124 bool _is_pertainymic = false;
125 std::list<noun> _pertainym_of;
12 126
13 adjective(int id) : id(id) 127 bool _is_mannernymic = false;
14 { 128 std::list<adverb> _anti_mannernym_of;
15
16 }
17 }; 129 };
18 130
19}; 131};