Wednesday, September 30, 2009

Xlit: CDAC Transliteration API

Welcome to the Xlit Ajax API usage-discussion blogpost !!

Note : Please note that usage of this free API for commercial applications is 'STRICTLY PROHIBITED'. Also, in case of interested in using this API,
please write to us so that your webpage can be linked from our repository.

Here, you can discuss any suggestions and/or issues involved with using the API for transliteration or give your feedback.

Xlit : Ajax API Usage Documentation

One of the easier ways to start learning about Xlit Ajax API is using the command line tool 'wget'; execute the following command:

wget --post-data 'srclang=en&trgtlang=hi&inpword=Hello&inputval=5&ui=xml' "http://www.cdacmumbai.in/xlit/editor/getXlatn"

Understanding the command:

This command performs a language transliteration (/xlit/editor/getXlatn) for hello (inpword=hello) from English to an Indian Language (here Hindi : srclang=en&trgtlang=hi). The other language options are listed elsewhere in this document. The response has a Content-Type of 'text/';charset=utf-8. The 'inputval' determines the # of possible alternatives of the given input word in the target language (limited to 5 as default higher limit).

The response returned to this request takes the format as specified with 'ui' in the query. The possible values that ui can take are :

'ui=xml' - This ui format returns the response in the form of a simple xml tree.[Content-Type: text/xml]

'ui=plain' - This ui format returns the response in the form of plain text readable in any text editor supporting unicode font rendering. [Content-Type: text/plain]

Note: Not including the variable 'ui' in the query, invokes the default response with 'Content-Type:text/html'

The following section shows a code snippet that demonstrates API access from Javascript:
*[url=http://www.cdacmumbai.in/xlit/editor/getXlatn]

xmlHttp= GetXmlHttpObject();

xmlHttp.open("POST", url, true);

xmlHttp.setRequestHeader("Content-Type","text/html;charset=utf-8;");

xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

xmlHttp.setRequestHeader("accept-charset","UTF-8");

var formData ="srclang=en&trgtlang=hi&inpword="+encodeURIComponent('Hello')+"&inputval=5&ui=plain";

xmlHttp.send(formData);

Similar API access from other languages/non-javascript environments like Flash, Java, PHP and Python, etc. is easily possible. You would be required to only construct the url and establish a connection.

Other Indian languages' support is in the pipeline for Marathi [mr], Tamil [tm], Telugu [tl], Kanada [kn] and Malayalam [ml].

We encourage you to participate and help us mould the API so that it serves you better day after day!

Post your comments/feedback/queries here.You may also wish to write to us at kbcs[AT]cdacmumbai.in

Sarvesh Nikumbh
Xlit Team

Thursday, September 17, 2009

XlitHindi installation issues and Error Messages

Here are some problems you may face while installing the XlitHindi in OpenOfice.You may come across these while installing other extensions also. These are not specific to Xlithindi.

1] For error:
(com.sun.star.registry.CannotRegisterImplementationException) { { Message = "", Context = (com.sun.star.uno.XInterface) @0 } } } }

>>>> Please install 'openoffice.org-java-common' package from Synaptic manager [specific to Linux machines]

2] For error: Unable to load java while installing the extension

>>>> Please check that your machine has java 6 or above, installed. If you have it and you are still facing the same problem, now you need to mention path of the JRE to be used, in OpenOffice.Please do it this way:

* Go to Openoofice Writer: Tools --->Options --->OpenOffice.org ----->java.
* Now check 'use a Java runtime environment' and if you see one/more JREs there, select it/one of them.
* click 'OK'. You may try installing the extension now.

If you don't see any JRE in the window, click 'Add' and select the JRE you want to use from the file browser window.


Error Messages:
While using the XlitHindi you may come across the error message saying: "Transliteration Failed. May be a Network problem"
It means either your computer is not connected to INTERNET or OpenOffice is facing problem in connecting to internet or our server is down.
Upon such error please check your internet connection.If you are behind proxy please set the Proxy settings in OpenOffice as:

Go to Tools----->Options --->Internet--->Proxy.
Now select System . Say 'OK' and try using xlitHindi now; if that doesn't work select 'Manual' instead and fill the 'HTTP Proxy' and 'Port' numbers.

If  your OOo starts not responding  while you are trying the extension, please check your installed JAVA. To run the extension properly you need  "Sun Java" and not the "Free software foundation Java". Check this in Tools --->Options --->OpenOffice.org ----->java;  and make sure that, the Java being used is Sun Java. 

Please feel free to suggest/comment/query!

Prakash B. Pimpale
Xlit Team

Monday, September 14, 2009

XlitHindi extension for OOo released

KBCS, CDAC Mumbai has released its transliteration extension for the OpenOffice writer. Using this tool enables you to write in Hindi very easily without knowing the Hindi typing.It will be helpful for the people who use Hindi for the e-communication and documentation.The details of the English to other Indian Language transliteration system can be read at:http://www.cdacmumbai.in/xlit. This tool is really helpful for those who need the data entry in Indian Language, the Display or processing in Indian Language, like the government web sites meant for the citizen, the companies willing to target the non-English knowing consumer [having access to Internet], etc.
The XlitHindi extension can be downloaded from the OpenOffice extension repository [to directly reach XlitHindi page use this link http://extensions.services.openoffice.org/project/xlithindi ].
For any queries or problems you face, please feel free to comment.