Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting whether or not text is English (in bulk)

I'm looking for a simple way to detect whether a short excerpt of text, a few sentences, is English or not. Seems to me that this problem is much easier than trying to detect an arbitrary language. Is there any software out there that can do this? I'm writing in python, and would prefer a python library, but something else would be fine too. I've tried google, but then realized the TOS didn't allow automated queries.

like image 718
user449511 Avatar asked Jan 05 '11 14:01

user449511


1 Answers

I read a method to detect English language by using Trigrams

You can go over the text, and try to detect the most used trigrams in the words. If the most used ones match with the most used among english words, the text may be written in English

Try to look in this ruby project:

https://github.com/feedbackmine/language_detector

like image 112
HyLian Avatar answered Sep 17 '22 15:09

HyLian