Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michaelwp/word-frequency
javascript library for counting and grouping words number of words in a sentences
https://github.com/michaelwp/word-frequency
Last synced: 6 days ago
JSON representation
javascript library for counting and grouping words number of words in a sentences
- Host: GitHub
- URL: https://github.com/michaelwp/word-frequency
- Owner: michaelwp
- Created: 2020-04-30T04:46:32.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-26T12:57:55.000Z (over 4 years ago)
- Last Synced: 2024-04-25T23:20:25.770Z (10 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# words-frequency
module for helping to group and count number of words in a sentence## version history
* ##### v1.0.0 - the very first version
```
Hello World :)
```* ##### v1.1.0 - minor changes
```
1. improve code
2. Add total of words in result form
```## How To Use
``` npm i words-frequency --save ```
```javascript
//
const wordsFrequency = require('words-frequency');// :
const sentencesEx = 'RegExr was created by gskinner.com, and is proudly hosted by Media Temple. Edit the Expression & Text to see matches. Roll over matches or the expression for details. PCRE & JavaScript flavors of RegEx are supported. Validate your expression with Tests mode. The side bar includes a Cheatsheet, full Reference, and Help. You can also Save & Share with the Community, and view patterns you create or favorite in My Patterns. Explore results with the Tools below. Replace & List output custom results. Details lists capture groups. Explain describes your expression in plain English !'const groupOfSentences = wordsFrequency(sentencesEx);
console.log(groupOfSentences);```
### result :
```
{
total: 91,
data : {
a: 1,also: 1,and: 3,are: 1,
bar: 1,below: 1,by: 2,
can: 1,capture: 1,cheatsheet: 1,com: 1,community: 1,create: 1,created: 1,custom: 1,
describes: 1,details: 2,
edit: 1,english: 1,explain: 1,explore: 1,expression: 4,
favorite: 1,flavors: 1,for: 1,full: 1,
groups: 1,gskinner: 1,
help: 1,hosted: 1,
in: 2,includes: 1,is: 1,
javascript: 1,
list: 1,lists: 1,
matches: 2,media: 1,
mode: 1,my: 1,
of: 1,or: 2,output: 1,over: 1,
patterns: 2,pcre: 1,plain: 1,proudly: 1,
reference: 1,regex: 1,regexr: 1,replace: 1,results: 2,roll: 1,
save: 1,see: 1,share: 1,side: 1,supported: 1,
temple: 1,tests: 1,text: 1,the: 5,to: 1,tools: 1,
validate: 1,view: 1,
was: 1,with: 3,
you: 2,your: 2
}
}
```