sentence: Sentence style identifiers

Description Usage Arguments Author(s) Examples

View source: R/sentence.R

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)

richfitz/ids documentation built on July 21, 2019, 5:16 a.m.