<br><br><div class="gmail_quote">On Fri, Apr 17, 2009 at 3:19 PM, S.Selvam <span dir="ltr"><<a href="mailto:s.selvamsiva@gmail.com">s.selvamsiva@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br><br>I am trying for language detection in python.I just need to check whether the input text is english or not.<br><br>1)I tried nltk's stopwords and compared with input text,but only with little success.<br>

<br>2)Used oice.langdet for language detection,which uses bi-gram approach.It is also inefficient.<br><br>I need a best way to detect english text .<br><br>I welcome your suggestions ...<br>-- <br>Yours,<br><font color="#888888">S.Selvam<br>

</font><br>--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br></blockquote></div><br><br>I don't know anything about language detection, but my first attempt would be something like:<br><br>Grab the first N words (space-separated) from whatever file you're trying to check<br>
Find out what percentage of them, if any, are in some dictionary file, say /usr/share/dict/american-english on Ubuntu linux.<br><br>If there's a high percentage of words found, it's more than likely english.<br><br>
Or, perhaps checking for some commonly used words in english that only appear in english. I'm not aware of any examples off the top of my head, as I only know one language, but I'm sure there are some common english words that are mostly unique to the language.<br>