From 499dbc410174602a5985bd75b600fbec5cd086f1 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 2 May 2016 22:44:08 -0400 Subject: Added "requires plural form" noun query predicate --- lib/noun_query.cpp | 12 ++++++++++++ lib/noun_query.h | 4 ++++ 2 files changed, 16 insertions(+) (limited to 'lib') 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 { return *this; } + noun_query& noun_query::requires_plural_form() + { + _requires_plural_form = true; + + return *this; + } + noun_query& noun_query::with_complexity(int _arg) { _with_complexity = _arg; @@ -484,6 +491,11 @@ namespace verbly { conditions.push_back(cond); } + if (_requires_plural_form) + { + conditions.push_back("plural IS NOT NULL"); + } + if (!_with_prefix.empty()) { std::function, bool)> recur = [&] (filter f, bool notlogic) -> std::string { diff --git a/lib/noun_query.h b/lib/noun_query.h index 5b73f8d..44a1c70 100644 --- a/lib/noun_query.h +++ b/lib/noun_query.h @@ -17,6 +17,8 @@ namespace verbly { noun_query& with_prefix(filter _f); noun_query& with_suffix(filter _f); + noun_query& requires_plural_form(); + noun_query& with_complexity(int _arg); noun_query& is_hypernym(); @@ -93,6 +95,8 @@ namespace verbly { int _with_complexity = unlimited; + bool _requires_plural_form = false; + bool _is_hypernym = false; filter _hypernym_of; filter _full_hypernym_of; -- cgit 1.4.1