diff options
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; |
