detect_lang function

Detect language of text