Support profanity levels #1

Open
opened 2018-11-11 13:43:42 -05:00 by TwiN · 1 comment
TwiN commented 2018-11-11 13:43:42 -05:00 (Migrated from github.com)

Add support for multiple level of profanity detection.

e.g.

func IdProfane(s string, level int) bool {
    // ...
}

func IsProfane(s string) bool {
    return IsProfane(s, 1)
}

Where

level description example
1 low filter fuck, bitch
2 moderate filter boobs, ass
3 strict filter adult, blood, period

* Level 2 inherits from level 1 and level 3 inherits from level 2

Note that the strict filter would have a lot of false positive, but its goal would be to prevent as much bad things from getting by as possible, even at the cost of those false positives.

The point here is that by default, the level 1 filter should be used, but if you don't trust where the strings are coming from at all, then you can scale the filter's strictness based on the level of trust.

Add support for multiple level of profanity detection. e.g. ```go func IdProfane(s string, level int) bool { // ... } func IsProfane(s string) bool { return IsProfane(s, 1) } ``` Where | level | description | example | | ---- | ---- | ---- | | 1 | low filter | `fuck`, `bitch` | | 2 | moderate filter | `boobs`, `ass` | | 3 | strict filter | `adult`, `blood`, `period` | \* _Level 2 inherits from level 1 and level 3 inherits from level 2_ Note that the strict filter would have **a lot** of false positive, but its goal would be to prevent as much bad things from getting by as possible, even at the cost of those false positives. The point here is that by default, the level 1 filter should be used, but if you don't trust where the strings are coming from at all, then you can scale the filter's strictness based on the level of trust.
quackduck commented 2022-04-21 00:47:50 -04:00 (Migrated from github.com)

You could even let users censor based on the kind of profanity: hateful speech, simple vulgarity, etc. like https://github.com/finnbear/rustrict/blob/master/src/profanity.csv does.

You could even let users censor based on the kind of profanity: hateful speech, simple vulgarity, etc. like https://github.com/finnbear/rustrict/blob/master/src/profanity.csv does.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
TwiN/go-away#1
No description provided.