View Source Wordnik.Word.Examples (Wordnik v1.0.1)

examples for a given word

Wordnik Docs

Link to this section Summary

Types

parsed JSON response of word usage example

parsed JSON response to get_examples/2 query

map of optional parameters that can be passed to get_examples/2 query

Functions

get examples for requested word

Link to this section Types

@type example() :: %{
  provider: %{id: integer()},
  year: integer(),
  rating: integer(),
  url: String.t(),
  word: String.t(),
  text: String.t(),
  documentId: integer(),
  exampleId: integer(),
  title: String.t()
}

parsed JSON response of word usage example

@type examples() :: %{examples: [example()]}

parsed JSON response to get_examples/2 query

@type examples_params() :: %{
  optional(:use_canonical) => boolean(),
  optional(:include_duplicates) => boolean(),
  optional(:limit) => integer(),
  optional(:skip) => integer()
}

map of optional parameters that can be passed to get_examples/2 query

Link to this section Functions

Link to this function

get_examples(word, params \\ %{})

View Source
@spec get_examples(String.t(), examples_params()) ::
  {:error, String.t()} | {:ok, examples()}

get examples for requested word

parameters

Parameters

  • use_canonical: boolean
  • include_duplicates: boolean
  • limit: integer
  • skip: integer

example

Example

iex> get_examples("verbose", %{use_canonical: true, limit: 5})

response

Response

Wordnik.Word.Examples.examples/0

wordnik-docs

Wordnik Docs

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