Skip to content

Commit

Permalink
Fix spell check pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Dec 13, 2017
1 parent 74bde57 commit 7cb8133
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/check-files.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ spell_check_file_plain <- function(path, format, dict){
spell_check_plain(text, dict = dict)
}

spell_check_file_pdf <- function(path, format, dict){
lines <- pdftools::pdf_text(path)
words <- hunspell::hunspell_parse(lines, format = format, dict = dict)
text <- vapply(words, paste, character(1), collapse = " ")
spell_check_plain(text, dict = dict)
}

#' @useDynLib spelling, .registration = TRUE
#' @importFrom Rcpp sourceCpp
spell_check_file_roxygen <- function(path, dict, global_options = list()) {
Expand Down

0 comments on commit 7cb8133

Please sign in to comment.