Re: how to determine what language a c# string is written in? is there any C# method to take a string and return what language it is in? e.g. english, hindi, spanish, etc.



I think he was asking about the run-time langauge and not 'speaking language'. If that's the case, OP can get the current culture and language from the thread of execution. That would work for local applications. If the string is remoted from another appdomain, you can find the executing thread as well.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------



"Mihai N." <nmihai_year_2000@xxxxxxxxx> wrote in message news:Xns9A34EE6CD4729MihaiN@xxxxxxxxxxxxxxxx
how to determine what language a c# string is written in? is there any C#
method to take a string and return what language it is in? e.g. english,
hindi, spanish, etc.

There is nothing standard in C#, .NET, Win32, whatever.

And there is no 100% reliable method to do that.
In what language is "chat"? Is is English, or French (cat)?
The longer the text, the better the chances, but nothing can be 100%
reliable.


But there are some decent statistical methods.

Here are some links (or Google for language identification algorithm):
http://people.csail.mit.edu/hazen//publications/masters_thesis.pdf
http://complingone.georgetown.edu/~langid/acq_info.html
http://search.cpan.org/dist/Text-Language-Guess/




--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email

.



Relevant Pages

  • Re: Leodhasach & Hearasch - Gaelic help please
    ... course our own traditional language is even more neglected than Gaelic is. ... who speak English soon get the gist of it. ... is someone who truly appreciates Scottish culture in that you won't find ...
    (soc.culture.scottish)
  • the tomasites , english and the filipino
    ... And they came to teach English as part of the "policy of attraction" ... a Filipino is deemed illiterate even ... Even a secondary Spanish school like Colegio de San Juan de Letrán ... wrote a textbook to teach the English language as early as 1902. ...
    (soc.culture.filipino)
  • Re: the tomasites , english and the filipino
    ... this change was documented in books written in English or other ... European languages not Tagalog or any other of the Filipino dialects. ... second language, unfortunately it seems that we did not use these ... Even a secondary Spanish school like Colegio de San Juan de Letrán ...
    (soc.culture.filipino)
  • Re: OT: Six out of 10 young Americans cannot find Iraq on a map
    ... Language became a political and an emotional issue as early as the ... proposed English Language Amendment, ... Despite the myth that German had once come close to replacing English ... The story of the German Vote is occasionally trotted out by ...
    (alt.guitar.amps)
  • OT - A Country of Illiterates and "Survivor" Watchers Decides on a Language
    ... US Senate declares English the "national language" ... The U.S. Senate on Thursday voted to make English the "national ... The answer can lie only in the profound crisis and decay of American ...
    (alt.sports.basketball.nba.la-lakers)