View Source Wordnik.Words.RandomWords (Wordnik v1.0.1)

get random_words

Wordnik Docs

Link to this section Summary

Types

parsed JSON response to get_random_words/1 query

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

Functions

get random_words for requested word

Link to this section Types

@type random_words() :: [Words.RandomWord.random_word()]

parsed JSON response to get_random_words/1 query

@type random_words_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(),
  optional(:sort_by) => Formatter.Enums.sort_by(),
  optional(:sort_order) => Formatter.Enums.sort_order()
}

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

Link to this section Functions

Link to this function

get_random_words(params \\ %{})

View Source
@spec get_random_words(random_words_params()) ::
  {:error, String.t()} | {:ok, random_words()}

get random_words 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
  • limit: integer
  • sort_by: string
  • sort_order: string

example

Example

iex> get_random_words(%{has_dictionary_def: true, sort_by: "alpha", sort_order: "asc"})

response

Response

Wordnik.Words.RandomWords.random_words/0

wordnik-docs

Wordnik Docs

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