Skip to content

Instantly share code, notes, and snippets.

@bmschmidt bmschmidt/words.R
Last active Mar 13, 2017

Embed
What would you like to do?
library(birdnik)
random_word <- function(key,
pos="adjective", min_count=100, n=1,
min_length = 5, max_length = 15){
param <- paste0("words.json/randomWords?hasDictionaryDef=true",
"&minCorpusCount=",min_count,
"&minLength=",min_length,
"&maxLength=",max_length,
"&limit=",n,
"&includePartOfSpeech=",pos)
raw = birdnik:::query(key = key,params = param)
do.call(rbind,lapply(raw,as.data.frame))
}
random_word(key=my_wordnik_key,pos="noun",n=3, min_count=1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.