Create a sentence style identifier. This uses the approach described by Asana on their blog https://blog.asana.com/2011/09/6-sad-squid-snuggle-softly/. This approach encodes 32 bits of information (so 2^32 ~= 4 billion possibilities) and in theory can be remapped to an integer if you really wanted to.
sentence(n = 1, style = "snake", past = FALSE)number of ids to return. If NULL, it instead
returns the generating function
Style to join words with. Can be one of "Pascal", "camel", "snake", "kebab", "dot", "title", "sentence", "lower", "upper", and "constant".
Use the past tense for verbs (e.g., slurped or jogged rather than slurping or jogging)
# Generate an identifier
sentence()
#> [1] "11_astonishing_meerkat_galloping_politely"
# Generate a bunch
sentence(10)
#> [1] "6_eager_chickens_sprinting_courageously"
#> [2] "10_happy_crickets_laughing_drudgingly"
#> [3] "26_courageous_chickens_tumbling_calmly"
#> [4] "15_industrious_weasels_twisting_adventurously"
#> [5] "6_curious_gnomes_chewing_gleefully"
#> [6] "6_giddy_warthogs_wandering_cleverly"
#> [7] "3_gorgeous_peacocks_scurriing_colorfully"
#> [8] "11_delightful_lizards_swimming_oddly"
#> [9] "31_dapper_warthogs_slurping_seriously"
#> [10] "26_sassy_foxes_chewing_loftily"
# As with adjective_animal, use "style" to control punctuation
sentence(style = "Camel")
#> [1] "20SpiffySealsChewingPurposefully"
sentence(style = "dot")
#> [1] "32.quizzical.lizards.skipping.shakily"
sentence(style = "Title")
#> [1] "12 Honorable Rams Driving Foolishly"
# Change the tense of the verb:
set.seed(1)
sentence()
#> [1] "26_gaudy_flamingos_ambling_effortlessly"
set.seed(1)
sentence(past = TRUE)
#> [1] "26_gaudy_flamingos_ambled_effortlessly"
# Pass n = NULL to bind arguments to a function
id <- sentence(NULL, past = TRUE, style = "dot")
id()
#> [1] "30.jazzy.giraffes.flopped.owlishly"
id(10)
#> [1] "28.goofy.skunks.slurped.madly"
#> [2] "20.happy.woodchucks.scampered.urgently"
#> [3] "2.incredible.phoenixes.squirmed.foolishly"
#> [4] "22.daffy.gnomes.hurried.gladly"
#> [5] "22.psychotic.newts.munched.curiously"
#> [6] "11.joyous.dogs.hurried.unabashedly"
#> [7] "23.remarkable.oxes.wandered.unaccountably"
#> [8] "15.obnoxious.dragons.sprinted.madly"
#> [9] "11.daffy.lizards.wade.vainly"
#> [10] "8.cuddly.moles.juggled.fervently"