What Language Are You Speaking? There's an API for That

Adam DuVander
Sep. 15 2009, 02:30AM EDT

Did you know that leraar is a Dutch word? A new API, LangID can help you with those pesky language identification problems. Feed it a string of text and the API returns the name of the language, its ISO code and even an image of the flag for a country that speaks the language (the latter could be a hot-button political issue--watch out). You can choose your output as either XML or browser-friendly JSON (more technical details at our LangID API profile).

langid_scr

LangID is a very straightforward API, and lthough it stops short of providing actual translation, it could conceivably be used along with translation services like the Google AJAX Language API or the Microsoft Translator API.

In terms of accuracy, the service becomes more reliable the longer the block of text you provide (you must include at least five characters). For example, it may not always help you match foods to countries: "No burrito" returned as English, while LangID claimed "lasagna" is Icelandic.

The API is just one of the many ways that LangID provides language identification. You can also use its website, Twitter, or a few other methods. Knowing which language to use is a first step to translating, and perhaps LangID will add in the second step - the actual translation - with its next iteration.

Adam DuVander -- Adam heads developer relations at Orchestrate, a database-as-a-service company. He's spent many years analyzing APIs and developer tools. Previously he worked at SendGrid, edited ProgrammableWeb and wrote for Wired and Webmonkey. Adam is also the author of mapping API cookbook Map Scripting 101.

Comments

Comments(1)