From 2a40a70aa8f9c464f9d91314c6c7265e1b6a1049 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 4 Aug 2018 19:21:12 -0400 Subject: Added more defense against slurs Both the nouns and verbs are now checked for homography with slurs. The slur list has expanded from ethnic slurs to "derogations", which includes some a few innocent words but you gotta do what you gotta do. refs #2 --- blessed.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/blessed.cpp b/blessed.cpp index 02f4273..c8041d0 100644 --- a/blessed.cpp +++ b/blessed.cpp @@ -57,15 +57,20 @@ int main(int argc, char** argv) std::uniform_int_distribution emojidist(0, emojis.size()-1); std::bernoulli_distribution continuedist(1.0/2.0); + verbly::filter slurFilter = + (verbly::word::usageDomains %= (verbly::notion::wnid == 106717170)); + verbly::filter nounFilter = (verbly::notion::partOfSpeech == verbly::part_of_speech::noun) && (verbly::form::proper == false) - // Blacklist ethnic slurs - && !(verbly::word::usageDomains %= (verbly::notion::wnid == 106718862)); + // Blacklist slurs and slur homographys + && !(verbly::word::forms(verbly::inflection::base) %= slurFilter);; verbly::query verbQuery = database.words( (verbly::notion::partOfSpeech == verbly::part_of_speech::verb) - && (verbly::pronunciation::rhymes %= nounFilter)); + && (verbly::pronunciation::rhymes %= nounFilter) + // Blacklist slurs and slur homographys + && !(verbly::word::forms(verbly::inflection::base) %= slurFilter)); for (;;) { -- cgit 1.4.1