
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
string-analysis
Advanced tools
A combined experience of sentiment analysis, bad-word detection and filteration with power to get adjectives, nouns and verbs from a string.
A combined experience of sentiment analysis, bad-word detection and filteration with power to get adjectives, nouns and verbs from a string.
npm i string-analysis
const Analyze = require('string-analysis');
const analyze = new Analyze();
console.log(analyze.analyzeEmotion("I am testing this package"))
// { analysis: 0, intensity: { neg: 0, neu: 1, pos: 0, compound: 0 } }
Intensity cleary states, negative, neutral, positive and compound ratio in a sentence
var Analyze = require('string-analysis');
var analyze = new Analyze({
adjectives: ["bashful"], // optional
nouns: ["car"], // optional
verbs: ["some verbs"] //optional
});
var Analyze = require('string-analysis');
var analyze = new Analyze();
analyze.getNouns("sentence") // returns words array
var Analyze = require('string-analysis');
var analyze = new Analyze();
analyze.getAdjectives("sentence") // returns words array
var Analyze = require('string-analysis');
var analyze = new Analyze();
analyze.getVerbs("sentence") // returns words array
var Analyze = require('string-analysis'),
analyze = new Analyze();
console.log(analyze.clean("Don't be an ash0le")); //Don't be an ******
var Analyze = require('string-analysis');
var analyze = new Analyze({ placeHolder: 'x'});
analyze.clean("Don't be an ash0le"); //Don't be an xxxxxx
var analyze = new Analyze({ regex: /\*|\.|$/gi });
var analyze = new Analyze({ replaceRegex: /[A-Za-z0-9가-힣_]/g });
//multilingual support for word filtering
var analyze = new Analyze();
analyze.addWords('some', 'bad', 'word');
analyze.clean("some bad word!") //**** *** ****!
//or use an array using the spread operator
var newBadWords = ['some', 'bad', 'word'];
analyze.addWords(...newBadWords);
analyze.clean("some bad word!") //**** *** ****!
//or
var analyze = new Analyze({ list: ['some', 'bad', 'word'] });
analyze.clean("some bad word!") //**** *** ****!
var analyze = new Analyze({ emptyList: true });
analyze.clean('hell this wont clean anything'); //hell this wont clean anything
let analyze = new Analyze();
analyze.removeWords('hells', 'sadist');
analyze.clean("some hells word!"); //some hells word!
//or use an array using the spread operator
let removeWords = ['hells', 'sadist'];
analyze.removeWords(...removeWords);
analyze.clean("some sadist hells word!"); //some sadist hells word!
let analyze = new Analyze();
analyze.getBadWords("Some words that I cannot type here");
// ["","",""]
Used and tweaked code from https://www.npmjs.com/package/bad-words as per The MIT License (MIT)
For support, connect with me on Linkedin (https://www.linkedin.com/in/lazycoderr) or twitter (https://twitter.com/lazycoderr).
FAQs
A combined experience of sentiment analysis, bad-word detection and filteration with power to get adjectives, nouns and verbs from a string.
The npm package string-analysis receives a total of 0 weekly downloads. As such, string-analysis popularity was classified as not popular.
We found that string-analysis 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.