diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-03-24 23:16:07 -0400 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-03-24 23:16:07 -0400 |
| commit | eef5de613c75661e5d94baa086f6f2ddc26c7ed0 (patch) | |
| tree | 180230f6a245c5bca94d894273f5d2b93ded3f04 /lib/noun_query.h | |
| parent | d5ee4e39e5b5b3b8daa85cd972802195ad35e965 (diff) | |
| download | verbly-eef5de613c75661e5d94baa086f6f2ddc26c7ed0.tar.gz verbly-eef5de613c75661e5d94baa086f6f2ddc26c7ed0.tar.bz2 verbly-eef5de613c75661e5d94baa086f6f2ddc26c7ed0.zip | |
Added verb frames
In addition: - Added prepositions. - Rewrote a lot of the query interface. It now, for a lot of relationships, supports nested AND, OR, and NOT logic. - Rewrote the token class. It is now a union-like class instead of being polymorphic, which means smart pointers are no longer necessary. - Querying with regards to word derivation has been temporarily removed. - Sentinel values are now supported for all word types. - The VerbNet data retrieved from http://verbs.colorado.edu/~mpalmer/projects/verbnet/downloads.html was found to not be perfectly satisfactory in some regards, especially regarding adjective phrases. A patch file is now included in the repository describing the changes made to the VerbNet v3.2 download for the canonical verbly datafile.
Diffstat (limited to 'lib/noun_query.h')
| -rw-r--r-- | lib/noun_query.h | 139 |
1 files changed, 139 insertions, 0 deletions
| diff --git a/lib/noun_query.h b/lib/noun_query.h new file mode 100644 index 0000000..0c41a68 --- /dev/null +++ b/lib/noun_query.h | |||
| @@ -0,0 +1,139 @@ | |||
| 1 | #ifndef NOUN_QUERY_H_5DE51DD7 | ||
| 2 | #define NOUN_QUERY_H_5DE51DD7 | ||
| 3 | |||
| 4 | namespace 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& has_pronunciation(); | ||
| 15 | |||
| 16 | noun_query& with_singular_form(std::string _arg); | ||
| 17 | |||
| 18 | noun_query& is_hypernym(); | ||
| 19 | noun_query& hypernym_of(filter<noun> _f); | ||
| 20 | noun_query& full_hypernym_of(filter<noun> _f); | ||
| 21 | |||
| 22 | noun_query& is_hyponym(); | ||
| 23 | noun_query& hyponym_of(filter<noun> _f); | ||
| 24 | noun_query& full_hyponym_of(filter<noun> _f); | ||
| 25 | |||
| 26 | noun_query& is_part_meronym(); | ||
| 27 | noun_query& part_meronym_of(filter<noun> _f); | ||
| 28 | |||
| 29 | noun_query& is_part_holonym(); | ||
| 30 | noun_query& part_holonym_of(filter<noun> _f); | ||
| 31 | |||
| 32 | noun_query& is_substance_meronym(); | ||
| 33 | noun_query& substance_meronym_of(filter<noun> _f); | ||
| 34 | |||
| 35 | noun_query& is_substance_holonym(); | ||
| 36 | noun_query& substance_holonym_of(filter<noun> _f); | ||
| 37 | |||
| 38 | noun_query& is_member_meronym(); | ||
| 39 | noun_query& member_meronym_of(filter<noun> _f); | ||
| 40 | |||
| 41 | noun_query& is_member_holonym(); | ||
| 42 | noun_query& member_holonym_of(filter<noun> _f); | ||
| 43 | |||
| 44 | noun_query& is_proper(); | ||
| 45 | noun_query& is_not_proper(); | ||
| 46 | |||
| 47 | noun_query& is_instance(); | ||
| 48 | noun_query& instance_of(filter<noun> _f); | ||
| 49 | |||
| 50 | noun_query& is_class(); | ||
| 51 | noun_query& class_of(filter<noun> _f); | ||
| 52 | |||
| 53 | noun_query& has_synonyms(); | ||
| 54 | noun_query& synonym_of(filter<noun> _f); | ||
| 55 | |||
| 56 | noun_query& has_antonyms(); | ||
| 57 | noun_query& antonym_of(filter<noun> _f); | ||
| 58 | |||
| 59 | noun_query& has_pertainym(); | ||
| 60 | noun_query& anti_pertainym_of(filter<adjective> _f); | ||
| 61 | |||
| 62 | noun_query& is_attribute(); | ||
| 63 | noun_query& attribute_of(filter<adjective> _f); | ||
| 64 | |||
| 65 | /* noun_query& derived_from(const word& _w); | ||
| 66 | noun_query& not_derived_from(const word& _w);*/ | ||
| 67 | |||
| 68 | std::list<noun> run() const; | ||
| 69 | |||
| 70 | const static int unlimited = -1; | ||
| 71 | |||
| 72 | private: | ||
| 73 | const data& _data; | ||
| 74 | int _limit = unlimited; | ||
| 75 | bool _random = false; | ||
| 76 | std::list<std::string> _rhymes; | ||
| 77 | std::list<noun> _except; | ||
| 78 | bool _has_prn = false; | ||
| 79 | |||
| 80 | std::list<std::string> _with_singular_form; | ||
| 81 | |||
| 82 | bool _is_hypernym = false; | ||
| 83 | filter<noun> _hypernym_of; | ||
| 84 | filter<noun> _full_hypernym_of; | ||
| 85 | |||
| 86 | bool _is_hyponym = false; | ||
| 87 | filter<noun> _hyponym_of; | ||
| 88 | filter<noun> _full_hyponym_of; | ||
| 89 | |||
| 90 | bool _is_part_meronym = false; | ||
| 91 | filter<noun> _part_meronym_of; | ||
| 92 | |||
| 93 | bool _is_substance_meronym = false; | ||
| 94 | filter<noun> _substance_meronym_of; | ||
| 95 | |||
| 96 | bool _is_member_meronym = false; | ||
| 97 | filter<noun> _member_meronym_of; | ||
| 98 | |||
| 99 | bool _is_part_holonym = false; | ||
| 100 | filter<noun> _part_holonym_of; | ||
| 101 | |||
| 102 | bool _is_substance_holonym = false; | ||
| 103 | filter<noun> _substance_holonym_of; | ||
| 104 | |||
| 105 | bool _is_member_holonym = false; | ||
| 106 | filter<noun> _member_holonym_of; | ||
| 107 | |||
| 108 | bool _is_proper = false; | ||
| 109 | bool _is_not_proper = false; | ||
| 110 | |||
| 111 | bool _is_instance = false; | ||
| 112 | filter<noun> _instance_of; | ||
| 113 | |||
| 114 | bool _is_class = false; | ||
| 115 | filter<noun> _class_of; | ||
| 116 | |||
| 117 | bool _has_synonyms = false; | ||
| 118 | filter<noun> _synonym_of; | ||
| 119 | |||
| 120 | bool _has_antonyms = false; | ||
| 121 | filter<noun> _antonym_of; | ||
| 122 | |||
| 123 | bool _has_pertainym = false; | ||
| 124 | filter<adjective> _anti_pertainym_of; | ||
| 125 | |||
| 126 | bool _is_attribute = false; | ||
| 127 | filter<adjective> _attribute_of; | ||
| 128 | |||
| 129 | /* std::list<adjective> _derived_from_adjective; | ||
| 130 | std::list<adjective> _not_derived_from_adjective; | ||
| 131 | std::list<adverb> _derived_from_adverb; | ||
| 132 | std::list<adverb> _not_derived_from_adverb; | ||
| 133 | std::list<noun> _derived_from_noun; | ||
| 134 | std::list<noun> _not_derived_from_noun;*/ | ||
| 135 | }; | ||
| 136 | |||
| 137 | }; | ||
| 138 | |||
| 139 | #endif /* end of include guard: NOUN_QUERY_H_5DE51DD7 */ | ||
