I have a list of 1000 text in Russian language and want to convert it to English in R. I know there are some R packages for google translate but that requires API. And getti
Here is a solution ,
library(RCurl)
library(XML)
getParam = "Прием (осмотр, консультация) врача-инфекциониста первичный"
translateFrom = "ru"
translateTo = "en"
search <- gsub(" ", "%20", getParam)
URL <- paste("https://translate.google.pl/m?hl=",translateFrom,"&sl=",translateFrom,"&tl=",translateTo,"&ie=UTF-8&prev=_m&q=",search,sep="")
page <- getURL(URL)
tree <-htmlTreeParse(page)
body <- tree$children$html$children$body
body_text <- body$children[[5]]$children[[1]]
print(body_text)
You can find more information about web parsing from this question.