What does it do?
It creates messages from messages it ‘learns’ using a Markov Chain
See: Markov chain - Wikipedia
Markov Chains are used by everyday electronics like Phones,
you know how phones can predict what you are about to write, that uses Markov Chains
Markov Chains create sentences using the connections between words.
A Markov Chain can be used in all kinds of things such as filling a book with random text from a dataset, automatically generating multi word names and much more!
Sample Usage
local Markov = require(path.to.module)
local MarkovObject = Markov:New()
MarkovObject:Learn("text you want to teach to the module goes here")
MarkovObject:Learn("even more text goes here wow")
local TextOutput = MarkovObject:Generate()
The module might not always generate sensible text and might create inappropriate text combinations so remember to filter all generated text
Documentation
Markov:New()
-- Creates new Markov Object Instance
MarkovObject:Generate(MinLength, MaxLength, Seed)
-- Min and Max Length represent the minimum and maximum output length in words respectively
-- Seed is used to choose the first word from which to use to generate
-- All parameters in Generate are optional
MarkovObject:Learn(String)
-- Teaches the Markov chain how the words interact
Changelog
October 30th 2020
- Fixed issue where the Markov Chain would attempt to generate as long of a sentence as possible and never stopping where it should
Script File:
Markov.lua (2.4 KB)
Roblox Link:
https://www.roblox.com/library/2845226312/The-Chain-Implementation
Sample Place:
https://www.roblox.com/games/2844976671/mrkv-chain-implementation
Github: