Language detection using character trigrams (Python recipe). Fork from http://code.activestate.com/recipes/326576-language-detection-using-character-trigrams/