Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2008

Tip: Looking for answers? Try searching our database.

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.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DR - 29 Jan 2008 21:27 GMT
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.
Mihai N. - 30 Jan 2008 07:26 GMT
> 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/

Signature

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

Alvin Bruney [ASP.NET MVP] - 30 Jan 2008 13:50 GMT
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.

Signature

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
-------------------------------------------------------

>> 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,
[quoted text clipped - 13 lines]
> http://complingone.georgetown.edu/~langid/acq_info.html
> http://search.cpan.org/dist/Text-Language-Guess/
Mythran - 30 Jan 2008 16:39 GMT
> 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
[quoted text clipped - 6 lines]
>>> method to take a string and return what language it is in? e.g. english,
>>> hindi, spanish, etc.

The last sentence in the OP leads me, as well as Mihal, to believe that the
OP'er is asking about spoken language (where the e.g. part is 'english,
hindi, spanish, etc.').

:)

Mythran

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.