MyNixOS website logo
Description

Wrapper for the 'Datamuse' API to Find Rhyming and Associated Words.

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/>.

rhymer

BuildStatus CoverageStatus CRAN_Status_Badge

Overview

The goal of rhymer is to get rhyming and other related words through the Datamuse API. This package includes basic functions to get rhymes and other similar words based on meaning, spelling, or sound.

Installation

install.packages("rhymer")

# Or the the development version from GitHub:
# install.packages("devtools")
devtools::install_github("landesbergn/rhymer")

Example

They say nothing rhymes with orange

get_rhyme("orange", return_type = "word")
#> [1] "door hinge"

Feeling down? How about this cloud of words with similar meaning to happy:

word_data <- get_means_like("happy", return_type = "df")
wordcloud::wordcloud(words = word_data$word, 
                     freq = word_data$score, 
                     colors = c("lightsteelblue1","lightsteelblue2","lightsteelblue3","lightsteelblue"))

Eminem wrote the classic rap song ‘Lose Yourself’, but could it be better with rhymer?

glue::glue("
  His palms are sweaty
  Knees weak arms are {get_rhyme('sweaty', return_type = 'word', num_syl = 2)}

  There's vomit on his sweater already
  Mom's {get_rhyme('already', return_type = 'word', num_syl = 3)}
")
#>   His palms are sweaty
#>   Knees weak arms are petty
#> 
#>   There's vomit on his sweater already
#>   Mom's unsteady

Main functions

rhymer has 4 main functions that allow you to get data on related words through the Datamuse API.

They are:

  • get_rhyme() - a function to get rhyming words
  • get_means_like() - a function to get words with similar meaning
  • get_sounds_like() - a function to get words that sound similar
  • get_spelled_like() - a function to get words that are spelled similarly

There is also a more flexible function get_other_related() that allows you to use the API to get data on other related words using a series of ‘codes’ described on the Datamuse API website.

Each function takes the basic arguments of:

  • word the word to base results on
  • return_type what type of data return (options are df for a data frame, vector for a vector, word for a single word, and random_word for a random word)
  • limit max number of related words to return

get_rhyme() and get_sounds_like() also have special helpers for the number of syllables to return called num_syl.

Metadata

Version

1.2.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows