Extract content from Datamuse API call.

get_content(full_path, return_type = "df", limit = 10)

Arguments

full_path

API path to append to Datamuse API endpoint.

return_type

type to return. Options are:

  • 'df' for data.frame.

  • 'word' for a single word.

  • 'random_word' or 'random word' or 'rand' for a random word.

  • 'vector' for a vector of words.

limit

max number of rows to return from the content dataframe.

Value

content returned from API call.

Examples

get_content("/words?rel_rhy=test", limit = 5)
#>       word score numSyllables
#> 1 manifest  2995            3
#> 2     best  2743            1
#> 3     rest  2366            1
#> 4  request  2328            2
#> 5  suggest  1987            2

get_content("/words?ml=test", limit = 20)
#>              word    score                             tags
#> 1         try out 30045872 syn, n, results_type:primary_rel
#> 2         examine 30045525                           syn, v
#> 3           trial 30044021                      syn, adj, v
#> 4    experimental 30043762                           syn, n
#> 5     examination 30043350                           syn, n
#> 6           prove 30039620                           syn, n
#> 7           assay 30039378                           syn, n
#> 8             try 30036965                         syn, adj
#> 9            quiz 30036178                           syn, n
#> 10          essay 30023695                           syn, n
#> 11         tryout 30019263                           syn, n
#> 12      empirical 30016285                         syn, adj
#> 13           exam 30012367                        syn, v, n
#> 14            run 30007945                         syn, adj
#> 15          model 29981264                         syn, adj
#> 16         screen 29957176                           syn, n
#> 17          pilot 29913971                         syn, adj
#> 18          check 29890868                      syn, adj, n
#> 19    mental test 20047892                           syn, n
#> 20 mental testing 20047892                           syn, n