Tech Dreams

Trick To Use Google Indic Transliteration Service In C#, Java, PHP and Other Programming Languages

Google Indic Transliteration is yet another innovative service from Google. It allows users to type in English and transliterate(note that this is not same as not translation) the text to any of the supported Indian languages – Hindi, Tamil, Telugu, Kannada and Malayalam.

For instance, If you type “Amitabachan blog”, Google Indic Transliteration for Hindi can automatically convert it to “???????? ?????”(See the animation below if you don't have Hindi fonts installed)

That is very cool isn't it? This is extremely useful when I want to quickly draft an email to my dad who understands only Telugu.

The uses of this services are unlimited and It depends on how creative you.  Google Indic Transliteration Javascript APIs are available freely for using in your web sites and blogs. You can build your own web applications, Firefox plugins and other mashups using the APIs.

It seems to be there is no API support for using Google Transliteration on desktop and server programming languages like C#.NET, VB.NET, ASP.NET, PHP, Perl/CGI, etc. I searched through documentation and could not find any reference material for the application API support.

Hidden URL That Support

dog food diet

s Transliteration

By investigating the news groups and discussion forums I found an URL that can be used in application to retrieve transliterated data for a given text in JSON output format.

For example the following URL transliterates the words amitabachan & blog and return a JSON output object which can be consumed in programming languages like C#.NET, VB.NET, ASP.NET, PHP, Perl/CGI, etc

http://www.google.com/transliterate/indic?tlqt=1&langpair=en|hi&text=amitabachan,blog&&tl_app=1

JSON Output

[ { “ew” : “amitabachan”, “hws” : [ “????????”,”?????????”,”???????”,”????????”,”????????”, ] }, { “ew” : “blog”, “hws” : [ “?????”,”?????”,”????”,”??????”,”??????”, ] }, ]

(You should have Hindi fonts installed to view the above JSON output properly)

Legal issues!!

This secret URL looks very useful as we can call it through a HTTP JSON API of our preferred language and process the results. But it is not clear whether we are allowed to access the URL from desktop and server side programming languages. So if you are planning to build any application using this service, first make sure that you will not be penalized by Google.

I would really appreciate if any of you can provide the Terms and Conditions of using this API in desktop & server side programming languages.

37 Comments on Trick To Use Google Indic Transliteration Service In C#, Java, PHP and Other Programming Languages

  1. aredkid
    July 15, 2010 at 8:33 am (8 years ago)

    So reading: http://code.google.com/apis/ajaxlanguage/terms.html

    I find that it’s ok to crazy with this as long as (among others) “You will not, and will not permit your end users or other third parties to: submit any request exceeding 5000 characters in length;”

    So a max of 5000 per request. Not too bad given that you can’t send more than 5 words per request any way.

  2. aredkid
    July 14, 2010 at 10:04 pm (8 years ago)

    Hey! So awesome to have found this :D But I’ve been having issues seeing the data retrieved, shows up a little like “\u099A\u09A8…”. Something to do with the encoding? I am not sure. Ideas?

  3. Ratibor
    June 27, 2010 at 8:43 am (8 years ago)

    Sorry to me, transliteration API not support operations from any language to english, – this is what i looking for. For tool for making seo friendly links..

  4. Ratibor
    June 27, 2010 at 8:23 am (8 years ago)

    Thanx Gopinath!
    This is what I was looking for.

  5. lifeh2o
    March 25, 2010 at 8:52 pm (8 years ago)

    Is there anyway to convert an already written text in indic language?
    I mean i just want to copy paste some text and let google transliterate convert all of it in urdu text

  6. shan
    March 2, 2010 at 1:11 pm (8 years ago)

    Hi can i use this in windows application in dotnet

  7. Srinivasan C
    January 29, 2010 at 2:55 pm (8 years ago)

    what is the url used for “google ime transliteration”. In that plugin you no need to type full length of word. “amita” is enough to get the full length of word and related words. Please help me

  8. Nick
    January 28, 2010 at 11:16 am (8 years ago)

    Hi friend

    I would like to create malayalam webmail using asp.net c# . i want to use Google Transliteration to type malayalam and send as webmail. How can i do?
    Plese help me

    thanks

    Nick

  9. kumar soundarajan
    January 18, 2010 at 1:22 pm (8 years ago)

    Hi,
    can you help me out what is the importance of RSS feeds and why should i use that.. It may be a silly question but am very new to RSS

  10. Syed Ghulam Akbar
    January 11, 2010 at 5:55 pm (8 years ago)

    Hi,

    I have been trying to make the Transliteration Service from Google more friendly by making its bookmarklet. Try this here at:
    http://www.syedgakbar.com/products/web/

    Please let me know of any feedback and comments.

  11. Vijay
    November 9, 2009 at 11:37 am (8 years ago)

    Gopi,

    I want to use the feature of transliteration API’s in my web site. Is there any legal issues there?

    Thanks
    Vijay

    • Gopinath
      November 10, 2009 at 11:45 am (8 years ago)

      Vijay,
      I’ve not gone through the terms & conditions. As the API is officially released from Google now, it should be possible to use in free web applications. But not sure about the commercial applications. Please go through the terms & conditions of Google Code APIs to know about the legal issues.

  12. MAK
    November 7, 2009 at 7:34 pm (8 years ago)

    Great post. This is indeed a very useful feature that you have uncovered. Any update on Google’s legal stand in this matter?

  13. Abhi
    September 16, 2009 at 11:02 am (9 years ago)

    Hi, nice work. btw google has opened the api for non javascript applications. check their documentation. Can you please tell me which software you used to make the above gif?

  14. jitesh dundas
    September 1, 2009 at 1:29 pm (9 years ago)

    Hi Friends,

    I need your help. Please tell me what is the mistake here. It does not transliterate more than 5 words.
    —————————————————————–

    “+ URLDecoder.decode(“\u0905\u092E\u093F\u0924\u093E\u092C\u091A\u0928″,”UTF-8”) + “”) ;

    while ((decodedString = in.readLine()) != null)
    {
    tempstr = tempstr + decodedString;
    }
    out.println(tempstr);

    //code ends.
    String[] strval = tempstr.split(“ew”);
    out.println(“Length=”+strval.length + “”);

    //loop through all the values of the string array.
    for ( int j=0; j < strval.length; j++ )
    {
    String val = strval[j];

    out.println("j=” + j + ” & Array Val=”+val+ “”);

    //next check for “:” sign.
    if ( val.contains(“:”) )
    {
    out.println(” It has colon”);
    //check for first comma in this string.
    /*int commapos = val.indexOf(“,”);
    out.println(” Pos of comma is “+ commapos + “”);
    */
    String[] strval2 = val.split(“,”);
    String strval3 = “”;

    for (int k=0; k < strval2.length; k++ )
    {
    out.println("k=” + k + ” & Comma Array Val=”+ strval2[k] + “”);
    //now replace all ” and “:” characters.

    strval3 = strval2[k];
    strval3 = strval3.replaceAll(“\””,””);
    strval3 = strval3.replaceAll(“:”,””);

    out.println(“k=” + k + ” & New Comma Array Val=”+ strval3 + “”);

    out.println(“Final value of ew=”+strval3);//value of ew obtained.
    }
    //code to get values of

    //next get the substring till first “,”
    }
    }

    in.close();
    }
    catch(Exception ex)
    {
    out.println(“Exception->”+ex);
    PrintWriter pw = response.getWriter();
    ex.printStackTrace(pw);
    }

    %>

  15. Giribee
    September 1, 2009 at 11:20 am (9 years ago)

    Hi how can i use this in my web page

  16. european
    August 15, 2009 at 2:00 am (9 years ago)

    Hi,
    have you found out if it is possible to do reverse transliteration from hindi, arabic, etc. to english to display the texts where no appropriate fonts are available?
    thanks

  17. pawan kumar choudhary
    August 3, 2009 at 12:19 am (9 years ago)

    sir, i want to convert my whole article in single/few click on indic translator.

  18. name
    July 29, 2009 at 9:30 pm (9 years ago)

    Great,

  19. Ranjeet
    July 18, 2009 at 7:09 pm (9 years ago)

    Hi Sir, I am trying to use this feature in my application in java.
    The problem starts when I try to store user given data(english converted to hindi) in MySQL database.

    The data is getting stored in some cryptic form. And when I try to get data back from MySQL it’s not the same . It has some square boxes ? sign , in it.

    Please help me

  20. name
    June 28, 2009 at 2:22 pm (9 years ago)

    Your Site Is Great,

  21. Praveen Kumar
    April 23, 2009 at 4:12 pm (9 years ago)

    Dear…………….

    i want to type hindi in microsoft word using Indic translator software for free. how can i use this software ?
    what is the processor to install this software for free.
    I need it urgently.

    Thank You

    Praveen Kumar

  22. Poornima
    March 21, 2009 at 12:47 pm (9 years ago)

    Hello Gopinath,

    I want to use this URL in my c# application. Help me how to use..

    Regards,
    Poornima.

  23. devang
    March 9, 2009 at 4:54 pm (9 years ago)

    i want to type hindi in microsoft word. how can i use this software ? at present in google indic transliteration toll, i type in english and it converts into hindi. But after copying from it and pasting it in microsoft word, it doesn’t seem properly. it seems squares. so please reply me.

  24. CMouli
    March 4, 2009 at 1:48 pm (9 years ago)

    Now Google transliteration seems to work in Chrome.

  25. Keralites
    February 27, 2009 at 5:11 pm (9 years ago)

    Could anyone figure out why google api for transliteration doesnt work in Google Chrome ? It works in other browsers. But at the same time http://www.google.com/transliterate/indic in Google Chrome is perfect.

    • Gopinath
      February 28, 2009 at 10:24 pm (9 years ago)

      Google transliteration is one among the many sites that does not work on Google Chrome browser

  26. Gopinath
    February 12, 2009 at 9:24 pm (9 years ago)

    subha,
    this is not a download or an API kit that can be downloaded. As mentioned in the post, we can read the RSS output for a given URI that contains the word needs to be translated.

  27. subha
    February 12, 2009 at 11:10 am (9 years ago)

    Whether I can free download this software? If yes? how to download

  28. Purushotham
    January 28, 2009 at 11:32 am (9 years ago)

    Hi,
    IT would be really helpful if you can provide an example to access this Transliteration API in java.
    Thanks

    • Gopinath
      January 28, 2009 at 2:05 pm (9 years ago)

      Purushotham,
      I’m sorry. I don’t know Java programming.

  29. shitu
    January 24, 2009 at 12:56 pm (9 years ago)

    Thanks!!

  30. shitu
    January 23, 2009 at 7:11 pm (9 years ago)

    How do you make GIF image?

  31. Gopinath
    January 23, 2009 at 10:26 pm (9 years ago)

    @shitu,
    I use Camtasia Recorder software.