summary refs log tree commit diff stats
path: root/lib/noun_query.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-01-16 18:02:50 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-01-16 18:02:50 -0500
commit6746da6edd7d9d50efe374eabbb79a3cac882d81 (patch)
treeff20917e08b08d36b9541c1371106596e7bec442 /lib/noun_query.h
parent4af7e55733098ca42f75a4ffaca1b0f6bab4dd36 (diff)
downloadverbly-6746da6edd7d9d50efe374eabbb79a3cac882d81.tar.gz
verbly-6746da6edd7d9d50efe374eabbb79a3cac882d81.tar.bz2
verbly-6746da6edd7d9d50efe374eabbb79a3cac882d81.zip
Started structural rewrite
The new object structure was designed to build on the existing WordNet
structure, while also adding in all of the data that we get from other sources.
More information about this can be found on the project wiki.

The generator has already been completely rewritten to generate a
datafile that uses the new structure. In addition, a number of indexes
are created, which does double the size of the datafile, but also allows
for much faster lookups. Finally, the new generator is written modularly
and is a lot more readable than the old one.

The verbly interface to the new object structure has mostly been
completed, but has not been tested fully. There is a completely new
search API which utilizes a lot of operator overloading; documentation
on how to use it should go up at some point.

Token processing and verb frames are currently unimplemented. Source for
these have been left in the repository for now.
Diffstat (limited to 'lib/noun_query.h')
-rw-r--r--lib/noun_query.h180
1 files changed, 0 insertions, 180 deletions
diff --git a/lib/noun_query.h b/lib/noun_query.h deleted file mode 100644 index 74df260..0000000 --- a/lib/noun_query.h +++ /dev/null
@@ -1,180 +0,0 @@
1#ifndef NOUN_QUERY_H_5DE51DD7
2#define NOUN_QUERY_H_5DE51DD7
3
4namespace verbly {
5
6 class noun_query {
7 public:
8 noun_query(const data& _data);
9
10 noun_query& limit(int _limit);
11 noun_query& random();
12 noun_query& except(const noun& _word);
13 noun_query& rhymes_with(const word& _word);
14 noun_query& rhymes_with(rhyme _r);
15 noun_query& has_pronunciation();
16 noun_query& has_rhyming_noun();
17 noun_query& has_rhyming_adjective();
18 noun_query& has_rhyming_adverb();
19 noun_query& has_rhyming_verb();
20 noun_query& with_stress(filter<std::vector<bool>> _arg);
21
22 noun_query& with_singular_form(std::string _arg);
23 noun_query& with_prefix(filter<std::string> _f);
24 noun_query& with_suffix(filter<std::string> _f);
25
26 noun_query& requires_plural_form();
27
28 noun_query& with_complexity(int _arg);
29
30 noun_query& is_hypernym();
31 noun_query& hypernym_of(filter<noun> _f);
32 noun_query& full_hypernym_of(filter<noun> _f);
33
34 noun_query& is_hyponym();
35 noun_query& hyponym_of(filter<noun> _f);
36 noun_query& full_hyponym_of(filter<noun> _f);
37
38 noun_query& is_part_meronym();
39 noun_query& part_meronym_of(filter<noun> _f);
40 noun_query& full_part_meronym_of(filter<noun> _f);
41
42 noun_query& is_part_holonym();
43 noun_query& part_holonym_of(filter<noun> _f);
44 noun_query& full_part_holonym_of(filter<noun> _f);
45
46 noun_query& is_substance_meronym();
47 noun_query& substance_meronym_of(filter<noun> _f);
48 noun_query& full_substance_meronym_of(filter<noun> _f);
49
50 noun_query& is_substance_holonym();
51 noun_query& substance_holonym_of(filter<noun> _f);
52 noun_query& full_substance_holonym_of(filter<noun> _f);
53
54 noun_query& is_member_meronym();
55 noun_query& member_meronym_of(filter<noun> _f);
56 noun_query& full_member_meronym_of(filter<noun> _f);
57
58 noun_query& is_member_holonym();
59 noun_query& member_holonym_of(filter<noun> _f);
60 noun_query& full_member_holonym_of(filter<noun> _f);
61
62 noun_query& is_proper();
63 noun_query& is_not_proper();
64
65 noun_query& is_instance();
66 noun_query& instance_of(filter<noun> _f);
67
68 noun_query& is_class();
69 noun_query& class_of(filter<noun> _f);
70
71 noun_query& has_synonyms();
72 noun_query& synonym_of(filter<noun> _f);
73
74 noun_query& has_antonyms();
75 noun_query& antonym_of(filter<noun> _f);
76
77 noun_query& has_pertainym();
78 noun_query& anti_pertainym_of(filter<adjective> _f);
79
80 noun_query& is_attribute();
81 noun_query& attribute_of(filter<adjective> _f);
82
83 noun_query& at_least_n_images(int _arg);
84 noun_query& with_wnid(int _arg);
85
86/* noun_query& derived_from(const word& _w);
87 noun_query& not_derived_from(const word& _w);*/
88
89 std::list<noun> run() const;
90
91 const static int unlimited = -1;
92
93 private:
94 const data& _data;
95 int _limit = unlimited;
96 bool _random = false;
97 std::list<rhyme> _rhymes;
98 std::list<noun> _except;
99 bool _has_prn = false;
100 bool _has_rhyming_noun = false;
101 bool _has_rhyming_adjective = false;
102 bool _has_rhyming_adverb = false;
103 bool _has_rhyming_verb = false;
104 filter<std::vector<bool>> _stress;
105
106 std::list<std::string> _with_singular_form;
107 filter<std::string> _with_prefix;
108 filter<std::string> _with_suffix;
109
110 int _with_complexity = unlimited;
111
112 bool _requires_plural_form = false;
113
114 bool _is_hypernym = false;
115 filter<noun> _hypernym_of;
116 filter<noun> _full_hypernym_of;
117
118 bool _is_hyponym = false;
119 filter<noun> _hyponym_of;
120 filter<noun> _full_hyponym_of;
121
122 bool _is_part_meronym = false;
123 filter<noun> _part_meronym_of;
124 filter<noun> _full_part_meronym_of;
125
126 bool _is_substance_meronym = false;
127 filter<noun> _substance_meronym_of;
128 filter<noun> _full_substance_meronym_of;
129
130 bool _is_member_meronym = false;
131 filter<noun> _member_meronym_of;
132 filter<noun> _full_member_meronym_of;
133
134 bool _is_part_holonym = false;
135 filter<noun> _part_holonym_of;
136 filter<noun> _full_part_holonym_of;
137
138 bool _is_substance_holonym = false;
139 filter<noun> _substance_holonym_of;
140 filter<noun> _full_substance_holonym_of;
141
142 bool _is_member_holonym = false;
143 filter<noun> _member_holonym_of;
144 filter<noun> _full_member_holonym_of;
145
146 bool _is_proper = false;
147 bool _is_not_proper = false;
148
149 bool _is_instance = false;
150 filter<noun> _instance_of;
151
152 bool _is_class = false;
153 filter<noun> _class_of;
154
155 bool _has_synonyms = false;
156 filter<noun> _synonym_of;
157
158 bool _has_antonyms = false;
159 filter<noun> _antonym_of;
160
161 bool _has_pertainym = false;
162 filter<adjective> _anti_pertainym_of;
163
164 bool _is_attribute = false;
165 filter<adjective> _attribute_of;
166
167 int _at_least_n_images = unlimited;
168 std::set<int> _with_wnid;
169
170/* std::list<adjective> _derived_from_adjective;
171 std::list<adjective> _not_derived_from_adjective;
172 std::list<adverb> _derived_from_adverb;
173 std::list<adverb> _not_derived_from_adverb;
174 std::list<noun> _derived_from_noun;
175 std::list<noun> _not_derived_from_noun;*/
176 };
177
178};
179
180#endif /* end of include guard: NOUN_QUERY_H_5DE51DD7 */