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/word.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/word.cpp') diff --git a/lib/word.cpp b/lib/word.cpp index 15af150..13c611f 100644 --- a/lib/word.cpp +++ b/lib/word.cpp @@ -3,13 +3,20 @@ namespace verbly { - word::word(const data& _data, int _id) : _data(_data), _id(_id) + word::word() + { + + } + + word::word(const data& _data, int _id) : _data(&_data), _id(_id), _valid(true) { } std::list word::rhyme_phonemes() const { + assert(_valid == true); + std::list result; for (auto pronunciation : pronunciations) @@ -32,6 +39,8 @@ namespace verbly { bool word::starts_with_vowel_sound() const { + assert(_valid == true); + if (pronunciations.size() > 0) { return std::any_of(std::begin(pronunciations), std::end(pronunciations), [] (std::list phonemes) { -- cgit 1.4.1