Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Windows
I need c# code for converting English alphabet to hindi. If somebody type "M" then it should display hindi "MOH".Similarly ,if we type ENGLISH "MAA" then it should display as "MAA" in Hindi alphabets. Please help me.
Thank you for your kind attention.
Posted 2-Jun-11 21:32pm
manabjn408
Comments
Shradha Gupta at 20-Mar-13 4:21am
   
I need a code in .net to convert English language to Marathi. If anybody know then please reply.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Create a look-up table in the form of array of string. Populate it from some text file, for example. The value will be the transliteration (http://en.wikipedia.org/wiki/Transliteration[^]) string of some English character. This way, you will have a function using this array.
 
But think about it: why not using the standard IPA (http://en.wikipedia.org/wiki/International_Phonetic_Alphabet[^])? As far as I know it covers both English and Hindi well (I know some languages it does not cover well, but with Hindi it should do).
 
OK, it's up to you. Back to our function:
 
string[] TransliterationTable = new string[26]; //I assume lo- and hi-case letters are transliterated in the same way

//...

//Populate TransliterationTable from file...

//...

// instance method of the same class
// where TransliterationTable is declared:
string Transliterate(char English) {
   // pre-condition to guarantee: all English chars should be in the table,
   // other code points should not be used in call:
   bool upperCase = char.IsUpper(English);
   English = English.ToUpper();
   int index = (char)English - 0x41; //minus capital English 'A'
   string result = TransliterationTable[index];
   if (upperCase) //assume transliterations are in lower
      result = result.ToUpper;
   return TransliterationTable[index]; 
}
 
//one more in this class:
string Transliterate(string English) {
   System.Text.StringBuilder sb = new System.Text.StringBuilder();
   foreach(char eng in English)
       sb.Append(this.Transliterate(eng));
   return sb.ToString();
}
 
Done!
 
—SA
  Permalink  
Comments
SP 24 at 3-Jun-11 7:52am
   
Hi Sakryukov, I have one doubt regarding your second link. How can it be possible to Transliterate English to Hindi. Quite confusing. I have a knowledge of scripts of 11 Indian language and for last 5 year, I am working in Language & Technology. Transliteration of Indian languages is done by me but seriously I don't understand the second link. Please explain :) Thanks in Advance.
SAKryukov at 5-Jun-11 22:53pm
   
"How can it be possible to Transliterate English to Hindi". I'm absolutely agree with your concern and wanted to question OP about it. It would make sense to approximately transliterate, say, Russian into Hindi, but not English, as transliteration letter-by-letter would loose the meaning of the word, as in English orthography spelling if too far from phonetics. I merely shown how to implement the OP's procedure. Actually, it's possible to recognize transliterated English text, but it rather has humorous effect sometimes used in literature.
 
Now, about IPA. There is nothing to explain. The second link has nothing to do with transliteration at all. In my second link I just questioned the transliteration itself. How it's useful? (See my notes above.) From as much as know, it's possible to conduct both English and Hindi phonetics using IPA. Am I right? I understand the value of IPA system (I wish it would be wider; some languages don't feet in the IPA set), but I fail to understand the value of transliteration between scripts and languages. Here I would ask you: can you explain it? In my experience, such transliteration is nothing more then "foreign language for the lamers". Is it not?
 
Thank you.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

Hi All
my self pramod deotalu m doing english to hindi conversion without using google translation.. please check http://vikku.info/indian-language-unicode-converter/hindi-unicode-converter.html. hope it will help you.
Regards
Pramod Deotalu
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I think you want to create a transliteration logic.
For this first some mapping of word is to be done by using array.
for example:अ is mapped with a
आ is mapped with aa
क is mapped with ka
1)after that you have to implement some logic to check if aa comes after consonant than it should convert it to matra.
  Permalink  
v2
Comments
manabjn at 8-Jun-11 10:39am
   
Thank you for your help.Please tell me how to mape आ with aa and so on.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Use the character equivalent for the letters and you need to write some code for combining a consonant and a vowel. Use Unicode encoding.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 398
1 CPallini 333
2 George Jonsson 270
3 OriginalGriff 159
4 Prasad Khandekar 135
0 OriginalGriff 4,613
1 CPallini 3,340
2 Sergey Alexandrovich Kryukov 2,771
3 George Jonsson 2,254
4 Gihan Liyanage 2,020


Advertise | Privacy | Mobile
Web01 | 2.8.140905.1 | Last Updated 20 Jun 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100