fix: fix SensitiveWords error

This commit is contained in:
CaIon
2024-03-21 14:29:56 +08:00
parent 8b96117839
commit a5088f5e23
4 changed files with 23 additions and 13 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ func SensitiveWordReplace(text string, returnImmediately bool) (bool, []string,
for _, hit := range hits {
pos := hit.Pos
word := string(hit.Word)
text = text[:pos] + "*###*" + text[pos+len(word):]
text = text[:pos] + "**###**" + text[pos+len(word):]
words = append(words, word)
}
return true, words, text