R/dictionary.R

Defines functions dict_user_path dict_stopwords_path dict_path

dict_path <- function() {
  path <- Sys.getenv("ELBIRD_DICTIONARY_HOME")
  if (nzchar(path)) {
    normalizePath(path, mustWork = FALSE)
  } else {
    normalizePath(file.path(system.file("", package = "elbird"), "dicts"),
                  mustWork = FALSE)
  }
}

dict_stopwords_path <- function() {
  normalizePath(file.path(dict_path(), "stopwords.txt"), mustWork = FALSE)
}

dict_user_path <- function() {
  normalizePath(file.path(dict_path(), "stopwords.txt"), mustWork = FALSE)
}

Try the elbird package in your browser

Any scripts or data that you put into this service are public.

elbird documentation built on Aug. 12, 2022, 5:08 p.m.