markov
Markov Chain module. Responsible for automatically replying to summons and replies by using a Markov chain to generate content
- markov
- static
- inner
- ~loadCorpus()
- ~markovPost() ⇒
string
- ~randomIntFromInterval(min, max) ⇒
number
markov.name
Name of the module
Kind: static property of markov
markov.priority
Priority of the module
Kind: static property of markov
markov.version
Module version
Kind: static property of markov
markov.description
Description of the module
Kind: static property of markov
markov.configuration
Configuration properties.
Kind: static property of markov
Properties
Name | Description |
---|---|
enabled | Whether to use Markov or not. Defaults to false. |
corpus | The location of the corpus file to use; must be a plan text file. Defaults to markov/corpus.txt; note that this file is part of the GitHub repo, and is liable to be replaced if you pull changes. |
markov.begin(browser, config)
Bootstrap the module.
Kind: static method of markov
Param | Type | Description |
---|---|---|
browser | object |
The Discourse interface object |
config | object |
The SockBot config object |
markov.onNotify(type, notification, topic, post, callback)
Handle received notifications.
Kind: static method of markov
Param | Type | Description |
---|---|---|
type | object |
The type of notification received |
notification | object |
An object representing the notification that was received |
topic | object |
An object representing the topic that the notification was about |
post | object |
An object representing the post that the notification was about |
callback | function |
The callback to use once the action is complete |
markov~loadCorpus()
Load the corpus to use.
Kind: inner method of markov
markov~markovPost() ⇒ string
Generate post content using the Markov chain.
Kind: inner method of markov
Returns: string
- The post content
markov~randomIntFromInterval(min, max) ⇒ number
Generate a random number in the specified range.
Kind: inner method of markov
Returns: number
- The generated number
Param | Type | Description |
---|---|---|
min | number |
The lower bound of the range |
max | number |
The upper bound of the range |