Quick check if text language is English

>I have searching a PHP solution to check if a piece of text language is English, or not. I have to do it for our R&D project called CQS. What is CQS? (see below).

So far I used Google Cloud Translate Detect Function. The problem is that I got big invoice from google.

Why? I found that the Detect API call is cost the same as Translate call! Google price table can be found here.

You can see it in this snapshot.

To solve the problem, I shop around and the only solution that I found was PEAR Language detection class. I spent a whole day trying set it on my server with zero luck. I couldn’t find any decent solution, so I developed it myself.

It is yours to use and help me to code it better!

Download the English Detection Tool

http://cqscore.com/download/isLanguageEnglish.zip

I have try it on long and short sentences (even a single word) for four languages (English, Spanish, French and Hebrew) and it works great.

 

How to use isLanguageEnglish function?

<?php

require_once(“isLanguageEnglish.php“);

$txt = “your text”;
if (isLanguageEnglish ($txt))
   echo “<font color=’red’ size=’+3′>NOT ENGLISH</font>”;
else
   echo “<font color=’green’ size=’+3′>THIS IS English</font>”;
?>

 

What is CQS?

CQS is a Content Quality Score checker as the bamboo of Panda 4.1: to make sure your content is okay.

For instance yellow.com which is one of the big losers in recent Google update (lost %80 in traffic) got a score of 28 out of 100.

Free registration: http://www.cqscore.com

To be on the safe side, you want a CQS of 70 and up.

We are now working to embed Google’s semantically comprehensive wording in the tool.

Warning: The tool is in its early beta stage. If a feature of CQS is not working as you expect, please bear with us as we work through these issues.