ngrammer
Perform frequency analysis on a js code string
Uses nlp-compromise with nlp-ngram
Installation
node.js
Install using npm:
$ npm install ngrammer
Examples
Node.JS
const ngrammer = ;const fs = ;const fileContents = fs; /* options: - minCount: minimum gram frequency, default: 10 - maxSize: max gram count, default: 3*/const ngram = /* [ [ { word: 'someword', count: 100, size: 1 }, { word: 'another', count: 90, size: 1 }, { word: 'etc', count: 80, size: 1 }, ... ], [ { word: 'two words', count: 30, size: 2 }, { word: 'some more', count: 20, size: 2 }, { word: 'etc etc', count: 10, size: 2 }, ... ], ... ]*/
Testing
To run the tests:
$ npm test
Contributing
Feel free to create a pull request.
License
MIT - see LICENSE