markov_text: Generate a first-order Markov chain Shakespearean sonnet

View source: R/markov_text.R

markov_textR Documentation

Generate a first-order Markov chain Shakespearean sonnet

Description

The transition probability matrix is estimated from all 154 sonnets

Usage

markov_text(text_data, P = NULL, wordsPerLine = 10, numLines = 14)

Arguments

text_data

the object returned from observe_text(), a list containing wordChain, encodedChain, and stateSpace

P

the probability transition matrix, if not passed will be estimated from the sonnet_data dataset

wordsPerLine

the number of words per line

numLines

the number of lines

Value

string/character


shill1729/markovChains documentation built on April 24, 2022, 11:50 a.m.