From b849e98358555e8fc18ce226d8b310bf45d72dce Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 16 May 2016 22:51:22 -0400 Subject: Added rhymes_with predicate based on rhymes rather than words --- lib/adjective_query.cpp | 7 +++++++ lib/adjective_query.h | 1 + lib/adverb_query.cpp | 7 +++++++ lib/adverb_query.h | 1 + lib/noun_query.cpp | 7 +++++++ lib/noun_query.h | 1 + lib/verb_query.cpp | 7 +++++++ lib/verb_query.h | 1 + 8 files changed, 32 insertions(+) (limited to 'lib') diff --git a/lib/adjective_query.cpp b/lib/adjective_query.cpp index e47b40c..5f1cbe7 100644 --- a/lib/adjective_query.cpp +++ b/lib/adjective_query.cpp @@ -46,6 +46,13 @@ namespace verbly { return *this; } + adjective_query& adjective_query::rhymes_with(rhyme _r) + { + _rhymes.push_back(_r); + + return *this; + } + adjective_query& adjective_query::has_pronunciation() { this->_has_prn = true; diff --git a/lib/adjective_query.h b/lib/adjective_query.h index 030a494..945e6bd 100644 --- a/lib/adjective_query.h +++ b/lib/adjective_query.h @@ -11,6 +11,7 @@ namespace verbly { adjective_query& random(); adjective_query& except(const adjective& _word); adjective_query& rhymes_with(const word& _word); + adjective_query& rhymes_with(rhyme _r); adjective_query& has_pronunciation(); adjective_query& has_rhyming_noun(); adjective_query& has_rhyming_adjective(); diff --git a/lib/adverb_query.cpp b/lib/adverb_query.cpp index 797e6a6..1c22712 100644 --- a/lib/adverb_query.cpp +++ b/lib/adverb_query.cpp @@ -46,6 +46,13 @@ namespace verbly { return *this; } + adverb_query& adverb_query::rhymes_with(rhyme _r) + { + _rhymes.push_back(_r); + + return *this; + } + adverb_query& adverb_query::has_pronunciation() { this->_has_prn = true; diff --git a/lib/adverb_query.h b/lib/adverb_query.h index 403a616..cf6c046 100644 --- a/lib/adverb_query.h +++ b/lib/adverb_query.h @@ -11,6 +11,7 @@ namespace verbly { adverb_query& random(); adverb_query& except(const adverb& _word); adverb_query& rhymes_with(const word& _word); + adverb_query& rhymes_with(rhyme _r); adverb_query& has_pronunciation(); adverb_query& has_rhyming_noun(); adverb_query& has_rhyming_adjective(); diff --git a/lib/noun_query.cpp b/lib/noun_query.cpp index 8f37bf6..f4c832b 100644 --- a/lib/noun_query.cpp +++ b/lib/noun_query.cpp @@ -46,6 +46,13 @@ namespace verbly { return *this; } + noun_query& noun_query::rhymes_with(rhyme _r) + { + _rhymes.push_back(_r); + + return *this; + } + noun_query& noun_query::has_pronunciation() { this->_has_prn = true; diff --git a/lib/noun_query.h b/lib/noun_query.h index 19fbc60..eb4a57c 100644 --- a/lib/noun_query.h +++ b/lib/noun_query.h @@ -11,6 +11,7 @@ namespace verbly { noun_query& random(); noun_query& except(const noun& _word); noun_query& rhymes_with(const word& _word); + noun_query& rhymes_with(rhyme _r); noun_query& has_pronunciation(); noun_query& has_rhyming_noun(); noun_query& has_rhyming_adjective(); diff --git a/lib/verb_query.cpp b/lib/verb_query.cpp index 654bc33..d871f83 100644 --- a/lib/verb_query.cpp +++ b/lib/verb_query.cpp @@ -46,6 +46,13 @@ namespace verbly { return *this; } + verb_query& verb_query::rhymes_with(rhyme _r) + { + _rhymes.push_back(_r); + + return *this; + } + verb_query& verb_query::has_pronunciation() { this->_has_prn = true; diff --git a/lib/verb_query.h b/lib/verb_query.h index a07dc18..0ee5666 100644 --- a/lib/verb_query.h +++ b/lib/verb_query.h @@ -11,6 +11,7 @@ namespace verbly { verb_query& random(); verb_query& except(const verb& _word); verb_query& rhymes_with(const word& _word); + verb_query& rhymes_with(rhyme _r); verb_query& has_pronunciation(); verb_query& has_rhyming_noun(); verb_query& has_rhyming_adjective(); -- cgit 1.4.1