@@ -94,8 +94,8 @@ hunspell <- function(text, format = c("text", "man", "latex", "html", "xml"),
9494 stopifnot(is.character(text ))
9595 stopifnot(is.character(ignore ))
9696 format <- match.arg(format )
97- dictionary <- dictionary(dict )
98- R_hunspell_find(dictionary , text , format , ignore )
97+ dictionary <- dictionary(dict , add_words = ignore )
98+ R_hunspell_find(dictionary , text , format , character () )
9999}
100100
101101# for backward compatiblity
@@ -233,8 +233,11 @@ print.dictionary <- function(x, ...){
233233# ' @param cache speed up loading of dicationaries by caching
234234# ' @param add_words a character vector of additional words to add to the dictionary
235235dictionary <- function (lang = " en_US" , affix = NULL , cache = TRUE , add_words = NULL ){
236- if (inherits(lang , " dictionary" ))
237- return (lang )
236+ if (inherits(lang , " dictionary" )){
237+ if (! length(add_words ))
238+ return (lang )
239+ lang <- hunspell_info(lang )$ dict
240+ }
238241 if (! isTRUE(cache ))
239242 return (dictionary_internal(lang , affix , add_words ))
240243 key <- digest :: digest(list (lang , affix , add_words ))
0 commit comments