next-after-n
v1.0.0
Published
count what follows each n-gram in some list `corpus` with vanilla JS objects
Downloads
3
Readme
next-after-n
count what follows each n-gram in some list corpus
with vanilla JS objects
example
var nextafter = require('next-after-n')
var noises = [
'beep'
, 'beep'
, 'beep'
, 'beep'
, 'snark'
]
var nexts = nextafter(noises, 2)
// what tends to follow each 2-gram?
console.log(nexts)
// {
// 'beep,beep': {
// beep: 2,
// snark: 1,
// },
// }
install
npm i next-after-n
license
BSD