Quantcast
Channel: STEP - Science, Technology, and Education in Pakistan » Technology
Viewing all articles
Browse latest Browse all 10

A Hindi to Urdu Converter and Urdu Transliteration Bookmarklet

$
0
0

Dynamic Language Tools is a bookmarklet application which I have developed, which helps users read and write Urdu easily on any web page without installing any software. This tool uses the Google Transliteration API to do the on-demand transliteration of the roman script to Urdu script.  This tool also provides on the fly Hindi to Urdu transliteration on the web-pages making all the Hindi content (in the Devanagari script) readable to Urdu readers.

As this application internally uses the Google Transliteration API, so, all the supported Google transliteration language pairs are available via this application. To use this application, one first need to save its bookmarklet in their web-browser, similar to creating a normal webpage bookmarks, and that’s it. The one main advantage of using the bookmarklet technique is that you don’t need to install anything on your machine, plus it automatically updates itself on the next load, so users will always see the latest version without running any updates.

urdu01How does it help in writing Urdu? To write Urdu in any text box on web-page, one needs to first load this application by clicking its saved bookmarklet link. Once the application is loaded in that page context, the user may enter text in Urdu using roman script in any text box on that page. To activate the Urdu Entry mode, one needs to simply press ‘Ctrl’ and click in a text box. When the Urdu mode is activated, the text-box orientation is changed from left to write, and an آ image is displayed in the background of text box indicating that Urdu mode is now active. In the Urdu Entry mode, if a user enters roman text like “Ye to bhat shandar khabar hai.”, it will be auto-transliterated and displayed in Urdu script i.e. “یہ تو بہت شاندار خبر ہے.”.

This Urdu mode entry works nearly on all the web sites pages, and all types of text boxes, i.e., one-liner, multi-liner, dynamic, and rich-text editors (as used in Google and Yahoo web mails). Using this tool, one can comment in Urdu on any website, can send emails in Urdu, can set their Facebook status in Urdu or can even chat with friends on Facebook in Urdu. These are just few examples of how and where this tool can be used, but basically using this tool you can write Urdu on the web everywhere you can currently type English without installing or changing any thing on the website.

urdu02How does it help in reading Urdu? The main inspiration behind this tool development was not actually Urdu writing. In fact, there are many existing tools and applications which let users type Urdu either using a special keyboard layout or by using roman script transliteration. What actually inspired me to develop this tool was to provide a way to easily convert the roman content on all the existing web-pages to Urdu script so that it is more readable. For example, there is a good poetry archive on www.urdupoetry.com, but all of that is in roman script. This is where this tool comes handy, and it lets user perform on-page transliteration of the existing roman Urdu content on the web-page without leaving that page. The transliterated text is displayed in place of the original text keeping the same format and layout. One can do this transliteration simply by just highlighting the text, and clicking the “Transliterate Selected Text” button in the preferences dialog of the bookmarklet. It also displays the original text (before transliteration) when the user moves the mouse over the transliteration text. Another handy feature is that one can also view alternate transliteration options and apply those by double clicking the transliterated words.

urdu03Why Hindi to Urdu transliteration? Hindi and Urdu languages share grammar, morphology, and a huge vocabulary, yet the majority of readers of both languages can’t read the other written language mainly because Urdu is written using the Arabic script while Hindi is written using the Devangari script. The speakers and readers of these two languages combined are more than a billion. So, if we can provide a good transliteration between these two languages, it can serve a very large community. Some very good work has already been done in this field, notably the Hindi to Urdu Transliterator by CRULP, and Hindi Urdu Machine Transliteration by M G Abbas Malik. Even though the results of these transliterations are good, they are not excellent because Urdu language has more than one equivalent character for a Devanagri character. For example, the character त (ta) in Hindi has two equivalent characters ت (tay) and ط (toey) in Urdu. Similarly, the Devanagari character ज़ (za) could map to ز (zay), ض (zoad), ذ (zal) and ظ (zoay) Urdu characters depending on the context and language rules. This becomes tricky to handle without complex language processing rules and dictionary. What I have done for this tool is a two step process. First, I transliterate Hindi to the corresponding roman script using the combination of the ITRANS and IAST transliteration rules to produce a roman script which is best for the transliteration. The transliterated roman text is then passed to the Google Transliteration API for English to Urdu transliteration and as a result the Urdu script you get using his technique is almost accurate. Of course, similar to other transliterations supported by this tool, one can perform Hindi to Urdu transliteration on the fly (without leaving the page), and you can also do the transliteration corrections on the transliterated words.

What’s next? It’s not the end; it is actually just a start. I have been getting a lot of feedback and suggestions from friends and the community. Other than tweaking and improving the interface, I’m also working on the Google Translation integration. I also plan to integrate dictionary and image lookup-up for selected words. So stay tuned and keep sending your valuable feedback and comments.

About the author:

Akbar has been developing software for more than 12 years. He is an Application Architect at Jin Technologies Pvt Limited.  He also does software development as hobby and some of his freeware utilities/projects are available at his site. He maintains a blog to share the software tips and tricks with community. When he is not doing software development, he loves to spend time with his family, watch movies and fly & build R/C planes!


Viewing all articles
Browse latest Browse all 10

Trending Articles