From 8b1333d0e6e2b9a5014bdbff2987d899f5413fee Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 16 Mar 2016 21:35:35 -0400 Subject: Added word derivational relationships (kind of eh at the moment) and moved verbly into its own directory --- verbly/lib/data.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 verbly/lib/data.cpp (limited to 'verbly/lib/data.cpp') diff --git a/verbly/lib/data.cpp b/verbly/lib/data.cpp new file mode 100644 index 0000000..57a8850 --- /dev/null +++ b/verbly/lib/data.cpp @@ -0,0 +1,50 @@ +#include "verbly.h" + +namespace verbly { + + data::data(std::string datafile) + { + if (sqlite3_open_v2(datafile.c_str(), &ppdb, SQLITE_OPEN_READONLY, NULL) != SQLITE_OK) + { + throw std::invalid_argument(sqlite3_errmsg(ppdb)); + } + } + + data::data(data&& other) + { + ppdb = other.ppdb; + } + + data& data::operator=(data&& other) + { + ppdb = other.ppdb; + + return *this; + } + + data::~data() + { + sqlite3_close_v2(ppdb); + } + + verb_query data::verbs() const + { + return verb_query(*this); + } + + adjective_query data::adjectives() const + { + return adjective_query(*this); + } + + adverb_query data::adverbs() const + { + return adverb_query(*this); + } + + noun_query data::nouns() const + { + return noun_query(*this); + } + +}; -- cgit 1.4.1