Click here to Skip to main content
15,891,951 members
Articles / Web Development / ASP.NET

How Find The String Language in C#

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
23 Dec 2012CPOL 17.6K  
I need to find the languages of an string in my stand alone program i don't want use bing translate or google translate .thanks.in fact i tried this but i cannot do it for all languages, can i? public string FindLang(string text) { string result = ""; ...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
23 Dec 2012CPallini
If your string is big enough you may attempt a heuristic approach: build a dictionary with most frequent terms for all the languages your application supports and then find 'the best match' on the give string.
Please Sign up or sign in to vote.
24 Dec 2012Zoltán Zörgő
First of all, just by having in the text some specific characters from unicode chart, does not mean, that we have identified the language. This might be an extra evaluation, but can not be the only one. And one thing is to estimate if the text is from a short list of languages (let's say, up to...
Please Sign up or sign in to vote.
23 Dec 2012Krunal Rohit
var text = "¿Dónde está el baño?";google.language.detect(text, function(result) { if (!result.error) { var language = 'unknown'; for (l in google.language.Languages) { if (google.language.Languages[l] == result.language) { language = l; break; } ...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions