From 8b1333d0e6e2b9a5014bdbff2987d899f5413fee Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 16 Mar 2016 21:35:35 -0400 Subject: Added word derivational relationships (kind of eh at the moment) and moved verbly into its own directory --- verbly/lib/adverb.h | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 verbly/lib/adverb.h (limited to 'verbly/lib/adverb.h') diff --git a/verbly/lib/adverb.h b/verbly/lib/adverb.h new file mode 100644 index 0000000..65e3c5c --- /dev/null +++ b/verbly/lib/adverb.h @@ -0,0 +1,95 @@ +#ifndef ADVERB_H_86F8302F +#define ADVERB_H_86F8302F + +namespace verbly { + + class adverb : public word { + private: + std::string _base_form; + std::string _comparative_form; + std::string _superlative_form; + + friend class adverb_query; + + public: + adverb(const data& _data, int _id); + + std::string base_form() const; + std::string comparative_form() const; + std::string superlative_form() const; + + bool has_comparative_form() const; + bool has_superlative_form() const; + + adverb_query antonyms() const; + adverb_query synonyms() const; + adjective_query anti_mannernyms() const; + + adverb_query& derived_from(const word& _w); + adverb_query& not_derived_from(const word& _w); + }; + + class adverb_query { + public: + adverb_query(const data& _data); + + adverb_query& limit(int _limit); + adverb_query& random(bool _random); + adverb_query& except(const adverb& _word); + adverb_query& rhymes_with(const word& _word); + adverb_query& has_pronunciation(bool _has_prn); + + adverb_query& requires_comparative_form(bool _arg); + adverb_query& requires_superlative_form(bool _arg); + + adverb_query& has_antonyms(bool _arg); + adverb_query& antonym_of(const adverb& _adv); + adverb_query& not_antonym_of(const adverb& _adv); + + adverb_query& has_synonyms(bool _arg); + adverb_query& synonym_of(const adverb& _adv); + adverb_query& not_synonym_of(const adverb& _adv); + + adverb_query& is_mannernymic(bool _arg); + adverb_query& mannernym_of(const adjective& _adj); + + adverb_query& derived_from(const word& _w); + adverb_query& not_derived_from(const word& _w); + + std::list run() const; + + const static int unlimited = -1; + + private: + const data& _data; + int _limit = unlimited; + bool _random = false; + std::list _rhymes; + std::list _except; + bool _has_prn = false; + + bool _requires_comparative_form = false; + bool _requires_superlative_form = false; + + bool _has_antonyms = false; + std::list _antonym_of; + std::list _not_antonym_of; + + bool _has_synonyms = false; + std::list _synonym_of; + std::list _not_synonym_of; + + bool _is_mannernymic = false; + std::list _mannernym_of; + + std::list _derived_from_adjective; + std::list _not_derived_from_adjective; + std::list _derived_from_adverb; + std::list _not_derived_from_adverb; + std::list _derived_from_noun; + std::list _not_derived_from_noun; + }; + +}; + +#endif /* end of include guard: ADVERB_H_86F8302F */ -- cgit 1.4.1