From eef5de613c75661e5d94baa086f6f2ddc26c7ed0 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 24 Mar 2016 23:16:07 -0400 Subject: 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. --- lib/noun_query.h | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 lib/noun_query.h (limited to 'lib/noun_query.h') 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 @@ +#ifndef NOUN_QUERY_H_5DE51DD7 +#define NOUN_QUERY_H_5DE51DD7 + +namespace verbly { + + class noun_query { + public: + noun_query(const data& _data); + + noun_query& limit(int _limit); + noun_query& random(); + noun_query& except(const noun& _word); + noun_query& rhymes_with(const word& _word); + noun_query& has_pronunciation(); + + noun_query& with_singular_form(std::string _arg); + + noun_query& is_hypernym(); + noun_query& hypernym_of(filter _f); + noun_query& full_hypernym_of(filter _f); + + noun_query& is_hyponym(); + noun_query& hyponym_of(filter _f); + noun_query& full_hyponym_of(filter _f); + + noun_query& is_part_meronym(); + noun_query& part_meronym_of(filter _f); + + noun_query& is_part_holonym(); + noun_query& part_holonym_of(filter _f); + + noun_query& is_substance_meronym(); + noun_query& substance_meronym_of(filter _f); + + noun_query& is_substance_holonym(); + noun_query& substance_holonym_of(filter _f); + + noun_query& is_member_meronym(); + noun_query& member_meronym_of(filter _f); + + noun_query& is_member_holonym(); + noun_query& member_holonym_of(filter _f); + + noun_query& is_proper(); + noun_query& is_not_proper(); + + noun_query& is_instance(); + noun_query& instance_of(filter _f); + + noun_query& is_class(); + noun_query& class_of(filter _f); + + noun_query& has_synonyms(); + noun_query& synonym_of(filter _f); + + noun_query& has_antonyms(); + noun_query& antonym_of(filter _f); + + noun_query& has_pertainym(); + noun_query& anti_pertainym_of(filter _f); + + noun_query& is_attribute(); + noun_query& attribute_of(filter _f); + +/* noun_query& derived_from(const word& _w); + noun_query& not_derived_from(const word& _w);*/ + + std::list run() const; + + const static int unlimited = -1; + + private: + const data& _data; + int _limit = unlimited; + bool _random = false; + std::list _rhymes; + std::list _except; + bool _has_prn = false; + + std::list _with_singular_form; + + bool _is_hypernym = false; + filter _hypernym_of; + filter _full_hypernym_of; + + bool _is_hyponym = false; + filter _hyponym_of; + filter _full_hyponym_of; + + bool _is_part_meronym = false; + filter _part_meronym_of; + + bool _is_substance_meronym = false; + filter _substance_meronym_of; + + bool _is_member_meronym = false; + filter _member_meronym_of; + + bool _is_part_holonym = false; + filter _part_holonym_of; + + bool _is_substance_holonym = false; + filter _substance_holonym_of; + + bool _is_member_holonym = false; + filter _member_holonym_of; + + bool _is_proper = false; + bool _is_not_proper = false; + + bool _is_instance = false; + filter _instance_of; + + bool _is_class = false; + filter _class_of; + + bool _has_synonyms = false; + filter _synonym_of; + + bool _has_antonyms = false; + filter _antonym_of; + + bool _has_pertainym = false; + filter _anti_pertainym_of; + + bool _is_attribute = false; + filter _attribute_of; + +/* std::list _derived_from_adjective; + std::list _not_derived_from_adjective; + std::list _derived_from_adverb; + std::list _not_derived_from_adverb; + std::list _derived_from_noun; + std::list _not_derived_from_noun;*/ + }; + +}; + +#endif /* end of include guard: NOUN_QUERY_H_5DE51DD7 */ -- cgit 1.4.1