diff options
-rw-r--r-- | lib/noun_query.cpp | 12 | ||||
-rw-r--r-- | lib/noun_query.h | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/noun_query.cpp b/lib/noun_query.cpp index b4336b6..8f37bf6 100644 --- a/lib/noun_query.cpp +++ b/lib/noun_query.cpp | |||
@@ -104,6 +104,13 @@ namespace verbly { | |||
104 | return *this; | 104 | return *this; |
105 | } | 105 | } |
106 | 106 | ||
107 | noun_query& noun_query::requires_plural_form() | ||
108 | { | ||
109 | _requires_plural_form = true; | ||
110 | |||
111 | return *this; | ||
112 | } | ||
113 | |||
107 | noun_query& noun_query::with_complexity(int _arg) | 114 | noun_query& noun_query::with_complexity(int _arg) |
108 | { | 115 | { |
109 | _with_complexity = _arg; | 116 | _with_complexity = _arg; |
@@ -560,6 +567,11 @@ namespace verbly { | |||
560 | } | 567 | } |
561 | } | 568 | } |
562 | 569 | ||
570 | if (_requires_plural_form) | ||
571 | { | ||
572 | conditions.push_back("plural IS NOT NULL"); | ||
573 | } | ||
574 | |||
563 | if (!_with_prefix.empty()) | 575 | if (!_with_prefix.empty()) |
564 | { | 576 | { |
565 | std::function<std::string (filter<std::string>, bool)> recur = [&] (filter<std::string> f, bool notlogic) -> std::string { | 577 | std::function<std::string (filter<std::string>, bool)> recur = [&] (filter<std::string> f, bool notlogic) -> std::string { |
diff --git a/lib/noun_query.h b/lib/noun_query.h index 6b5733f..19fbc60 100644 --- a/lib/noun_query.h +++ b/lib/noun_query.h | |||
@@ -21,6 +21,8 @@ namespace verbly { | |||
21 | noun_query& with_prefix(filter<std::string> _f); | 21 | noun_query& with_prefix(filter<std::string> _f); |
22 | noun_query& with_suffix(filter<std::string> _f); | 22 | noun_query& with_suffix(filter<std::string> _f); |
23 | 23 | ||
24 | noun_query& requires_plural_form(); | ||
25 | |||
24 | noun_query& with_complexity(int _arg); | 26 | noun_query& with_complexity(int _arg); |
25 | 27 | ||
26 | noun_query& is_hypernym(); | 28 | noun_query& is_hypernym(); |
@@ -104,6 +106,8 @@ namespace verbly { | |||
104 | 106 | ||
105 | int _with_complexity = unlimited; | 107 | int _with_complexity = unlimited; |
106 | 108 | ||
109 | bool _requires_plural_form = false; | ||
110 | |||
107 | bool _is_hypernym = false; | 111 | bool _is_hypernym = false; |
108 | filter<noun> _hypernym_of; | 112 | filter<noun> _hypernym_of; |
109 | filter<noun> _full_hypernym_of; | 113 | filter<noun> _full_hypernym_of; |