summary refs log tree commit diff stats
path: root/noun.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 /noun.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 'noun.h')
-rw-r--r--noun.h171
1 files changed, 171 insertions, 0 deletions
diff --git a/noun.h b/noun.h new file mode 100644 index 0000000..f5ba256 --- /dev/null +++ b/noun.h
@@ -0,0 +1,171 @@
1#ifndef NOUN_H_24A03C83
2#define NOUN_H_24A03C83
3
4namespace verbly {
5
6 class noun : public word {
7 private:
8 std::string _singular;
9 std::string _plural;
10
11 friend class noun_query;
12
13 public:
14 noun(const data& _data, int _id);
15
16 std::string base_form() const;
17 std::string singular_form() const;
18 std::string plural_form() const;
19
20 bool has_plural_form() const;
21
22 noun_query hypernyms() const;
23 noun_query hyponyms() const;
24 noun_query part_meronyms() const;
25 noun_query part_holonyms() const;
26 noun_query substance_meronyms() const;
27 noun_query substance_holonyms() const;
28 noun_query member_meronyms() const;
29 noun_query member_holonyms() const;
30 noun_query classes() const;
31 noun_query instances() const;
32 noun_query synonyms() const;
33 noun_query antonyms() const;
34 adjective_query pertainyms() const;
35 adjective_query variations() const;
36 };
37
38 class noun_query {
39 public:
40 noun_query(const data& _data);
41
42 noun_query& limit(int _limit);
43 noun_query& random(bool _random);
44 noun_query& except(const noun& _word);
45 noun_query& rhymes_with(const word& _word);
46 noun_query& has_pronunciation(bool _has_prn);
47
48 noun_query& is_hypernym(bool _arg);
49 noun_query& hypernym_of(const noun& _noun);
50 noun_query& not_hypernym_of(const noun& _noun);
51
52 noun_query& is_hyponym(bool _arg);
53 noun_query& hyponym_of(const noun& _noun);
54 noun_query& not_hyponym_of(const noun& _noun);
55
56 noun_query& is_part_meronym(bool _arg);
57 noun_query& part_meronym_of(const noun& _noun);
58 noun_query& not_part_meronym_of(const noun& _noun);
59
60 noun_query& is_part_holonym(bool _arg);
61 noun_query& part_holonym_of(const noun& _noun);
62 noun_query& not_part_holonym_of(const noun& _noun);
63
64 noun_query& is_substance_meronym(bool _arg);
65 noun_query& substance_meronym_of(const noun& _noun);
66 noun_query& not_substance_meronym_of(const noun& _noun);
67
68 noun_query& is_substance_holonym(bool _arg);
69 noun_query& substance_holonym_of(const noun& _noun);
70 noun_query& not_substance_holonym_of(const noun& _noun);
71
72 noun_query& is_member_meronym(bool _arg);
73 noun_query& member_meronym_of(const noun& _noun);
74 noun_query& not_member_meronym_of(const noun& _noun);
75
76 noun_query& is_member_holonym(bool _arg);
77 noun_query& member_holonym_of(const noun& _noun);
78 noun_query& not_member_holonym_of(const noun& _noun);
79
80 noun_query& is_proper(bool _arg);
81 noun_query& instance_of(const noun& _noun);
82 noun_query& not_instance_of(const noun& _noun);
83
84 noun_query& is_class(bool _arg);
85 noun_query& class_of(const noun& _noun);
86 noun_query& not_class_of(const noun& _noun);
87
88 noun_query& has_synonyms(bool _arg);
89 noun_query& synonym_of(const noun& _noun);
90 noun_query& not_synonym_of(const noun& _noun);
91
92 noun_query& has_antonyms(bool _arg);
93 noun_query& antonym_of(const noun& _noun);
94 noun_query& not_antonym_of(const noun& _noun);
95
96 noun_query& has_pertainym(bool _arg);
97 noun_query& anti_pertainym_of(const adjective& _adj);
98
99 noun_query& is_attribute(bool _arg);
100 noun_query& attribute_of(const adjective& _adj);
101
102 std::list<noun> run() const;
103
104 const static int unlimited = -1;
105
106 private:
107 const data& _data;
108 int _limit = unlimited;
109 bool _random = false;
110 std::list<std::string> _rhymes;
111 std::list<noun> _except;
112 bool _has_prn = false;
113
114 bool _is_hypernym = false;
115 std::list<noun> _hypernym_of;
116 std::list<noun> _not_hypernym_of;
117
118 bool _is_hyponym = false;
119 std::list<noun> _hyponym_of;
120 std::list<noun> _not_hyponym_of;
121
122 bool _is_part_meronym = false;
123 std::list<noun> _part_meronym_of;
124 std::list<noun> _not_part_meronym_of;
125
126 bool _is_substance_meronym = false;
127 std::list<noun> _substance_meronym_of;
128 std::list<noun> _not_substance_meronym_of;
129
130 bool _is_member_meronym = false;
131 std::list<noun> _member_meronym_of;
132 std::list<noun> _not_member_meronym_of;
133
134 bool _is_part_holonym = false;
135 std::list<noun> _part_holonym_of;
136 std::list<noun> _not_part_holonym_of;
137
138 bool _is_substance_holonym = false;
139 std::list<noun> _substance_holonym_of;
140 std::list<noun> _not_substance_holonym_of;
141
142 bool _is_member_holonym = false;
143 std::list<noun> _member_holonym_of;
144 std::list<noun> _not_member_holonym_of;
145
146 bool _is_proper = false;
147 std::list<noun> _instance_of;
148 std::list<noun> _not_instance_of;
149
150 bool _is_class = false;
151 std::list<noun> _class_of;
152 std::list<noun> _not_class_of;
153
154 bool _has_synonyms = false;
155 std::list<noun> _synonym_of;
156 std::list<noun> _not_synonym_of;
157
158 bool _has_antonyms = false;
159 std::list<noun> _antonym_of;
160 std::list<noun> _not_antonym_of;
161
162 bool _has_pertainym = false;
163 std::list<adjective> _anti_pertainym_of;
164
165 bool _is_attribute = false;
166 std::list<adjective> _attribute_of;
167 };
168
169};
170
171#endif /* end of include guard: NOUN_H_24A03C83 */