Skip to content

Instantly share code, notes, and snippets.

@vjcitn
Created May 18, 2024 14:42
Show Gist options
  • Save vjcitn/1db3097d26d634cb5e366f725c7e4bf7 to your computer and use it in GitHub Desktop.
Save vjcitn/1db3097d26d634cb5e366f725c7e4bf7 to your computer and use it in GitHub Desktop.
make silly sentences
nouns = c("cat", "mat", "cow", "chair", "table", "person", "food")
pastverbs = c("sat", "walked", "rode", "spent", "moved", "wrote", "managed", "went")
preps = c("on", "over", "beyond", "above", "beneath")
indic = c("the", "a", "any", "some")
adjectives = c("cute", "big", "small", "tiny", "huge", "green")
get1 = function (x) sample(x, size=1)
sentence = function() {
sprintf("%s %s %s %s %s %s %s\n", get1(indic), get1(nouns), get1(pastverbs),
get1(preps), get1(indic), get1(adjectives), get1(nouns))
}
sentence()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment