NodeJS module for word analytics
$ npm install woa
// example.js
import woa from 'woa';
const text = `What is love?
Baby, don't hurt me
Don't hurt me no more`;
const keywords = ['hurt', 'baby', 'oh'];
const result = woa({text, keywords});
console.log(result);
The result will be something like this:
{
"hurt": 0.16666666666666666,
"baby": 0.08333333333333333,
"oh": "n/a"
}
I stumbled upon the necessity of a tool that simplifies comments processing; I just want to make easy the analysis of any text.
woa helps you to discover and count patterns in text using the power of Node. It's written in pure Javascript, blazing fast and easy to use.
Would you like to try it out?
Generate a JSON with the percent occurrence of each keyword in a text.
config
an Object containing these parameters:
-
text
The text to be processed. Must be a String containing Text to be processed. -
keywords
optional word or list of words to count in a text. Must be a String or an Array of Strings.
Since woa is super simple, tests are super simple too:
$ npm test
Feel free to fork and create a Pull Request with new features or an improvement of the current ones.
MIT License ©️ 2017 Jobsamuel Núñez