diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-05-02 22:45:11 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-05-02 22:45:11 -0400 |
commit | bd398509575af0362e53ce6b805eaa210406b9fd (patch) | |
tree | e699624ca6934f591241d5dfa95a91b839ce6bc7 /lib/noun.cpp | |
parent | 499dbc410174602a5985bd75b600fbec5cd086f1 (diff) | |
parent | 965a3206df834f846f2c560438c80a707dcee4cb (diff) | |
download | verbly-bd398509575af0362e53ce6b805eaa210406b9fd.tar.gz verbly-bd398509575af0362e53ce6b805eaa210406b9fd.tar.bz2 verbly-bd398509575af0362e53ce6b805eaa210406b9fd.zip |
Merge branch 'master' of https://github.com/hatkirby/verbly
Diffstat (limited to 'lib/noun.cpp')
-rw-r--r-- | lib/noun.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/noun.cpp b/lib/noun.cpp index 71c9af0..d8b34c9 100644 --- a/lib/noun.cpp +++ b/lib/noun.cpp | |||
@@ -34,6 +34,13 @@ namespace verbly { | |||
34 | 34 | ||
35 | return _plural; | 35 | return _plural; |
36 | } | 36 | } |
37 | |||
38 | int noun::wnid() const | ||
39 | { | ||
40 | assert(_valid == true); | ||
41 | |||
42 | return _wnid; | ||
43 | } | ||
37 | 44 | ||
38 | bool noun::has_plural_form() const | 45 | bool noun::has_plural_form() const |
39 | { | 46 | { |
@@ -196,6 +203,16 @@ namespace verbly { | |||
196 | return _data->adjectives().variant_of(*this); | 203 | return _data->adjectives().variant_of(*this); |
197 | } | 204 | } |
198 | 205 | ||
206 | std::string noun::imagenet_url() const | ||
207 | { | ||
208 | std::stringstream url; | ||
209 | url << "http://www.image-net.org/api/text/imagenet.synset.geturls?wnid=n"; | ||
210 | url.width(8); | ||
211 | url.fill('0'); | ||
212 | url << (_wnid % 100000000); | ||
213 | return url.str(); | ||
214 | } | ||
215 | |||
199 | bool noun::operator<(const noun& other) const | 216 | bool noun::operator<(const noun& other) const |
200 | { | 217 | { |
201 | return _id < other._id; | 218 | return _id < other._id; |