Skip to content
/ mark Public

A basic Markov chain implementation for text generation for Node.js

Notifications You must be signed in to change notification settings

seishun/mark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Mark

A basic Markov chain implementation for text generation for Node.js

Markov.py port (part of the Talho project https://github.com/eurekafag/Talho/blob/master/modules/markov.py)

How to use

var markov = new (require('mark'))('mongodb://user:password@alex.mongohq.com:port/db');

Adding words:

markov.addWords(string, callback);

markov.addWords('The quick brown fox jumps over the lazy dog', function(result){
  //callback function for error handling
});

You must feed it full sentences for best results.

Building chain:

markov.buildChain(length, callback);

markov.buildChain(10, function(result){
  //callback function that will display or handle result
});

About

A basic Markov chain implementation for text generation for Node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published