Skip to content

Commit

Permalink
fix: Add gyat to DefaultProfanities (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonuc authored Oct 18, 2024
1 parent 1e1dd1f commit 9fd1d22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion falsenegatives.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package goaway
//
// This is reserved for words that may be incorrectly filtered as false positives.
//
// Alternatively, words that are long, or that should mark a string as profane no what the context is
// Alternatively, words that are long, or that should mark a string as profane no matter what the context is
// or whether the word is part of another word can also be included.
//
// Note that there is a test that prevents words from being in both DefaultProfanities and DefaultFalseNegatives,
Expand Down
5 changes: 5 additions & 0 deletions goaway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ func TestProfanityDetector_Censor(t *testing.T) {
expectedOutput: "document **** document ****",
expectedOutputWithoutSpaceSanitization: "document **** document ****",
},
{
input: "Everyone was staring, and someone muttered ‘gyat’ under their breath.",
expectedOutput: "Everyone was staring, and someone muttered ‘****’ under their breath.",
expectedOutputWithoutSpaceSanitization: "Everyone was staring, and someone muttered ‘****’ under their breath.",
},
}
for _, tt := range tests {
t.Run("default_"+tt.input, func(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions profanities.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var DefaultProfanities = []string{
"fudgepacker",
"flange",
"gtfo",
"gyat",
"hoe", // while that's also a tool, I doubt somebody would be checking for profanities if that tool was relevant
"horny",
"incest",
Expand Down

0 comments on commit 9fd1d22

Please sign in to comment.