Defines functions .generate_spelling

#' Generate spelling exceptions
#' Defining known spellings of names and technical terms makes the \code{aspell}
#' checks useful (and removes a NOTE in the \code{R CMD check} which at least
#' some of the CRAN people use.
#' @template save_pkg_data
#' @keywords internal
#' @noRd
.generate_spelling <- function(save_pkg_data = TRUE) {
  medical <- c(
  proper_nouns <- c(
  proper_nouns <-
    c(proper_nouns, paste(proper_nouns, "'s", sep = ""))
  acronyms <- c(
  french <- c(
  other <- c(
  words <- c(medical, proper_nouns, acronyms, french, other)
  if (save_pkg_data) {
    # per http://dirk.eddelbuettel.com/blog/2017/08/10/#008_aspell_cran_incoming
    saveRDS(words, file = ".aspell/icdwords.rds", version = 2)
    # for spelling package, write out a simple WORDLIST. This package checks
    # more stuff than the base R, but many false positives, e.g. latex figure
    # labels.
    writeLines(words, "inst/WORDLIST")
    # base R, then use aspell_package_Rd_files('.') from package root.
      out = ".aspell/words.pws"

Try the icd package in your browser

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

icd documentation built on July 2, 2020, 4:07 a.m.