Allow different dictionaries #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "allow_different_dictionaries"
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?
This PR is related with the issue #16.
So I created a new functional function to enable a way where you can load different
profanities,falseNegativesandfalsePositivesin this way this library will be more versatile, also I modified the test related and the READMENicely done @sp-adrian-perez, and thank you for your contribution!
Could you export the default dictionary arrays (i.e.
defaultProfanities->DefaultProfanities, etc.)?My reasoning behind that is, what if somebody just wants to add a single word to the default dictionary? By making these variables, they'll be able to (e.g.
WithCustomDictionary(append(goaway.DefaultProfanities, "badword"), ...)).Yes of course, sorry for the delay on answer you I'm a little bit busy these days, so the idea is maintain also the
WithCustomDictionaryfunction and add export the defaults right?No problem :)
And yes, all you have to do is change the first character of the default dictionaries (e.g.
defaultProfanities) from lowercase to uppercase (DefaultProfanities).Perfect!! done :)
Just a few little changes and I think we're good to go
@ -1,14 +1,14 @@package goaway@ -61,0 +74,4 @@g.falseNegatives = falseNegativesg.falsePositives = falsePositivesreturn g@ -70,3 +89,3 @@}// Remove false positivesfor _, word := range falsePositives {for _, word := range g.falsePositives {@ -1,9 +1,9 @@package goawayCodecov Report
100.00% <100.00%> (ø)Continue to review full report at Codecov.
@sp-adrian-perez Thank you for your contribution!
Released in v1.2.0
By the way, I swapped the order for the false positive and false negative order, so the order is now the following: