word_bigrams: Retrieve word bigrams

Description Usage Arguments Value Examples

View source: R/words.R

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

1
2
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

1
2
3
4
5
6
## Not run: 

dog_associations <- word_bigrams(key = "madeupkey", words = "dog")
#mauling and fighting. But also biscuits!

## End(Not run)

Ironholds/birdnik documentation built on Feb. 6, 2022, 2:25 p.m.