Skip to main content

word Domain

The word domain maps domain keywords to underlying faker implementations.

Faker Documentation

Methods

word.adjective

Returns a random adjective.

ArgTypeRequiredDescription
lengthnumbernoDesired length of the generated value.
maxnumbernoMaximum bound used when generating a value.
valuenumbernoLegacy shorthand for target word length. Prefer the length option.
strategystringnoThe strategy to apply when no words with a matching length are found. Available error handling strategies: fail: Throws an error if no words with the given length are found. shortest: Returns any of the shortest words. closest: Returns any of the words closest to the given length. longest: Returns any of the longest words. any-length: Returns a word with any length.

Examples:

word.adjective()
word.adjective(length=1, max=1, value=1, strategy="any-length")

Example return values:

  • "agile"
  • "oval"

word.adverb

Returns a random adverb.

ArgTypeRequiredDescription
lengthnumbernoDesired length of the generated value.
maxnumbernoMaximum bound used when generating a value.
valuenumbernoLegacy shorthand for target word length. Prefer the length option.
strategystringnoThe strategy to apply when no words with a matching length are found. Available error handling strategies: fail: Throws an error if no words with the given length are found. shortest: Returns any of the shortest words. closest: Returns any of the words closest to the given length. longest: Returns any of the longest words. any-length: Returns a word with any length.

Examples:

word.adverb()
word.adverb(length=1, max=1, value=1, strategy="any-length")

Example return values:

  • "triumphantly"
  • "blindly"

word.conjunction

Returns a random conjunction.

ArgTypeRequiredDescription
lengthnumbernoDesired length of the generated value.
maxnumbernoMaximum bound used when generating a value.
valuenumbernoLegacy shorthand for target word length. Prefer the length option.
strategystringnoThe strategy to apply when no words with a matching length are found. Available error handling strategies: fail: Throws an error if no words with the given length are found. shortest: Returns any of the shortest words. closest: Returns any of the words closest to the given length. longest: Returns any of the longest words. any-length: Returns a word with any length.

Examples:

word.conjunction()
word.conjunction(length=1, max=1, value=1, strategy="any-length")

Example return values:

  • "consequently"

word.interjection

Returns a random interjection.

ArgTypeRequiredDescription
lengthnumbernoDesired length of the generated value.
maxnumbernoMaximum bound used when generating a value.
valuenumbernoLegacy shorthand for target word length. Prefer the length option.
strategystringnoThe strategy to apply when no words with a matching length are found. Available error handling strategies: fail: Throws an error if no words with the given length are found. shortest: Returns any of the shortest words. closest: Returns any of the words closest to the given length. longest: Returns any of the longest words. any-length: Returns a word with any length.

Examples:

word.interjection()
word.interjection(length=1, max=1, value=1, strategy="any-length")

Example return values:

  • "duh"
  • "yuck"

word.noun

Returns a random noun.

ArgTypeRequiredDescription
lengthnumbernoDesired length of the generated value.
maxnumbernoMaximum bound used when generating a value.
valuenumbernoLegacy shorthand for target word length. Prefer the length option.
strategystringnoThe strategy to apply when no words with a matching length are found. Available error handling strategies: fail: Throws an error if no words with the given length are found. shortest: Returns any of the shortest words. closest: Returns any of the words closest to the given length. longest: Returns any of the longest words. any-length: Returns a word with any length.

Examples:

word.noun()
word.noun(length=1, max=1, value=1, strategy="any-length")

Example return values:

  • "freezing"
  • "stump"

word.preposition

Returns a random preposition.

ArgTypeRequiredDescription
lengthnumbernoDesired length of the generated value.
maxnumbernoMaximum bound used when generating a value.
valuenumbernoLegacy shorthand for target word length. Prefer the length option.
strategystringnoThe strategy to apply when no words with a matching length are found. Available error handling strategies: fail: Throws an error if no words with the given length are found. shortest: Returns any of the shortest words. closest: Returns any of the words closest to the given length. longest: Returns any of the longest words. any-length: Returns a word with any length.

Examples:

word.preposition()
word.preposition(length=1, max=1, value=1, strategy="any-length")

Example return values:

  • "over"
  • "circa"

word.sample

Returns a random word, that can be an adjective, adverb, conjunction, interjection, noun, preposition, or verb.

ArgTypeRequiredDescription
lengthnumbernoDesired length of the generated value.
maxnumbernoMaximum bound used when generating a value.
valuenumbernoLegacy shorthand for target word length. Prefer the length option.
strategystringnoThe strategy to apply when no words with a matching length are found. Available error handling strategies: fail: Throws an error if no words with the given length are found. shortest: Returns any of the shortest words. closest: Returns any of the words closest to the given length. longest: Returns any of the longest words. any-length: Returns a word with any length.

Examples:

word.sample()
word.sample(length=1, max=1, value=1, strategy="any-length")

Example return values:

  • "smarten"
  • "tidy"

word.verb

Returns a random verb.

ArgTypeRequiredDescription
lengthnumbernoDesired length of the generated value.
maxnumbernoMaximum bound used when generating a value.
valuenumbernoLegacy shorthand for target word length. Prefer the length option.
strategystringnoThe strategy to apply when no words with a matching length are found. Available error handling strategies: fail: Throws an error if no words with the given length are found. shortest: Returns any of the shortest words. closest: Returns any of the words closest to the given length. longest: Returns any of the longest words. any-length: Returns a word with any length.

Examples:

word.verb()
word.verb(length=1, max=1, value=1, strategy="any-length")

Example return values:

  • "graft"
  • "banish"

word.words

Returns a random string containing some words separated by spaces.

ArgTypeRequiredDescription
countnumbernoNumber of items to generate.
maxnumbernoMaximum bound used when generating a value.
valuenumbernoLegacy shorthand for number of words to generate. Prefer the count option.

Examples:

word.words()
word.words(count=1, max=1, value=1)

Example return values:

  • "sternly which"
  • "while approach though"