From 73aede3a678302c0642c1f11005fa26860bdbd31 Mon Sep 17 00:00:00 2001 From: Aurora <5505558+duggalsu@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:54:00 +0530 Subject: [PATCH] Added documentation for slur replacement --- browser-extension/docs/04-slur-redaction.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 browser-extension/docs/04-slur-redaction.md diff --git a/browser-extension/docs/04-slur-redaction.md b/browser-extension/docs/04-slur-redaction.md new file mode 100644 index 00000000..fd507678 --- /dev/null +++ b/browser-extension/docs/04-slur-redaction.md @@ -0,0 +1,11 @@ +# Slur Redaction + +## Exact slur matching +Exact slur matching works using regex and string matching. There is one common list of all slurs in the file `slur-replace.js`. This common list of slurs is also updated with new slurs and is in the variable `slurList`. + +### Slurs not being matched by regex query +There are a few slurs that do not get matched with the regex query being used. + +1. Some slurs get matched with they are space-separated but not if they are surrounded by other characters e.g. double-quotes. These slurs are kept in the `missedSlurListStatic` separate static variable for further regex matching . + +2. If a slur contains a character that needs to be escaped, it is also not getting matched by regex even when escaping the character in the phrase. There is currently only one slur with this criteria. it is placed in the `missedEscapedSlurListStatic` variable for further matching as a simple string. \ No newline at end of file