Skip to content

seangibat/ngram-markov

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Usage:

var ngram = require('simple-ngram-markov');

var options = {
  length: 2, // ngram size; default is 2
  stripPunctuation: true // default is true
};

var model = ngram.createModel(options);

ngram.addSentenceToModel(model, "Hey, what the heck is up man.");
ngram.addSentenceToModel(model, "Honestly I really just don't believe it. Simply.");

var sentence = ngram.generateSentence(model, 10); // 10 is the desired length of the sentence

About

A simple and fast module for creating and adding to ngram models and generating markov chains using these models.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published