Package 'rhymer'

Title: Wrapper for the 'Datamuse' API to Find Rhyming and Associated Words
Description: Wrapper for 'Datamuse' API to find rhyming and other associated words. This includes words of similar meaning, spelling, or other related words. Learn more about the 'Datamuse' API here <https://www.datamuse.com/api/>.
Authors: Noah Landesberg [aut, cre]
Maintainer: Noah Landesberg <[email protected]>
License: MIT + file LICENSE
Version: 1.1.0
Built: 2025-02-12 05:26:59 UTC
Source: https://github.com/landesbergn/rhymer

Help Index


Call Datamuse API and return data.

Description

Call Datamuse API and return data.

Usage

datamuse_api(path, limit = 10)

Arguments

path

path to append to Datamuse API endpoint.

limit

number of results to limit the API response to.

Value

data returned from API call.

Examples

datamuse_api("/words?rel_rhy=test")

datamuse_api("/words?ml=test")

Extract content from Datamuse API call.

Description

Extract content from Datamuse API call.

Usage

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)

get_content("/words?ml=test", limit = 20)

Get dataframe for words with similar meaning.

Description

Get dataframe for words with similar meaning.

Usage

get_means_like(word = "test", return_type = "df", limit = 10)

Arguments

word

to get similar meaning with.

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 words to return.

Value

data with words of similar meaning.

Examples

get_means_like("test")

get_means_like("test", limit = 10)

Get data for rhyming words.

Description

Get data for rhyming words.

Usage

get_rhyme(word, return_type = "df", limit = 10, num_syl = NULL)

Arguments

word

to rhyme with.

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 words to return.

num_syl

number of syllables in rhymes to return.

Value

data with rhyming words.

Examples

get_rhyme("test")

get_rhyme("test", limit = 10)

Get data for words that sound similar.

Description

Get data for words that sound similar.

Usage

get_sounds_like(word = "test", return_type = "df", limit = 10, num_syl = NULL)

Arguments

word

to get similar sounding words with.

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 words to return.

num_syl

number of syllables in rhymes to return.

Value

data containing word(s) that sound similar.

Examples

get_sounds_like("test")

get_sounds_like("test", limit = 10)

Get data for words that are spelled similarly.

Description

Get data for words that are spelled similarly.

Usage

get_spelled_like(word = "test", return_type = "df", limit = 10)

Arguments

word

to get similarly spelled words with.

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 words to return.

Value

data with words that are spelled similarly.

Examples

get_spelled_like("test")

get_spelled_like("test", limit = 10)

Helper function to shape data to return to user.

Description

Helper function to shape data to return to user.

Usage

return_content(api_content, return_type)

Arguments

api_content

content returned from the API call.

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.

Value

data as specified above.