added the ability to return the offending word #21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I did not want to break the api, so i just updated the calls to wrap the old one, but i'm writing a discord bot that needs a filter like this, but wanted to list the word that was the offense in a log without re looping through.
@ -77,11 +77,18 @@ func (g *ProfanityDetector) WithCustomDictionary(profanities, falsePositives, fa// IsProfane takes in a string (word or sentence) and look for profanities.Would is be possible to rename this to
ExtractProfanityor something similar?Could also just return a string; if the len() of the string returned is > 0, then it pretty much means
truealready.@ -77,11 +77,18 @@ func (g *ProfanityDetector) WithCustomDictionary(profanities, falsePositives, fa// IsProfane takes in a string (word or sentence) and look for profanities.@ -77,11 +77,18 @@ func (g *ProfanityDetector) WithCustomDictionary(profanities, falsePositives, fa// IsProfane takes in a string (word or sentence) and look for profanities.I'm fine with keeping the bool, so just the rename then :)
@ -77,11 +77,18 @@ func (g *ProfanityDetector) WithCustomDictionary(profanities, falsePositives, fa// IsProfane takes in a string (word or sentence) and look for profanities.already done
Codecov Report
100.00% <100.00%> (ø)Continue to review full report at Codecov.
@Luberry Thank you for your contribution!
I'm sorry for going back on my word, but I ended up removing the boolean from
ExtractProfanity- it just didn't make sense to me.If somebody wants to have just the boolean, they can simply use
IsProfane.In any case, this has been released in v1.3.0