markovify_text: Markovify text

View source: R/markovify.R

markovify_textR Documentation

Markovify text

Description

Produces text output from a markov model based pn user specified parameters

Usage

markovify_text(
  markov_model,
  maximum_sentence_length = NULL,
  start_words = NULL,
  output_column_name = "columnName",
  count = 50,
  tries = 100,
  only_distinct = TRUE,
  return_message = TRUE
)

Arguments

markov_model

a markov model produced from generate_markovify_model

maximum_sentence_length

the maximum length of the sentence if NULL model will produce a random sentence of any length.

start_words

a markov model produced with a list of start word terms

output_column_name

name of the

count

count of the number of sentences, default 50

tries

count of the number of tries to produce a coherent sentence

only_distinct

if TRUE returns only distinct text

return_message

if TRUE returns a message

Value

a tibble

Examples

## Not run: 
library(dplyr)
library(markovifyR)
data("linneman_lessons")
df <- linneman_lessons
lessons <- df %>% pull(textLesson)
markov_model <-
generate_markovify_model(
input_text = lessons,
markov_state_size = 2L,
max_overlap_total = 15,
max_overlap_ratio = .8)

markovify_text(
markov_model = markov_model,
count = 100,
maximum_sentence_length = 1500L,
output_column_name = 'linnemanBotText',
tries = 100,
only_distinct = TRUE,
return_message = TRUE
)

## End(Not run)

abresler/markovifyR documentation built on July 19, 2023, 7:06 p.m.