Skip to content

Commit 9fd1d22

Browse files
authored
fix: Add gyat to DefaultProfanities (#96)
1 parent 1e1dd1f commit 9fd1d22

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

falsenegatives.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package goaway
44
//
55
// This is reserved for words that may be incorrectly filtered as false positives.
66
//
7-
// Alternatively, words that are long, or that should mark a string as profane no what the context is
7+
// Alternatively, words that are long, or that should mark a string as profane no matter what the context is
88
// or whether the word is part of another word can also be included.
99
//
1010
// Note that there is a test that prevents words from being in both DefaultProfanities and DefaultFalseNegatives,

goaway_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ func TestProfanityDetector_Censor(t *testing.T) {
150150
expectedOutput: "document **** document ****",
151151
expectedOutputWithoutSpaceSanitization: "document **** document ****",
152152
},
153+
{
154+
input: "Everyone was staring, and someone muttered ‘gyat’ under their breath.",
155+
expectedOutput: "Everyone was staring, and someone muttered ‘****’ under their breath.",
156+
expectedOutputWithoutSpaceSanitization: "Everyone was staring, and someone muttered ‘****’ under their breath.",
157+
},
153158
}
154159
for _, tt := range tests {
155160
t.Run("default_"+tt.input, func(t *testing.T) {

profanities.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ var DefaultProfanities = []string{
4141
"fudgepacker",
4242
"flange",
4343
"gtfo",
44+
"gyat",
4445
"hoe", // while that's also a tool, I doubt somebody would be checking for profanities if that tool was relevant
4546
"horny",
4647
"incest",

0 commit comments

Comments
 (0)