language prediction using n-grams and machine learning