Project-SILPA/silpa-common — pull request #1 by pravj (2014-03-04 16:35:54+00:00)
Title: fixes language detection when there are mixing of more then one language

actually the previous method to detect language was checking only first letter in a word, hence was giving wrong result in case of a word with having mixed languages.
for example : in previous method
>from langdetect import detect_lang
detect_lang(u'यह ಎಂದ') => {u'\u0c8e\u0c82\u0ca6': 'kn_IN', u'\u092f\u0939': 'hi_IN'}
detect_lang(u'यहಎಂದ') => {u'\u092f\u0939\u0c8e\u0c82\u0ca6': 'kn_IN'}

so I tried to fix this, and this is the change
>from langdetect import detect_lang
detect_lang(u'यहಎಂದ') => {u'\u092f\u0939\u0c8e\u0c82\u0ca6': 'mixing of more then one language found'}