summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2022-12-08 15:03:51 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2022-12-08 15:03:51 -0500
commit7ea3569e3894f19fbae6cfdb3406f2240570e3c1 (patch)
treee04caa4058baa9f0a9ff46771eef903be49ce3cb /lib
parent6816abc1e89fd955524d7c772477d6483d12cbf9 (diff)
downloadverbly-7ea3569e3894f19fbae6cfdb3406f2240570e3c1.tar.gz
verbly-7ea3569e3894f19fbae6cfdb3406f2240570e3c1.tar.bz2
verbly-7ea3569e3894f19fbae6cfdb3406f2240570e3c1.zip
Added a bunch of stuff for making LINGO puzzles
Diffstat (limited to 'lib')
-rw-r--r--lib/field.cpp5
-rw-r--r--lib/form.cpp5
-rw-r--r--lib/form.h5
-rw-r--r--lib/pronunciation.cpp5
-rw-r--r--lib/pronunciation.h5
-rw-r--r--lib/query.h2
-rw-r--r--lib/version.h2
7 files changed, 26 insertions, 3 deletions
diff --git a/lib/field.cpp b/lib/field.cpp index ad6d958..4b7fff6 100644 --- a/lib/field.cpp +++ b/lib/field.cpp
@@ -110,7 +110,10 @@ namespace verbly {
110 110
111 field::operator filter() const 111 field::operator filter() const
112 { 112 {
113 if (isJoin()) 113 if (type_ == type::hierarchal_join)
114 {
115 return filter(*this, filter::comparison::hierarchally_matches, filter());
116 } else if (isJoin())
114 { 117 {
115 return filter(*this, filter::comparison::matches, filter()); 118 return filter(*this, filter::comparison::matches, filter());
116 } else { 119 } else {
diff --git a/lib/form.cpp b/lib/form.cpp index 4983274..b5348cb 100644 --- a/lib/form.cpp +++ b/lib/form.cpp
@@ -18,6 +18,11 @@ namespace verbly {
18 18
19 const field form::pronunciations = field::joinThrough(object::form, "form_id", object::pronunciation, "forms_pronunciations", "pronunciation_id"); 19 const field form::pronunciations = field::joinThrough(object::form, "form_id", object::pronunciation, "forms_pronunciations", "pronunciation_id");
20 20
21 const field form::anagrams = field::joinField(object::form, "anagram_set_id", object::form);
22
23 const field form::merographs = field::selfJoin(object::form, "form_id", "merography", "holograph_id", "merograph_id");
24 const field form::holographs = field::selfJoin(object::form, "form_id", "merography", "merograph_id", "holograph_id");
25
21 field form::words(inflection category) 26 field form::words(inflection category)
22 { 27 {
23 return field::joinThroughWhere(object::form, "form_id", object::word, "lemmas_forms", "lemma_id", "category", static_cast<int>(category)); 28 return field::joinThroughWhere(object::form, "form_id", object::word, "lemmas_forms", "lemma_id", "category", static_cast<int>(category));
diff --git a/lib/form.h b/lib/form.h index b365943..39f53aa 100644 --- a/lib/form.h +++ b/lib/form.h
@@ -136,6 +136,11 @@ namespace verbly {
136 136
137 static const field pronunciations; 137 static const field pronunciations;
138 138
139 static const field anagrams;
140
141 static const field merographs;
142 static const field holographs;
143
139 private: 144 private:
140 145
141 bool valid_ = false; 146 bool valid_ = false;
diff --git a/lib/pronunciation.cpp b/lib/pronunciation.cpp index 3aef815..093e11a 100644 --- a/lib/pronunciation.cpp +++ b/lib/pronunciation.cpp
@@ -18,6 +18,11 @@ namespace verbly {
18 const field pronunciation::prerhyme = field::stringField(object::pronunciation, "prerhyme", true); 18 const field pronunciation::prerhyme = field::stringField(object::pronunciation, "prerhyme", true);
19 const field pronunciation::rhyme = field::stringField(object::pronunciation, "rhyme", true); 19 const field pronunciation::rhyme = field::stringField(object::pronunciation, "rhyme", true);
20 20
21 const field pronunciation::anaphones = field::joinField(object::pronunciation, "anaphone_set_id", object::pronunciation);
22
23 const field pronunciation::merophones = field::selfJoin(object::pronunciation, "pronunciation_id", "merophony", "holophone_id", "merophone_id");
24 const field pronunciation::holophones = field::selfJoin(object::pronunciation, "pronunciation_id", "merophony", "merophone_id", "holophone_id");
25
21 const field pronunciation::rhymes_field::rhymeJoin = field::joinField(object::pronunciation, "rhyme", object::pronunciation); 26 const field pronunciation::rhymes_field::rhymeJoin = field::joinField(object::pronunciation, "rhyme", object::pronunciation);
22 const pronunciation::rhymes_field pronunciation::rhymes = {}; 27 const pronunciation::rhymes_field pronunciation::rhymes = {};
23 28
diff --git a/lib/pronunciation.h b/lib/pronunciation.h index cd241bd..210d61d 100644 --- a/lib/pronunciation.h +++ b/lib/pronunciation.h
@@ -148,6 +148,11 @@ namespace verbly {
148 148
149 static const field forms; 149 static const field forms;
150 150
151 static const field anaphones;
152
153 static const field merophones;
154 static const field holophones;
155
151 // Rhyming relationship 156 // Rhyming relationship
152 157
153 class rhymes_field { 158 class rhymes_field {
diff --git a/lib/query.h b/lib/query.h index 65b4e9d..09d7f1f 100644 --- a/lib/query.h +++ b/lib/query.h
@@ -43,9 +43,9 @@ namespace verbly {
43 } 43 }
44 44
45 statement stmt(Object::objectType, std::move(queryFilter)); 45 statement stmt(Object::objectType, std::move(queryFilter));
46
47 queryString_ = 46 queryString_ =
48 stmt.getQueryString(Object::select, std::move(sortOrder), limit); 47 stmt.getQueryString(Object::select, std::move(sortOrder), limit);
48
49 49
50 bindings_ = stmt.getBindings(); 50 bindings_ = stmt.getBindings();
51 } 51 }
diff --git a/lib/version.h b/lib/version.h index 0404f5f..4dc5e52 100644 --- a/lib/version.h +++ b/lib/version.h
@@ -4,7 +4,7 @@
4namespace verbly { 4namespace verbly {
5 5
6 const int DATABASE_MAJOR_VERSION = 1; 6 const int DATABASE_MAJOR_VERSION = 1;
7 const int DATABASE_MINOR_VERSION = 1; 7 const int DATABASE_MINOR_VERSION = 3;
8 8
9}; 9};
10 10