View Source Wordnik.Words.RandomWord (Wordnik v1.0.0)

get random word

Wordnik Docs

Link to this section Summary

Types

parsed JSON response to get_random_word/1 query

map of optional parameters that can be passed to get_random_word/1 query

Functions

get random_word for requested word

Link to this section Types

@type random_word() :: %{id: integer(), word: String.t()}

parsed JSON response to get_random_word/1 query

@type random_word_params() :: %{
  optional(:has_dictionary_def) => boolean(),
  optional(:include_part_of_speech) => Formatter.Enums.include_part_of_speech(),
  optional(:exclude_part_of_speech) => Formatter.Enums.exclude_part_of_speech(),
  optional(:min_corpus_count) => integer(),
  optional(:max_corpus_count) => integer(),
  optional(:min_dictionary_count) => integer(),
  optional(:max_dictionary_count) => integer(),
  optional(:min_length) => integer(),
  optional(:max_length) => integer()
}

map of optional parameters that can be passed to get_random_word/1 query

Link to this section Functions

Link to this function

get_random_word(params \\ %{})

View Source
@spec get_random_word(random_word_params()) ::
  {:error, String.t()} | {:ok, random_word()}

get random_word for requested word

parameters

Parameters

  • has_dictionary_def: boolean
  • include_part_of_speech: string
  • exclude_part_of_speech: string
  • min_corpus_count: integer
  • max_corpus_count: integer
  • min_dictionary_count: integer
  • max_dictionary_count: integer
  • min_length: integer
  • max_length: integer

example

Example

iex> get_random_word( %{has_dictionary_def: true, min_length: 5})

response

Response

t:Words.RandomWord.random_word/0

wordnik-docs

Wordnik Docs

https://developer.wordnik.com/docs#!/word/getRandomWord