about summary refs log tree commit diff stats
path: root/blessed.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-08-04 19:21:12 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-08-04 19:21:12 -0400
commit2a40a70aa8f9c464f9d91314c6c7265e1b6a1049 (patch)
treeaef3aaefacc4190fe3a1d14341ba3a407d85b73b /blessed.cpp
parent4c6ad71070133da729856d3ae88da6496028ba4f (diff)
downloadblessed-2a40a70aa8f9c464f9d91314c6c7265e1b6a1049.tar.gz
blessed-2a40a70aa8f9c464f9d91314c6c7265e1b6a1049.tar.bz2
blessed-2a40a70aa8f9c464f9d91314c6c7265e1b6a1049.zip
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
Diffstat (limited to 'blessed.cpp')
-rw-r--r--blessed.cpp11
1 files 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)
57 std::uniform_int_distribution<int> emojidist(0, emojis.size()-1); 57 std::uniform_int_distribution<int> emojidist(0, emojis.size()-1);
58 std::bernoulli_distribution continuedist(1.0/2.0); 58 std::bernoulli_distribution continuedist(1.0/2.0);
59 59
60 verbly::filter slurFilter =
61 (verbly::word::usageDomains %= (verbly::notion::wnid == 106717170));
62
60 verbly::filter nounFilter = 63 verbly::filter nounFilter =
61 (verbly::notion::partOfSpeech == verbly::part_of_speech::noun) 64 (verbly::notion::partOfSpeech == verbly::part_of_speech::noun)
62 && (verbly::form::proper == false) 65 && (verbly::form::proper == false)
63 // Blacklist ethnic slurs 66 // Blacklist slurs and slur homographys
64 && !(verbly::word::usageDomains %= (verbly::notion::wnid == 106718862)); 67 && !(verbly::word::forms(verbly::inflection::base) %= slurFilter);;
65 68
66 verbly::query<verbly::word> verbQuery = database.words( 69 verbly::query<verbly::word> verbQuery = database.words(
67 (verbly::notion::partOfSpeech == verbly::part_of_speech::verb) 70 (verbly::notion::partOfSpeech == verbly::part_of_speech::verb)
68 && (verbly::pronunciation::rhymes %= nounFilter)); 71 && (verbly::pronunciation::rhymes %= nounFilter)
72 // Blacklist slurs and slur homographys
73 && !(verbly::word::forms(verbly::inflection::base) %= slurFilter));
69 74
70 for (;;) 75 for (;;)
71 { 76 {