gen_sequence: Generate text sequences with various properties.

View source: R/system_splines.R

gen_sequenceR Documentation

Generate text sequences with various properties.

Description

Generate text sequences with various properties.

Usage

gen_sequence(
  seed = NULL,
  method = "lipsum",
  scale = "sentence",
  n_paragraph = 1,
  n_sentence = 1,
  n_word = 3:5,
  n_chr = 3:8
)

Arguments

seed

random seed for the character sequence.

method

method used for sequence generation

  • lipsum, generate long sentences latin-based text, with the option to subset the text into smaller elements (scale argument).

  • sentence, draw short sentences of comparable length from the Revised List of Phonetically Balanced Sentences Harvard Sentences

  • random, recurvively generate sentences from random length, with words of given size range by randomly sampling letters.

scale

scale of the returned elements, for the lipsum method. Control how the generated text is divided into word, sentence, or paragraph.

n_paragraph, n_sentence, n_word, n_chr

number of elements at each organizational level, i.e. number of paragraphs, sentences, words, and characters. The last two levels can be specified as a vector of length to sample in.

Value

a character string.


picasa/generate documentation built on Feb. 28, 2025, 6:51 a.m.