Solved

Detect language of a string

Posted on 2013-05-20
2
291 Views
Last Modified: 2013-05-20
Hello,

Is it possible to detect the language of a string?

For example:

"Hello" -> English
"über" -> German
"¿a¿¿µ¿¿a" -> Greek

I understand that words written in English but in another language cannot be filtered (e.g. "Guten Tag") however I am asking only for those that have characters specific to each language like the examples above.

Thank you very much!
0
Comment
Question by:infodigger
2 Comments
 
LVL 10

Assisted Solution

by:ienaxxx
ienaxxx earned 250 total points
ID: 39180973
AFAIK there should be something in the google translate API.
Not sure if you was searching for something like this...
HTH
0
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 250 total points
ID: 39181018
Each language has a "signature" that can be detected from its vocabulary, however it's not 100% accurate and the risk of error goes way up on smaller strings because the orthography evident in short strings is rarely unique.  The Google API occasionally suggests that my computer code is written in Dutch, etc.  I think letter-only detection from a single word would be nearly useless except for a very few languages.  For example, the U-Umlaut (Diaresis) may appear in Hungarian, Karelian, Turkish, Uyghur Latin script, Estonian, Azeri, Turkmen, Crimean Tatar and Tatar Latin alphabets, as well as in German.

See http://en.wikipedia.org/wiki/Language_identification
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Unwanted output from my query 5 43
php subtract from date 2 30
Put POST values into cookies. 14 35
Why is my foreach loop not returning values from $_SESSION variable 8 26
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question