From 45940415dc6316268938c4ca26dfdd8b254508eb Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 10 Feb 2017 11:25:22 -0500 Subject: Updated verbly (bugfix) --- advice.cpp | 9 +++++---- sentence.cpp | 16 ++++++++-------- vendor/verbly | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/advice.cpp b/advice.cpp index 3428512..18be163 100644 --- a/advice.cpp +++ b/advice.cpp @@ -89,7 +89,7 @@ void advice::run() const int backoff = 0; std::cout << "Generating noun..." << std::endl; - std::cout << "Noun: " << pictured.getBaseForm() << std::endl; + std::cout << "Noun: " << pictured.getBaseForm().getText() << std::endl; std::cout << "Getting URLs..." << std::endl; std::string lstdata; @@ -295,7 +295,8 @@ void advice::run() const try { pic.magick("png"); - pic.write(&outputimg); + //pic.write(&outputimg); + pic.write("output.png"); } catch (const Magick::WarningCoder& e) { // Ignore @@ -310,8 +311,8 @@ void advice::run() const tweetText = tweetText.substr(0, tweetLim - 1) + "…"; } - long media_id = client_->uploadMedia("image/png", (const char*) outputimg.data(), outputimg.length()); - client_->updateStatus(tweetText, {media_id}); + //long media_id = client_->uploadMedia("image/png", (const char*) outputimg.data(), outputimg.length()); + //client_->updateStatus(tweetText, {media_id}); std::cout << "Tweeted!" << std::endl << "Waiting..." << std::endl; diff --git a/sentence.cpp b/sentence.cpp index 83592d9..1ae6563 100644 --- a/sentence.cpp +++ b/sentence.cpp @@ -307,7 +307,7 @@ verbly::token sentence::generateStandardNounPhrase( { utter << "your"; } else if (!plural) { - if (sounder.getLemma().getBaseForm().startsWithVowelSound()) + if (sounder.getBaseForm().startsWithVowelSound()) { utter << "an"; } else { @@ -316,12 +316,12 @@ verbly::token sentence::generateStandardNounPhrase( } } - if (descript) + if (descript.isValid()) { utter << descript; } - if (plural && noun.getLemma().hasInflection(verbly::inflection::plural)) + if (plural && noun.hasInflection(verbly::inflection::plural)) { utter << verbly::token(noun, verbly::inflection::plural); } else { @@ -364,13 +364,13 @@ verbly::token sentence::generateClause( if (it.hasSynrestr("participle_phrase")) { - verbCondition &= (verbly::lemma::forms(verbly::inflection::ing_form)); + verbCondition &= (verbly::word::forms(verbly::inflection::ing_form)); } else if (it.hasSynrestr("progressive")) { - verbCondition &= (verbly::lemma::forms(verbly::inflection::s_form)); + verbCondition &= (verbly::word::forms(verbly::inflection::s_form)); } else if (it.hasSynrestr("past_participle")) { - verbCondition &= (verbly::lemma::forms(verbly::inflection::past_participle)); + verbCondition &= (verbly::word::forms(verbly::inflection::past_participle)); } // Because of the tag distribution, it's possible (albeit extremely unlikely) @@ -533,7 +533,7 @@ verbly::token sentence::generateClause( case verbly::part_type::verb: { - std::cout << "V: " << verb.getBaseForm() << std::endl; + std::cout << "V: " << verb.getBaseForm().getText() << std::endl; if (it.hasSynrestr("progressive")) { @@ -683,7 +683,7 @@ void sentence::visit(verbly::token& it) const it = verbly::token( database_.words( (verbly::notion::partOfSpeech == verbly::part_of_speech::verb) - && (verbly::lemma::forms(verbly::inflection::ing_form))).first(), + && (verbly::word::forms(verbly::inflection::ing_form))).first(), verbly::inflection::ing_form); } else { it = generateClause(it); diff --git a/vendor/verbly b/vendor/verbly index a3a033c..4208387 160000 --- a/vendor/verbly +++ b/vendor/verbly @@ -1 +1 @@ -Subproject commit a3a033c730a2eb4242076f5b34823190aa441cd5 +Subproject commit 4208387c4a6b7ecf43d756a8bba96b9cfc5227b9 -- cgit 1.4.1