Learn R Programming

birdnik (version 0.1.1)

word_definitions: Retrieve definitions of a word

Description

word_definitions retrieves the overall metadata for each word in words, including actual definitions.

Usage

word_definitions(key, words, use_canonical = FALSE, source_dicts = "all",
  limit = 200, ...)

Arguments

key

a Wordnik API key. These can be obtained at the Wordnik developer portal.

words

a vector of words.

use_canonical

whether to use the stemmed, canonical form of the word (i.e. 'cat', for 'cats') instead of the actual word. FALSE by default. Note that for pronunciations specifically, setting it to TRUE may get a wider range of pronunciations; you should experiment.

source_dicts

the dictionaries to use; options are any permutation of "ahd", "century", "wiktionary", "wordnet" and "webster". "all" (the default) searches all of them.

limit

the maximum number of items to return for any one word.

...

further arguments to pass to httr's GET.

Value

a list structure containing definitions for each word in words, along with associated metadata, which can be manipulated with birdnik_get.

See Also

birdnik_get for ways to conveniently access individual chunks of the returned dataset.

Examples

Run this code
# NOT RUN {
cats <- word_definitions(key = "madeupkey", words = "cat")
# }

Run the code above in your browser using DataLab