Learn R Programming

birdnik (version 0.1.1)

word_bigrams: Retrieve word bigrams

Description

word_bigrams grabs bigrams for whatever words you want out of the wordnik database, along with the match strength (weighted with and without factoring in word length).

Usage

word_bigrams(key, words, use_canonical = FALSE, min_wlmi = 0, limit = 5,
  ...)

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.

min_wlmi

the minimum (word-length weighted) strength of the similarity between the bigram words.

limit

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

...

further arguments to pass to httr's GET.

Value

a data.frame of 5 columns; word, first_gram, second_gram, mi (the strength of the relationship) and wlmi (the strength of the relationship, weighted by word length).

Examples

Run this code
# NOT RUN {
dog_associations <- word_bigrams(key = "madeupkey", words = "dog")
#mauling and fighting. But also biscuits!
# }

Run the code above in your browser using DataLab