R/analyze_word.R

Defines functions analyze_word

Documented in analyze_word

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