Class ROT.StringGenerator
(Markov process)-based string generator.
Copied from a RogueBasin article.
Offers configurable order and prior.
Defined in: <rot.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
ROT.StringGenerator(options)
|
Method Attributes | Method Name and Description |
---|---|
clear()
Remove all learning data
|
|
generate()
|
|
getStats()
|
|
observe(string)
Observe (learn) a string from a training set
|
Class Detail
ROT.StringGenerator(options)
- Parameters:
- {object} options Optional
- {bool} options.words Optional, Default: false
- Use word mode?
- {int} options.order Optional, Default: 3
- {float} options.prior Optional, Default: 0.001
Method Detail
clear()
Remove all learning data
{string}
generate()
- Returns:
- {string} Generated string
getStats()
observe(string)
Observe (learn) a string from a training set
- Parameters:
- string