Introducing rhymer

Noah Landesberg 2017-12-23 2 minute read

I’m proud to announce that I have published my first R package, rhymer!
Version 1.0 is now available on CRAN. You can view the source code on github, and see the website for the package here.

The goal of rhymer is to provide an R interface to the Datamuse API in order to find rhyming words. The core function of rhymer is get_rhyme(), which can be used in a variety of ways.

library(rhymer)

# get rhymes for "R" and return a 5 word vector
get_rhyme("R", return_type = "vector", limit = 5)
## [1] "bar"    "car"    "star"   "avatar" "far"

For example, I’ve been enjoying rewriting nursery rhymes:

glue::glue("
  Jack and Jill 
  Went up the {get_rhyme('Jill', return_type = 'rand')} 
  To fetch a pail of water. 
  Jack fell down 
  And split his {get_rhyme('down', 'rand')},
  And Jill came tumbling {get_rhyme('water', 'rand')}"
)
## Jack and Jill 
## Went up the mill 
## To fetch a pail of water. 
## Jack fell down 
## And split his crown,
## And Jill came tumbling imprimatur

The package includes additional functions to find other related words, including:

  • get_means_like() to find words of similar meaning
  • get_sounds_like() to find words that sound similar
  • get_spelled_like() to find words that are spelled similarly

There are some more examples on the rhymer website as well as in the package vignette “Intro to rhymer”.

I’m looking forward to seeing what you come up with as an interesting use case for rhymer! Please submit all issues or feature requests on github.

And of course, much thanks to:

  • Hadley Wickham for the httr package that made API requests a breeze, testthtat which made writing tests genuinely enjoyable, devtools which made first-time package development a pain-free experience, and pkgdown for turning all the package documentation into a beautiful website.
  • Jeroen Ooms, Duncan Temple Lang, and Lloyd Hilaiel for the jsonlite package which helped to parse the JSON responses from the API.
  • Datamuse for providing an awesome and free API with great documentation and examples.
  • The internet for providing countless tips and tricks when it felt like I had reached an insurmountable problem.
  • Henry Willis, Tim Helbig, Alex McManus, and Benjamin Ackerman for teaching me a ton about package and software development and for doing some initial testing.