Skip to content

Commit

Permalink
Added documentation for slur replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
duggalsu authored and dennyabrain committed Aug 14, 2023
1 parent 2064d77 commit 73aede3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions browser-extension/docs/04-slur-redaction.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 73aede3

Please sign in to comment.