I would like to use tm package for Hebrew or Arabic text analysis. I tried several methods to see if tm will be able to process some words but i ran into an error, Is there a way to solve this issue?
text <- "הנוסעים חיכו זמן רב לנסיעה"
Encoding(text)
#[1] "unknown"
Encoding(text) <- "UTF-8"
ap.corpus <- Corpus(DataframeSource(data.frame(text)))
ap.corpus <- tm_map(ap.corpus, removePunctuation)
ap.corpus <- tm_map(ap.corpus, content_transformer(tolower))
Error in FUN(content(x), ...) :
invalid input 'הנוסעים חיכו זמן רב לנסיעה' in 'utf8towcs'