Detecting whether or not text is English (in bulk)

前端 未结 5 870
庸人自扰
庸人自扰 2020-12-16 04:52

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 dete

5条回答
  •  执笔经年
    2020-12-16 04:57

    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

提交回复
热议问题