about summary refs log tree commit diff stats
path: root/verbly/adverb.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-03-16 11:27:16 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-03-16 11:27:16 -0400
commit3aceae8ab1eb5992110ea57a9479bbc3177feb21 (patch)
tree13167a266805344efb7bb1d900486f782c23285e /verbly/adverb.h
parente1be2716746e75cf6ed37e86461a7f580a964564 (diff)
downloadfurries-3aceae8ab1eb5992110ea57a9479bbc3177feb21.tar.gz
furries-3aceae8ab1eb5992110ea57a9479bbc3177feb21.tar.bz2
furries-3aceae8ab1eb5992110ea57a9479bbc3177feb21.zip
Added more inflections, word relationships, and pronunciations
Nouns, adjectives, and adverbs now have inflected forms. A large number of WordNet word relationships (all noun-noun relationships, plus synonymy and antonymy for all word types except verbs) have been added. Additionally, CMUDICT is now being used to store word pronunciations for rhyming purposes. Verbly is now also a compiled library rather than being header-only due to the complexity of the query interface.
Diffstat (limited to 'verbly/adverb.h')
-rw-r--r--verbly/adverb.h75
1 files changed, 68 insertions, 7 deletions
diff --git a/verbly/adverb.h b/verbly/adverb.h index 6d2466e..42c3492 100644 --- a/verbly/adverb.h +++ b/verbly/adverb.h
@@ -3,17 +3,78 @@
3 3
4namespace verbly { 4namespace verbly {
5 5
6 class adverb { 6 class adverb : public word {
7 private: 7 private:
8 int id; 8 std::string _base_form;
9 std::string _comparative_form;
10 std::string _superlative_form;
9 11
12 friend class adverb_query;
13
14 public:
15 adverb(const data& _data, int _id);
16
17 std::string base_form() const;
18 std::string comparative_form() const;
19 std::string superlative_form() const;
20
21 bool has_comparative_form() const;
22 bool has_superlative_form() const;
23
24 adverb_query antonyms() const;
25 adverb_query synonyms() const;
26 adjective_query anti_mannernyms() const;
27 };
28
29 class adverb_query {
10 public: 30 public:
11 std::string form; 31 adverb_query(const data& _data);
32
33 adverb_query& limit(int _limit);
34 adverb_query& random(bool _random);
35 adverb_query& except(const adverb& _word);
36 adverb_query& rhymes_with(const word& _word);
37 adverb_query& has_pronunciation(bool _has_prn);
38
39 adverb_query& requires_comparative_form(bool _arg);
40 adverb_query& requires_superlative_form(bool _arg);
41
42 adverb_query& has_antonyms(bool _arg);
43 adverb_query& antonym_of(const adverb& _adv);
44 adverb_query& not_antonym_of(const adverb& _adv);
45
46 adverb_query& has_synonyms(bool _arg);
47 adverb_query& synonym_of(const adverb& _adv);
48 adverb_query& not_synonym_of(const adverb& _adv);
49
50 adverb_query& is_mannernymic(bool _arg);
51 adverb_query& mannernym_of(const adjective& _adj);
52
53 std::list<adverb> run() const;
54
55 const static int unlimited = -1;
56
57 private:
58 const data& _data;
59 int _limit = unlimited;
60 bool _random = false;
61 std::list<std::string> _rhymes;
62 std::list<adverb> _except;
63 bool _has_prn = false;
64
65 bool _requires_comparative_form = false;
66 bool _requires_superlative_form = false;
67
68 bool _has_antonyms = false;
69 std::list<adverb> _antonym_of;
70 std::list<adverb> _not_antonym_of;
71
72 bool _has_synonyms = false;
73 std::list<adverb> _synonym_of;
74 std::list<adverb> _not_synonym_of;
12 75
13 adverb(int id) : id(id) 76 bool _is_mannernymic = false;
14 { 77 std::list<adjective> _mannernym_of;
15
16 }
17 }; 78 };
18 79
19}; 80};