R/inflect_word.R

Defines functions inflect_word

Documented in inflect_word

#' Inflects a given lemma
#'
#' @param word The word to inflect
#' @param features The morphological features desired
#' @param lang The language of the word
#'
#' @return A dataframe of the desired inflections
#' @export
#'
#' @examples
#' inflect_word("word", lang="eng")
inflect_word <- function(word, lang, features = NULL){
  inflected_paradigm <- .pkg.env$unimorph$inflect_word(word, features = features, lang = lang)
  read.csv(text=inflected_paradigm,
           sep="\t",
           col.names = c("lemma", "inflected", "features"),
           header = FALSE)
}
b05102139/unimorphR documentation built on Dec. 19, 2021, 6:38 a.m.