diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-08-14 21:55:41 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-08-14 21:55:41 -0400 |
commit | 95550091aa12eef68d47cbed5ad22c4402b08c68 (patch) | |
tree | 72fda7ab1d0713da5f44f7630876ec6390779d0e /fefisms.cpp | |
parent | 1dc76691f3e1c982973a03a9988b98713b9631ae (diff) | |
download | fefisms-95550091aa12eef68d47cbed5ad22c4402b08c68.tar.gz fefisms-95550091aa12eef68d47cbed5ad22c4402b08c68.tar.bz2 fefisms-95550091aa12eef68d47cbed5ad22c4402b08c68.zip |
Added more defense against slurs
refs hatkirby/blessed#2
Diffstat (limited to 'fefisms.cpp')
-rw-r--r-- | fefisms.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fefisms.cpp b/fefisms.cpp index 701b330..4ba15b9 100644 --- a/fefisms.cpp +++ b/fefisms.cpp | |||
@@ -30,11 +30,9 @@ void fefisms::run() const | |||
30 | { | 30 | { |
31 | verbly::filter formFilter = | 31 | verbly::filter formFilter = |
32 | (verbly::form::complexity == 1) | 32 | (verbly::form::complexity == 1) |
33 | && (verbly::form::proper == false); | 33 | && (verbly::form::proper == false) |
34 | 34 | // Blacklist slurs and slur homographys | |
35 | // Blacklist ethnic slurs | 35 | && !(verbly::word::usageDomains %= (verbly::notion::wnid == 106717170)); |
36 | verbly::filter cleanFilter = | ||
37 | !(verbly::word::usageDomains %= (verbly::notion::wnid == 106718862)); | ||
38 | 36 | ||
39 | for (;;) | 37 | for (;;) |
40 | { | 38 | { |
@@ -58,15 +56,12 @@ void fefisms::run() const | |||
58 | verbly::word noun = database_->words( | 56 | verbly::word noun = database_->words( |
59 | (verbly::notion::partOfSpeech == verbly::part_of_speech::noun) | 57 | (verbly::notion::partOfSpeech == verbly::part_of_speech::noun) |
60 | && (verbly::word::forms(nounInfl) %= formFilter) | 58 | && (verbly::word::forms(nounInfl) %= formFilter) |
61 | && cleanFilter | ||
62 | && (verbly::notion::hyponyms %= | 59 | && (verbly::notion::hyponyms %= |
63 | (verbly::word::forms(hypoInfl) %= formFilter) | 60 | (verbly::word::forms(hypoInfl) %= formFilter))).first(); |
64 | && cleanFilter)).first(); | ||
65 | 61 | ||
66 | verbly::word hyponym = database_->words( | 62 | verbly::word hyponym = database_->words( |
67 | (verbly::notion::partOfSpeech == verbly::part_of_speech::noun) | 63 | (verbly::notion::partOfSpeech == verbly::part_of_speech::noun) |
68 | && (verbly::notion::hypernyms %= noun) | 64 | && (verbly::notion::hypernyms %= noun) |
69 | && cleanFilter | ||
70 | && (verbly::word::forms(hypoInfl) %= formFilter)).first(); | 65 | && (verbly::word::forms(hypoInfl) %= formFilter)).first(); |
71 | 66 | ||
72 | if (std::bernoulli_distribution(1.0/2.0)(rng_)) | 67 | if (std::bernoulli_distribution(1.0/2.0)(rng_)) |