![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
isprofanity
Advanced tools
A profanity checker which, unlike alternatives, uses the Wagner–Fischer algorithm in order to catch variations that you haven't thought of.
A profanity checker which, unlike alternatives, uses the Wagner–Fischer algorithm in order to catch variations that you haven't thought of.
Installation is very simple due to isProfanity being on NPM. Simply type: npm install isprofanity
from a console in the project directory then add var isprofanity = require('isprofanity');
to the top of your project file.
##Usage There is only one function in isProfanity. Calling it is a simple as typing:
isprofanity(s,function(t){
// t will equal true if it contains a swear word and false if not
});
's' being the string that you want to check for profanity and 't' being the boolian callback.
For a full example usage, you can try out the following code, setting 's' as a string that you would like to test.
var s = "You absolute vanker";//misspelling of 'wanker' which would be allowed by most filters...
isprofanity(s ,function(t){
b = t ? 'contains' : 'does not contain';
console.log('"'+s+'" '+b+' profanity');
process.exit();
});
##Advance Usage ###Setting custom lists isProfanity also contains the abilty to pass custom csv files for both profanity and exceptions. You can do this like so:
isprofanity(s,function(t){
// t will equal true if it contains a swear word and false if not
},'data/profanity.csv','data/exceptions.csv');
While an exceptions file is not needed to replace the profanity list, it is recomended as some words do get flagged that are not swear words. (A notable example in the default set is 'while')
###Get an array of the words that were blocked I added this to help find exceptions although it could be useful in other cases too. In order to get this array, simply use the following:
isprofanity(s,function(t,blocked){
// t will equal true if it contains potential profanity and false if not
// blocked will be an array of the blocked words, how sure it is about them and what word they are closest to.
});
If you find any false positives, please share them.
Follow me on twitter (@MVD_Vandie) or on github in order to keep track of my projects and releases.
Enjoy. :D
FAQs
A profanity checker which, unlike alternatives, uses the Wagner–Fischer algorithm in order to catch variations that you haven't thought of.
We found that isprofanity demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.