sentence: Sentence style identifiers

Description Usage Arguments Author(s) Examples

Description

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.

Usage

1
sentence(n = 1, style = "snake", past = FALSE)

Arguments

n

number of ids to return. If NULL, it instead returns the generating function

style

Style to join words with. Can be one of "Pascal", "camel", "snake", "kebab", "dot", "title", "sentence", "lower", "upper", and "constant".

past

Use the past tense for verbs (e.g., slurped or jogged rather than slurping or jogging)

Author(s)

Rich FitzJohn

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Generate an identifier
sentence()

# Generate a bunch
sentence(10)

# As with adjective_animal, use "style" to control punctuation
sentence(style = "Camel")
sentence(style = "dot")
sentence(style = "Title")

# Change the tense of the verb:
set.seed(1)
sentence()
set.seed(1)
sentence(past = TRUE)

# Pass n = NULL to bind arguments to a function
id <- sentence(NULL, past = TRUE, style = "dot")
id()
id(10)

Example output

[1] "8_unkempt_donkeys_twisting_lazily"
 [1] "26_flippant_pumas_marching_oddly"          
 [2] "27_fancy_sprites_meandering_noisily"       
 [3] "25_courageous_sprites_wobbling_awkwardly"  
 [4] "25_dazzling_lizards_wandering_reassuringly"
 [5] "13_enthralling_porcupines_swimming_sweetly"
 [6] "22_giddy_takins_singing_zestfully"         
 [7] "3_gentle_bulls_clamoring_clumsily"         
 [8] "29_brave_giraffes_prancing_angrily"        
 [9] "29_rambunctious_warthogs_chewing_bleakly"  
[10] "31_sassy_cougars_squiggling_sheepishly"    
[1] "2AttractiveSnakesBurstingAwkwardly"
[1] "20.gorgeous.pegasuses.driving.purposefully"
[1] "29 Rambunctious Seals Clamoring Cluelessly"
[1] "10_enormous_moles_whistling_daintily"
[1] "10_enormous_moles_whistled_daintily"
[1] "30.unkempt.pandas.slogged.bleakly"
 [1] "8.thundering.kangaroos.traveled.knottily"       
 [2] "7.clever.moose.slurped.stealthily"              
 [3] "23.industrious.koalas.swam.joyously"            
 [4] "14.brave.cougars.sang.drudgingly"               
 [5] "26.curious.skunks.rushed.boastfully"            
 [6] "17.enthralling.panthers.swam.briskly"           
 [7] "24.adventurous.rhinoceroses.assembled.furiously"
 [8] "33.entertaining.bunnies.pranced.lovingly"       
 [9] "14.shaggy.ponies.squirmed.politely"             
[10] "26.eager.hogs.spurted.inquisitively"            

ids documentation built on May 2, 2019, 2:08 a.m.