diff --git a/R/word2vec.R b/R/word2vec.R index ac6a7f6..9367044 100644 --- a/R/word2vec.R +++ b/R/word2vec.R @@ -142,9 +142,13 @@ prep_word2vec <- function(origin,destination,lowercase=F, tokenize_words(lowercase) %>% stringr::str_c(collapse = " ") - stopifnot(length(text) == 1) - readr::write_lines(text, file_out, append = TRUE) - return(TRUE) + if (length(text) == 1) { + readr::write_lines(text, file_out, append = TRUE) + return(TRUE) + } else { + message("Warning: No text to prep in ", file_in) + return(FALSE) + } }