about summary refs log tree commit diff stats
path: root/verbly/noun.h
blob: f5ba2564b5d1f1b8cf24ad9d7774431b46937e81 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#ifndef NOUN_H_24A03C83
#define NOUN_H_24A03C83

namespace verbly {
  
  class noun : public word {
    private:
      std::string _singular;
      std::string _plural;
      
      friend class noun_query;
      
    public:
      noun(const data& _data, int _id);
      
      std::string base_form() const;
      std::string singular_form() const;
      std::string plural_form() const;
      
      bool has_plural_form() const;
      
      noun_query hypernyms() const;
      noun_query hyponyms() const;
      noun_query part_meronyms() const;
      noun_query part_holonyms() const;
      noun_query substance_meronyms() const;
      noun_query substance_holonyms() const;
      noun_query member_meronyms() const;
      noun_query member_holonyms() const;
      noun_query classes() const;
      noun_query instances() const;
      noun_query synonyms() const;
      noun_query antonyms() const;
      adjective_query pertainyms() const;
      adjective_query variations() const;
  };
  
  class noun_query {
    public:
      noun_query(const data& _data);
      
      noun_query& limit(int _limit);
      noun_query& random(bool _random);
      noun_query& except(const noun& _word);
      noun_query& rhymes_with(const word& _word);
      noun_query& has_pronunciation(bool _has_prn);
      
      noun_query& is_hypernym(bool _arg);
      noun_query& hypernym_of(const noun& _noun);
      noun_query& not_hypernym_of(const noun& _noun);
      
      noun_query& is_hyponym(bool _arg);
      noun_query& hyponym_of(const noun& _noun);
      noun_query& not_hyponym_of(const noun& _noun);
      
      noun_query& is_part_meronym(bool _arg);
      noun_query& part_meronym_of(const noun& _noun);
      noun_query& not_part_meronym_of(const noun& _noun);
      
      noun_query& is_part_holonym(bool _arg);
      noun_query& part_holonym_of(const noun& _noun);
      noun_query& not_part_holonym_of(const noun& _noun);
      
      noun_query& is_substance_meronym(bool _arg);
      noun_query& substance_meronym_of(const noun& _noun);
      noun_query& not_substance_meronym_of(const noun& _noun);
      
      noun_query& is_substance_holonym(bool _arg);
      noun_query& substance_holonym_of(const noun& _noun);
      noun_query& not_substance_holonym_of(const noun& _noun);
      
      noun_query& is_member_meronym(bool _arg);
      noun_query& member_meronym_of(const noun& _noun);
      noun_query& not_member_meronym_of(const noun& _noun);
      
      noun_query& is_member_holonym(bool _arg);
      noun_query& member_holonym_of(const noun& _noun);
      noun_query& not_member_holonym_of(const noun& _noun);
      
      noun_query& is_proper(bool _arg);
      noun_query& instance_of(const noun& _noun);
      noun_query& not_instance_of(const noun& _noun);
      
      noun_query& is_class(bool _arg);
      noun_query& class_of(const noun& _noun);
      noun_query& not_class_of(const noun& _noun);
      
      noun_query& has_synonyms(bool _arg);
      noun_query& synonym_of(const noun& _noun);
      noun_query& not_synonym_of(const noun& _noun);
      
      noun_query& has_antonyms(bool _arg);
      noun_query& antonym_of(const noun& _noun);
      noun_query& not_antonym_of(const noun& _noun);
      
      noun_query& has_pertainym(bool _arg);
      noun_query& anti_pertainym_of(const adjective& _adj);
      
      noun_query& is_attribute(bool _arg);
      noun_query& attribute_of(const adjective& _adj);
      
      std::list<noun> run() const;
      
      const static int unlimited = -1;
      
    private:
      const data& _data;
      int _limit = unlimited;
      bool _random = false;
      std::list<std::string> _rhymes;
      std::list<noun> _except;
      bool _has_prn = false;
      
      bool _is_hypernym = false;
      std::list<noun> _hypernym_of;
      std::list<noun> _not_hypernym_of;
      
      bool _is_hyponym = false;
      std::list<noun> _hyponym_of;
      std::list<noun> _not_hyponym_of;
      
      bool _is_part_meronym = false;
      std::list<noun> _part_meronym_of;
      std::list<noun> _not_part_meronym_of;
      
      bool _is_substance_meronym = false;
      std::list<noun> _substance_meronym_of;
      std::list<noun> _not_substance_meronym_of;
      
      bool _is_member_meronym = false;
      std::list<noun> _member_meronym_of;
      std::list<noun> _not_member_meronym_of;
      
      bool _is_part_holonym = false;
      std::list<noun> _part_holonym_of;
      std::list<noun> _not_part_holonym_of;
      
      bool _is_substance_holonym = false;
      std::list<noun> _substance_holonym_of;
      std::list<noun> _not_substance_holonym_of;
      
      bool _is_member_holonym = false;
      std::list<noun> _member_holonym_of;
      std::list<noun> _not_member_holonym_of;
      
      bool _is_proper = false;
      std::list<noun> _instance_of;
      std::list<noun> _not_instance_of;
      
      bool _is_class = false;
      std::list<noun> _class_of;
      std::list<noun> _not_class_of;
      
      bool _has_synonyms = false;
      std::list<noun> _synonym_of;
      std::list<noun> _not_synonym_of;
      
      bool _has_antonyms = false;
      std::list<noun> _antonym_of;
      std::list<noun> _not_antonym_of;
      
      bool _has_pertainym = false;
      std::list<adjective> _anti_pertainym_of;
      
      bool _is_attribute = false;
      std::list<adjective> _attribute_of;
  };
  
};

#endif /* end of include guard: NOUN_H_24A03C83 */