get_rhymes: Find possible rhymes for a given word

View source: R/get_rhymes.R

get_rhymesR Documentation

Find possible rhymes for a given word

Description

Given a pronounciation dictionary with columns for tokens (words) and pronounciations, this function returns a vector of possible rhymes.

Usage

get_rhymes(
  word,
  pron,
  token = token,
  stress_vowel = stress_vowel,
  remainder = remainder
)

Arguments

word

character. Word to find rhymes for

pron

A tibble assumed to contain a token, a stress_vowel and a remainder column, all coded in then phonetic alphabet sampa.

token

character. Name of column containing token (word).

stress_vowel

character. Name of column containing pronounciation for the stressed vowel. Used for finding rhymes.

remainder

character. Name of column containing pronounciation for the remainer of the token, i.e. everything after the stressed vowel. Used for finding rhymes.

Value

A charactor vector with possible rhyming words.

Examples

pr <- data.frame(token = c("appellere", "akkumulere", "bygning"),
sampa = c("A$pE$\"le:?$6", "a$ku$mu$\"le:?$6", "\"by$gneN"),
rhyme_part = c("\"le:?$6", "\"le:?$6", "\"by$gneN"),
stress_vowel = c("e:?", "e:?", "y"),
remainder = c("$6", "$6", "$gneN"))

get_rhymes(word = "appellere", pron = pr)


lassehjorthmadsen/salmer documentation built on April 15, 2022, 3:38 a.m.