summary refs log tree commit diff stats
path: root/lib/noun_query.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-05-02 22:44:08 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-05-02 22:44:08 -0400
commit499dbc410174602a5985bd75b600fbec5cd086f1 (patch)
tree62c611c74156d16072051eb5378ef1303c27a1b5 /lib/noun_query.cpp
parent3a225f5eb709262b9d44d49519136ea9a2a71000 (diff)
downloadverbly-499dbc410174602a5985bd75b600fbec5cd086f1.tar.gz
verbly-499dbc410174602a5985bd75b600fbec5cd086f1.tar.bz2
verbly-499dbc410174602a5985bd75b600fbec5cd086f1.zip
Added "requires plural form" noun query predicate
Diffstat (limited to 'lib/noun_query.cpp')
-rw-r--r--lib/noun_query.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/noun_query.cpp b/lib/noun_query.cpp index 83bb47d..04e567d 100644 --- a/lib/noun_query.cpp +++ b/lib/noun_query.cpp
@@ -76,6 +76,13 @@ namespace verbly {
76 return *this; 76 return *this;
77 } 77 }
78 78
79 noun_query& noun_query::requires_plural_form()
80 {
81 _requires_plural_form = true;
82
83 return *this;
84 }
85
79 noun_query& noun_query::with_complexity(int _arg) 86 noun_query& noun_query::with_complexity(int _arg)
80 { 87 {
81 _with_complexity = _arg; 88 _with_complexity = _arg;
@@ -484,6 +491,11 @@ namespace verbly {
484 conditions.push_back(cond); 491 conditions.push_back(cond);
485 } 492 }
486 493
494 if (_requires_plural_form)
495 {
496 conditions.push_back("plural IS NOT NULL");
497 }
498
487 if (!_with_prefix.empty()) 499 if (!_with_prefix.empty())
488 { 500 {
489 std::function<std::string (filter<std::string>, bool)> recur = [&] (filter<std::string> f, bool notlogic) -> std::string { 501 std::function<std::string (filter<std::string>, bool)> recur = [&] (filter<std::string> f, bool notlogic) -> std::string {