summary refs log tree commit diff stats
path: root/data.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-03-16 11:27:16 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-03-16 11:27:16 -0400
commitae5f75965f8202c8478622763a27ef1848a8ed1a (patch)
treefcbe1a05eeec628118bcf32db9135e101e038cd5 /data.cpp
parente5f284e6cf676fb0e712f568e560b5b8661506f4 (diff)
downloadverbly-ae5f75965f8202c8478622763a27ef1848a8ed1a.tar.gz
verbly-ae5f75965f8202c8478622763a27ef1848a8ed1a.tar.bz2
verbly-ae5f75965f8202c8478622763a27ef1848a8ed1a.zip
Added more inflections, word relationships, and pronunciations
Nouns, adjectives, and adverbs now have inflected forms. A large number of WordNet word relationships (all noun-noun relationships, plus synonymy and antonymy for all word types except verbs) have been added. Additionally, CMUDICT is now being used to store word pronunciations for rhyming purposes. Verbly is now also a compiled library rather than being header-only due to the complexity of the query interface.
Diffstat (limited to 'data.cpp')
-rw-r--r--data.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/data.cpp b/data.cpp new file mode 100644 index 0000000..57a8850 --- /dev/null +++ b/data.cpp
@@ -0,0 +1,50 @@
1#include "verbly.h"
2
3namespace verbly {
4
5 data::data(std::string datafile)
6 {
7 if (sqlite3_open_v2(datafile.c_str(), &ppdb, SQLITE_OPEN_READONLY, NULL) != SQLITE_OK)
8 {
9 throw std::invalid_argument(sqlite3_errmsg(ppdb));
10 }
11 }
12
13 data::data(data&& other)
14 {
15 ppdb = other.ppdb;
16 }
17
18 data& data::operator=(data&& other)
19 {
20 ppdb = other.ppdb;
21
22 return *this;
23 }
24
25 data::~data()
26 {
27 sqlite3_close_v2(ppdb);
28 }
29
30 verb_query data::verbs() const
31 {
32 return verb_query(*this);
33 }
34
35 adjective_query data::adjectives() const
36 {
37 return adjective_query(*this);
38 }
39
40 adverb_query data::adverbs() const
41 {
42 return adverb_query(*this);
43 }
44
45 noun_query data::nouns() const
46 {
47 return noun_query(*this);
48 }
49
50};