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.h | 150 ++----------------------------------------------------------- 1 file changed, 4 insertions(+), 146 deletions(-) (limited to 'lib/noun.h') diff --git a/lib/noun.h b/lib/noun.h index fbc2f9e..77601d0 100644 --- a/lib/noun.h +++ b/lib/noun.h @@ -11,6 +11,7 @@ namespace verbly { friend class noun_query; public: + noun(); noun(const data& _data, int _id); std::string base_form() const; @@ -20,7 +21,9 @@ namespace verbly { bool has_plural_form() const; noun_query hypernyms() const; + noun_query full_hypernyms() const; noun_query hyponyms() const; + noun_query full_hyponyms() const; noun_query part_meronyms() const; noun_query part_holonyms() const; noun_query substance_meronyms() const; @@ -33,153 +36,8 @@ namespace verbly { noun_query antonyms() const; adjective_query pertainyms() const; adjective_query variations() const; - }; - - class noun_query { - public: - noun_query(const data& _data); - - noun_query& limit(int _limit); - noun_query& random(bool _random); - noun_query& except(const noun& _word); - noun_query& rhymes_with(const word& _word); - noun_query& has_pronunciation(bool _has_prn); - - noun_query& is_hypernym(bool _arg); - noun_query& hypernym_of(const noun& _noun); - noun_query& not_hypernym_of(const noun& _noun); - - noun_query& is_hyponym(bool _arg); - noun_query& hyponym_of(const noun& _noun); - noun_query& not_hyponym_of(const noun& _noun); - - noun_query& is_part_meronym(bool _arg); - noun_query& part_meronym_of(const noun& _noun); - noun_query& not_part_meronym_of(const noun& _noun); - - noun_query& is_part_holonym(bool _arg); - noun_query& part_holonym_of(const noun& _noun); - noun_query& not_part_holonym_of(const noun& _noun); - - noun_query& is_substance_meronym(bool _arg); - noun_query& substance_meronym_of(const noun& _noun); - noun_query& not_substance_meronym_of(const noun& _noun); - - noun_query& is_substance_holonym(bool _arg); - noun_query& substance_holonym_of(const noun& _noun); - noun_query& not_substance_holonym_of(const noun& _noun); - - noun_query& is_member_meronym(bool _arg); - noun_query& member_meronym_of(const noun& _noun); - noun_query& not_member_meronym_of(const noun& _noun); - - noun_query& is_member_holonym(bool _arg); - noun_query& member_holonym_of(const noun& _noun); - noun_query& not_member_holonym_of(const noun& _noun); - - noun_query& is_proper(bool _arg); - noun_query& is_not_proper(bool _arg); - - noun_query& is_instance(bool _arg); - noun_query& instance_of(const noun& _noun); - noun_query& not_instance_of(const noun& _noun); - - noun_query& is_class(bool _arg); - noun_query& class_of(const noun& _noun); - noun_query& not_class_of(const noun& _noun); - - noun_query& has_synonyms(bool _arg); - noun_query& synonym_of(const noun& _noun); - noun_query& not_synonym_of(const noun& _noun); - - noun_query& has_antonyms(bool _arg); - noun_query& antonym_of(const noun& _noun); - noun_query& not_antonym_of(const noun& _noun); - - noun_query& has_pertainym(bool _arg); - noun_query& anti_pertainym_of(const adjective& _adj); - - noun_query& is_attribute(bool _arg); - noun_query& attribute_of(const adjective& _adj); - - 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; - - bool _is_hypernym = false; - std::list _hypernym_of; - std::list _not_hypernym_of; - - bool _is_hyponym = false; - std::list _hyponym_of; - std::list _not_hyponym_of; - - bool _is_part_meronym = false; - std::list _part_meronym_of; - std::list _not_part_meronym_of; - - bool _is_substance_meronym = false; - std::list _substance_meronym_of; - std::list _not_substance_meronym_of; - - bool _is_member_meronym = false; - std::list _member_meronym_of; - std::list _not_member_meronym_of; - - bool _is_part_holonym = false; - std::list _part_holonym_of; - std::list _not_part_holonym_of; - - bool _is_substance_holonym = false; - std::list _substance_holonym_of; - std::list _not_substance_holonym_of; - - bool _is_member_holonym = false; - std::list _member_holonym_of; - std::list _not_member_holonym_of; - - bool _is_proper = false; - bool _is_not_proper = false; - - bool _is_instance = false; - std::list _instance_of; - std::list _not_instance_of; - - bool _is_class = false; - std::list _class_of; - std::list _not_class_of; - - bool _has_synonyms = false; - std::list _synonym_of; - std::list _not_synonym_of; - - bool _has_antonyms = false; - std::list _antonym_of; - std::list _not_antonym_of; - - bool _has_pertainym = false; - std::list _anti_pertainym_of; - - bool _is_attribute = false; - std::list _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; + bool operator<(const noun& other) const; }; }; -- cgit 1.4.1