diff options
Diffstat (limited to 'lib/form.cpp')
-rw-r--r-- | lib/form.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/form.cpp b/lib/form.cpp index 256dc59..fa72c8a 100644 --- a/lib/form.cpp +++ b/lib/form.cpp | |||
@@ -8,13 +8,14 @@ namespace verbly { | |||
8 | 8 | ||
9 | const object form::objectType = object::form; | 9 | const object form::objectType = object::form; |
10 | 10 | ||
11 | const std::list<std::string> form::select = {"form_id", "form", "complexity", "proper", "length"}; | 11 | const std::list<std::string> form::select = {"form_id", "form", "complexity", "proper", "length", "frequency"}; |
12 | 12 | ||
13 | const field form::id = field::integerField(object::form, "form_id"); | 13 | const field form::id = field::integerField(object::form, "form_id"); |
14 | const field form::text = field::stringField(object::form, "form"); | 14 | const field form::text = field::stringField(object::form, "form"); |
15 | const field form::complexity = field::integerField(object::form, "complexity"); | 15 | const field form::complexity = field::integerField(object::form, "complexity"); |
16 | const field form::proper = field::booleanField(object::form, "proper"); | 16 | const field form::proper = field::booleanField(object::form, "proper"); |
17 | const field form::length = field::integerField(object::form, "length"); | 17 | const field form::length = field::integerField(object::form, "length"); |
18 | const field form::frequency = field::integerField(object::form, "frequency"); | ||
18 | 19 | ||
19 | const field form::pronunciations = field::joinThrough(object::form, "form_id", object::pronunciation, "forms_pronunciations", "pronunciation_id"); | 20 | const field form::pronunciations = field::joinThrough(object::form, "form_id", object::pronunciation, "forms_pronunciations", "pronunciation_id"); |
20 | 21 | ||
@@ -36,6 +37,12 @@ namespace verbly { | |||
36 | proper_ = (std::get<int>(row[3]) == 1); | 37 | proper_ = (std::get<int>(row[3]) == 1); |
37 | length_ = std::get<int>(row[4]); | 38 | length_ = std::get<int>(row[4]); |
38 | 39 | ||
40 | if (!mpark::holds_alternative<std::nullptr_t>(row[5])) | ||
41 | { | ||
42 | hasFreq_ = true; | ||
43 | frequency_ = mpark::get<int>(row[5]); | ||
44 | } | ||
45 | |||
39 | pronunciations_ = db.pronunciations(*this, pronunciation::id, -1).all(); | 46 | pronunciations_ = db.pronunciations(*this, pronunciation::id, -1).all(); |
40 | } | 47 | } |
41 | 48 | ||