0.2.2 • Published 6 years ago

getoccurencesintext v0.2.2

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

getOccurencesInText

The module getOccurencesInText count the words occurence in a text. It ommit the words with less than three caracters by default.

Install

$ npm i getoccurencesintext

Usage

You can use it like this:

const { getOccurencesInText } = require('getoccurencesintext');
getOccurencesInText('Hello hello, and nice to meet you'); // by default the function is case sensitive

/* 
result: {
and: 1,
hello: 1,
Hello: 1,
meet: 1,
nice: 1,
you: 1
}
*/

If you want to deactivate the case sensitive option :

getOccurencesInText('Hello hello, and nice to meet you', false);

/* 
result: {
and: 1,
hello: 2,
meet: 1,
nice: 1,
you: 1
}
*/

If you want to ommit words with less than four caracters :

getOccurencesInText('Hello hello, and nice to meet you', true, 4);

/* 
result: {
and: 1,
hello: 2,
meet: 1,
nice: 1,
you: 1
}
*/
0.2.2

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago