R script to identify language of string