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/verb.h | 45 +++------------------------------------------ 1 file changed, 3 insertions(+), 42 deletions(-) (limited to 'lib/verb.h') diff --git a/lib/verb.h b/lib/verb.h index 7cc87e2..7a2486e 100644 --- a/lib/verb.h +++ b/lib/verb.h @@ -3,26 +3,7 @@ namespace verbly { - /*class frame_part { - - }; - - class frame { - private: - std::list content; - std::map::iterator>> predicates; - - public: - frame(std::list content) : content(content) - { - - } - - std::unique_ptr make_utterance() const - { - - } - };*/ + class frame_query; class verb : public word { private: @@ -35,6 +16,7 @@ namespace verbly { friend class verb_query; public: + verb(); verb(const data& _data, int _id); std::string base_form() const; @@ -43,29 +25,8 @@ namespace verbly { std::string past_participle_form() const; std::string ing_form() const; std::string s_form() const; - }; - - class verb_query { - public: - verb_query(const data& _data); - - verb_query& limit(int _limit); - verb_query& random(bool _random); - verb_query& except(const verb& _word); - verb_query& rhymes_with(const word& _word); - verb_query& has_pronunciation(bool _has_prn); - 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; + frame_query frames() const; }; }; -- cgit 1.4.1