Menu Close

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

  1. aredkid

    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

    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

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

    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

  5. Srinivasan C

    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

  6. Nick

    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

  7. kumar soundarajan

    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

  8. Vijay

    Gopi,

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

    Thanks
    Vijay

    • Gopinath

      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.

  9. MAK

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

  10. Abhi

    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?

  11. jitesh dundas

    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);
    }

    %>

  12. european

    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

  13. pawan kumar choudhary

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

  14. Ranjeet

    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

  15. Praveen Kumar

    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

  16. Poornima

    Hello Gopinath,

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

    Regards,
    Poornima.

  17. devang

    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.

  18. Gopinath

    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.

  19. Purushotham

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

Comments are closed.

%d bloggers like this: