ChristopherLucas / translateR

R Package for Cross-Language Topic Modeling
20 stars 17 forks source link

KIO8_R encoding of Twitter Hashtag #7

Open mbenigni opened 8 years ago

mbenigni commented 8 years ago

I am trying to translate Ukrainian and Russian hashtags from the Twitter REST API. When I pass the vector to translateR I get the following error:

Warning message: The content appears to be in RUSSIAN-KOI8_R. However, the language code you provided suggests that the text is in UKRAINIAN. If you entered the wrong language code, stop the process. Otherwise, translateR will treat the text as UKRAINIAN.

Script:

library('translateR')

Shell script to translate Ukrainian and Russian Hashtags

ht=read.csv('hashtag_100.csv',stringsAsFactors=FALSE)

google_api_key='AIzaSyAl0hpfIYlOca3iEPjra6mgbtfRemtOxYo' microsoft_id='CASOS_translator' microsoft_secret='GgNh291hhbsp6evumeYFyYgW6p2SSJ3cRNQxmKLYFAY' translate(content.vec=ht$x,google.api.key=google_api_key,source.lang='uk',target.lang='en')