View Source Wordnik.Word.Definitions (Wordnik v1.0.0)

word definition(s) across various dictionaries

Wordnik Docs

Link to this section Summary

Types

    parsed JSON response to `get_definitions/2` query

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

Functions

get definition(s) for requested word

Link to this section Types

@type definitions() :: [
  %{
    attributionText: String.t(),
    attributionUrl: String.t(),
    citations: [any()],
    exampleUses: [any()],
    extendedText: String.t(),
    labels: [any()],
    notes: [any()],
    partOfSpeech: String.t(),
    relatedWords: [any()],
    score: integer(),
    seqString: String.t(),
    sequence: String.t(),
    sourceDictionary: String.t(),
    text: String.t(),
    textProns: [any()],
    word: String.t()
  }
]
    parsed JSON response to `get_definitions/2` query
@type definitions_params() :: %{
  optional(:use_canonical) => boolean(),
  optional(:include_related) => boolean(),
  optional(:include_tags) => boolean(),
  optional(:limit) => integer(),
  optional(:part_of_speech) => Formatter.Enums.part_of_speech(),
  optional(:source_dictionaries) => Formatter.Enums.source_dictionaries()
}

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

Link to this section Functions

Link to this function

get_definitions(word, params \\ %{})

View Source
@spec get_definitions(String.t(), definitions_params()) ::
  {:error, String.t()} | {:ok, definitions()}

get definition(s) for requested word

parameters

Parameters

  • use_canonical: boolean
  • include_related: boolean
  • include_tags: boolean
  • limit: integer
  • part_of_speech: string
  • source_dictionaries: string

example

Example

iex> get_definitions("verbose", %{part_of_speech: "noun", limit: 5})

response

Response

t:Word.Definitions.definitions/0

wordnik-docs

Wordnik Docs

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