Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading