0.2.0 • Published 6 years ago

cheap-dream v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

cheap-dream

build status coverage status

generate images, text or audio with a Markov chain

Installation

$ npm install cheap-dream

API

parseText(text) ⇒ Object

Parses a string to a model that can be used to generate a new text.

Kind: global function Returns: Object - The model to be used with generateText

ParamTypeDescription
textstringThe text to parse

generateText(model, options) ⇒ string

Generates a new text from the model

Kind: global function Returns: string - The new text

ParamTypeDefaultDescription
modelObjectThe model generated with parseText
optionsObjectConfiguration options
options.maxTriesnumber100The maximum amount of attempts
options.startWithstringThe string to start with, random by default
options.endWithfunctionFunction that will be called with the current word, return true to end

parseImage(image) ⇒ Object

Parses an ndarray to a model that can be used to generate a new image.

Kind: global function Returns: Object - The model to be used with generateImage

ParamTypeDescription
imagendarrayThe image to parse

generateImage(model, options) ⇒ ndarray

Generates a new image from the model

Kind: global function Returns: ndarray - The new image

ParamTypeDescription
modelObjectThe model generated with parseImage
optionsObjectConfiguration options
options.widthnumberThe width of the output image
options.heightnumberThe width of the output image
options.startWithArrayThe color to start with, array with red, green, blue
options.endWithfunctionFunction that will be called with the current color, return true to end

License

MIT

0.2.0

6 years ago

0.1.0

6 years ago