Skip to content

Commit 7cb8133

Browse files
committed
Fix spell check pdf
1 parent 74bde57 commit 7cb8133

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

R/check-files.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ spell_check_file_plain <- function(path, format, dict){
9292
spell_check_plain(text, dict = dict)
9393
}
9494

95+
spell_check_file_pdf <- function(path, format, dict){
96+
lines <- pdftools::pdf_text(path)
97+
words <- hunspell::hunspell_parse(lines, format = format, dict = dict)
98+
text <- vapply(words, paste, character(1), collapse = " ")
99+
spell_check_plain(text, dict = dict)
100+
}
101+
95102
#' @useDynLib spelling, .registration = TRUE
96103
#' @importFrom Rcpp sourceCpp
97104
spell_check_file_roxygen <- function(path, dict, global_options = list()) {

0 commit comments

Comments
 (0)