From bea3673ae1b3d19585dec56e96dbcd8a56b96e6d Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 3 Feb 2017 17:02:58 -0500 Subject: Renamed object join fields to prevent conflicts with class names This was not a problem with clang but it caused compilation errors with gcc. --- lib/filter.cpp | 24 ++++++++++++------------ lib/form.cpp | 10 +++++----- lib/form.h | 6 +++--- lib/frame.cpp | 6 +++--- lib/frame.h | 8 ++++---- lib/lemma.cpp | 6 +++--- lib/lemma.h | 6 +++--- lib/notion.cpp | 4 ++-- lib/notion.h | 4 ++-- lib/part.cpp | 4 ++-- lib/part.h | 4 ++-- lib/pronunciation.cpp | 2 +- lib/pronunciation.h | 2 +- lib/word.cpp | 6 +++--- lib/word.h | 12 ++++++------ 15 files changed, 52 insertions(+), 52 deletions(-) diff --git a/lib/filter.cpp b/lib/filter.cpp index ab46df2..ecff8ac 100644 --- a/lib/filter.cpp +++ b/lib/filter.cpp @@ -1115,7 +1115,7 @@ namespace verbly { case object::form: case object::pronunciation: { - return (verbly::notion::word %= *this); + return (verbly::notion::words %= *this); } } } @@ -1126,7 +1126,7 @@ namespace verbly { { case object::notion: { - return (verbly::word::notion %= *this); + return (verbly::word::notions %= *this); } case object::undefined: @@ -1138,14 +1138,14 @@ namespace verbly { case object::frame: case object::part: { - return (verbly::word::frame %= *this); + return (verbly::word::frames %= *this); } case object::lemma: case object::form: case object::pronunciation: { - return (verbly::word::lemma %= *this); + return (verbly::word::lemmas %= *this); } } @@ -1165,12 +1165,12 @@ namespace verbly { case object::form: case object::pronunciation: { - return (verbly::frame::word %= *this); + return (verbly::frame::words %= *this); } case object::part: { - return (verbly::frame::part() %= *this); + return (verbly::frame::parts() %= *this); } } } @@ -1192,7 +1192,7 @@ namespace verbly { case object::form: case object::pronunciation: { - return (verbly::part::frame %= *this); + return (verbly::part::frames %= *this); } } } @@ -1206,7 +1206,7 @@ namespace verbly { case object::frame: case object::part: { - return verbly::lemma::word %= *this; + return verbly::lemma::words %= *this; } case object::undefined: @@ -1218,7 +1218,7 @@ namespace verbly { case object::form: case object::pronunciation: { - return (verbly::lemma::form(inflection::base) %= *this); + return (verbly::lemma::forms(inflection::base) %= *this); } } } @@ -1233,7 +1233,7 @@ namespace verbly { case object::part: case object::lemma: { - return verbly::form::lemma %= *this; + return verbly::form::lemmas %= *this; } case object::undefined: @@ -1244,7 +1244,7 @@ namespace verbly { case object::pronunciation: { - return (verbly::form::pronunciation %= *this); + return (verbly::form::pronunciations %= *this); } } } @@ -1260,7 +1260,7 @@ namespace verbly { case object::lemma: case object::form: { - return verbly::pronunciation::form %= *this; + return verbly::pronunciation::forms %= *this; } case object::undefined: diff --git a/lib/form.cpp b/lib/form.cpp index 4811f14..fe7d104 100644 --- a/lib/form.cpp +++ b/lib/form.cpp @@ -16,8 +16,8 @@ namespace verbly { const field form::complexity = field::integerField(object::form, "complexity"); const field form::proper = field::booleanField(object::form, "proper"); - const field form::lemma = field::joinField(object::form, "form_id", object::lemma); - const field form::pronunciation = field::joinThrough(object::form, "form_id", object::pronunciation, "forms_pronunciations", "pronunciation_id"); + const field form::lemmas = field::joinField(object::form, "form_id", object::lemma); + const field form::pronunciations = field::joinThrough(object::form, "form_id", object::pronunciation, "forms_pronunciations", "pronunciation_id"); form::form(const database& db, sqlite3_stmt* row) : db_(&db), valid_(true) { @@ -36,7 +36,7 @@ namespace verbly { if (!initializedPronunciations_) { - pronunciations_ = db_->pronunciations(pronunciation::form %= *this, verbly::pronunciation::id, -1).all(); + pronunciations_ = db_->pronunciations(pronunciation::forms %= *this, pronunciation::id, -1).all(); initializedPronunciations_ = true; } @@ -50,10 +50,10 @@ namespace verbly { throw std::domain_error("Bad access to uninitialized form"); } - const std::vector& pronunciations = getPronunciations(); + const std::vector& pronunciations = getPronunciations(); if (!pronunciations.empty()) { - return std::any_of(std::begin(pronunciations), std::end(pronunciations), [] (const verbly::pronunciation& p) { + return std::any_of(std::begin(pronunciations), std::end(pronunciations), [] (const pronunciation& p) { return p.getPhonemes().front().find_first_of("012") != std::string::npos; }); } else { diff --git a/lib/form.h b/lib/form.h index cf64117..a05d015 100644 --- a/lib/form.h +++ b/lib/form.h @@ -104,9 +104,9 @@ namespace verbly { // Relationships to other objects - static const field lemma; + static const field lemmas; - static const field pronunciation; + static const field pronunciations; private: bool valid_ = false; @@ -119,7 +119,7 @@ namespace verbly { const database* db_; mutable bool initializedPronunciations_ = false; - mutable std::vector pronunciations_; + mutable std::vector pronunciations_; }; diff --git a/lib/frame.cpp b/lib/frame.cpp index a73fbda..b5ba914 100644 --- a/lib/frame.cpp +++ b/lib/frame.cpp @@ -12,14 +12,14 @@ namespace verbly { const field frame::id = field::integerField(object::frame, "frame_id"); const field frame::length = field::integerField(object::frame, "length"); - const field frame::word = field::joinField(object::frame, "group_id", object::word); + const field frame::words = field::joinField(object::frame, "group_id", object::word); - field frame::part() + field frame::parts() { return field::joinField(object::frame, "frame_id", object::part); } - field frame::part(int index) + field frame::parts(int index) { return field::joinWhere(object::frame, "frame_id", object::part, part::index, index); } diff --git a/lib/frame.h b/lib/frame.h index 36e179e..e049584 100644 --- a/lib/frame.h +++ b/lib/frame.h @@ -85,10 +85,10 @@ namespace verbly { // Relationships to other objects - static const field word; + static const field words; - static field part(); - static field part(int index); + static field parts(); + static field parts(int index); private: bool valid_ = false; @@ -96,7 +96,7 @@ namespace verbly { int id_; int groupId_; int length_; - std::vector parts_; + std::vector parts_; const database* db_; diff --git a/lib/lemma.cpp b/lib/lemma.cpp index 0c6e99e..ea7b0ea 100644 --- a/lib/lemma.cpp +++ b/lib/lemma.cpp @@ -12,9 +12,9 @@ namespace verbly { const field lemma::id = field::integerField(object::lemma, "lemma_id"); const field lemma::inflectionCategory = field::integerField(object::lemma, "category"); - const field lemma::word = field::joinField(object::lemma, "lemma_id", object::word); + const field lemma::words = field::joinField(object::lemma, "lemma_id", object::word); - field lemma::form(inflection category) + field lemma::forms(inflection category) { return field::joinWhere(object::lemma, "form_id", object::form, inflectionCategory, static_cast(category)); } @@ -61,7 +61,7 @@ namespace verbly { void lemma::initializeForm(inflection infl) const { - forms_[infl] = db_->forms(form::lemma %= ((inflectionCategory == infl) && *this), verbly::form::id, -1).all(); + forms_[infl] = db_->forms(form::lemmas %= ((inflectionCategory == infl) && *this), verbly::form::id, -1).all(); } }; diff --git a/lib/lemma.h b/lib/lemma.h index 56cfc56..bba5572 100644 --- a/lib/lemma.h +++ b/lib/lemma.h @@ -72,9 +72,9 @@ namespace verbly { // Relationships to other objects - static const field word; + static const field words; - static field form(inflection category); + static field forms(inflection category); private: @@ -84,7 +84,7 @@ namespace verbly { int id_; - mutable std::map> forms_; + mutable std::map> forms_; const database* db_; diff --git a/lib/notion.cpp b/lib/notion.cpp index c8a8b47..e8cc616 100644 --- a/lib/notion.cpp +++ b/lib/notion.cpp @@ -13,7 +13,7 @@ namespace verbly { const field notion::wnid = field::integerField(object::notion, "wnid", true); const field notion::numOfImages = field::integerField(object::notion, "images", true); - const field notion::word = field::joinField(object::notion, "word_id", object::word); + const field notion::words = field::joinField(object::notion, "word_id", object::word); const field notion::hypernyms = field::selfJoin(object::notion, "notion_id", "hypernymy", "hyponym_id", "hypernym_id"); const field notion::hyponyms = field::selfJoin(object::notion, "notion_id", "hypernymy", "hypernym_id", "hyponym_id"); @@ -53,7 +53,7 @@ namespace verbly { const field notion::causes = field::selfJoin(object::notion, "notion_id", "causality", "effect_id", "cause_id"); const field notion::effects = field::selfJoin(object::notion, "notion_id", "causality", "cause_id", "effect_id"); - const notion::preposition_group_field notion::prepositionGroup = {}; + const notion::preposition_group_field notion::prepositionGroups = {}; const field notion::preposition_group_field::isA = field::joinField(object::notion, "notion_id", "is_a"); const field notion::preposition_group_field::groupNameField = field::stringField("is_a", "groupname"); diff --git a/lib/notion.h b/lib/notion.h index a180d73..4fd3396 100644 --- a/lib/notion.h +++ b/lib/notion.h @@ -124,7 +124,7 @@ namespace verbly { // Relationships with other objects - static const field word; + static const field words; // Relationships with self @@ -179,7 +179,7 @@ namespace verbly { static const field groupNameField; }; - static const preposition_group_field prepositionGroup; + static const preposition_group_field prepositionGroups; private: bool valid_ = false; diff --git a/lib/part.cpp b/lib/part.cpp index 1fbb24d..cbd951b 100644 --- a/lib/part.cpp +++ b/lib/part.cpp @@ -15,12 +15,12 @@ namespace verbly { const field part::role = field::stringField(object::part, "role", true); - const field part::frame = field::joinField(object::part, "frame_id", object::frame); + const field part::frames = field::joinField(object::part, "frame_id", object::frame); const field part::synrestr_field::synrestrJoin = field::joinField(object::part, "part_id", "synrestrs"); const field part::synrestr_field::synrestrField = field::stringField("synrestrs", "synrestr"); - const part::synrestr_field part::synrestr = {}; + const part::synrestr_field part::synrestrs = {}; part part::createNounPhrase(std::string role, selrestr selrestrs, std::set synrestrs) { diff --git a/lib/part.h b/lib/part.h index 9a01312..7180f57 100644 --- a/lib/part.h +++ b/lib/part.h @@ -108,7 +108,7 @@ namespace verbly { // Relationships to other objects - static const field frame; + static const field frames; // Noun synrestr relationship @@ -123,7 +123,7 @@ namespace verbly { static const field synrestrField; }; - static const synrestr_field synrestr; + static const synrestr_field synrestrs; private: diff --git a/lib/pronunciation.cpp b/lib/pronunciation.cpp index e937ba6..3ddb1c5 100644 --- a/lib/pronunciation.cpp +++ b/lib/pronunciation.cpp @@ -15,7 +15,7 @@ namespace verbly { const field pronunciation::numOfSyllables = field::integerField(object::pronunciation, "syllables"); const field pronunciation::stress = field::stringField(object::pronunciation, "stress"); - const field pronunciation::form = field::joinThrough(object::pronunciation, "pronunciation_id", object::form, "forms_pronunciations", "form_id"); + const field pronunciation::forms = field::joinThrough(object::pronunciation, "pronunciation_id", object::form, "forms_pronunciations", "form_id"); const field pronunciation::prerhyme = field::stringField(object::pronunciation, "prerhyme", true); const field pronunciation::rhyme = field::stringField(object::pronunciation, "rhyme", true); diff --git a/lib/pronunciation.h b/lib/pronunciation.h index c7a1d4d..e171fe8 100644 --- a/lib/pronunciation.h +++ b/lib/pronunciation.h @@ -138,7 +138,7 @@ namespace verbly { // Relationships to other objects - static const field form; + static const field forms; private: bool valid_ = false; diff --git a/lib/word.cpp b/lib/word.cpp index 90eab1d..d75159c 100644 --- a/lib/word.cpp +++ b/lib/word.cpp @@ -15,9 +15,9 @@ namespace verbly { const field word::tagCount = field::integerField(object::word, "tag_count", true); const field word::adjectivePosition = field::integerField(object::word, "position", true); - const field word::notion = field::joinField(object::word, "notion_id", object::notion); - const field word::lemma = field::joinField(object::word, "lemma_id", object::lemma); - const field word::frame = field::joinField(object::word, "group_id", object::frame, true); + const field word::notions = field::joinField(object::word, "notion_id", object::notion); + const field word::lemmas = field::joinField(object::word, "lemma_id", object::lemma); + const field word::frames = field::joinField(object::word, "group_id", object::frame, true); const field word::antonyms = field::selfJoin(object::word, "word_id", "antonymy", "antonym_2_id", "antonym_1_id"); diff --git a/lib/word.h b/lib/word.h index 8a333a4..864cee1 100644 --- a/lib/word.h +++ b/lib/word.h @@ -126,9 +126,9 @@ namespace verbly { // Relationships with other objects - static const field notion; - static const field lemma; - static const field frame; + static const field notions; + static const field lemmas; + static const field frames; // Relationships with self @@ -169,11 +169,11 @@ namespace verbly { const database* db_; - mutable class notion notion_; - mutable class lemma lemma_; + mutable notion notion_; + mutable lemma lemma_; mutable bool initializedFrames_ = false; - mutable std::vector frames_; + mutable std::vector frames_; }; -- cgit 1.4.1