Latin Thaana Converter 2.0

Latin Thaana Converter is a small, simple software for Microsoft Windows that performs transliteration on latinized (i.e. romanized) Thaana to convert it back into the Thaana script. This is a tool I originally released in 2003 under the name "Latin Dhivehi Converter"/"Lat2Dhiv". This new release carries a new name (which I think is a more technically correct name for what it does) and sports a few aesthetic changes but is functionally almost exactly the same as the original - it is basically a recompile of my old code within the .Net framework.

Automated transliteration of Latin Thaana is not an entirely easy task. Look up table based algorithms are simple to implement but are unable to correctly handle cases of sukun, present issues with most other fili and generally have a host of other problems as well. Latin Thaana Converter utilizes a finite state machine and its transliteration mappings are based on a more extensive scheme extracted from an analysis of a body of Latin Thaana-to-Thaana sample data. It maybe worth mentioning that the analysis had revealed that upto 4 characters were being used (and needed) for some Thaana transliterations. However, it must be said that the quality of transliteration from this is limited by the accuracy and diversity of the sample data I had used and hence is by no means perfect.

Since writing this program in 2003, I have experimented with probabilistic FSMs and also put machine learning techniques to the task with better results. I plan to write more extensively on Thaana transliteration algorithms at a later time...

Usage
1. Copy-paste or type the Latin Thaana text into the "Text in Latin Thaana" box.
2. Click "Convert".
3. The converted text appears in the "Text in Thaana" box.

Download
Latin Thaana Converter 2.0 (126KB, Windows only)

Hope someone finds it useful :-)

Javascript Thaana Keyboard version 4.1

I released Javascript Thaana Keyboard v4.0 only 10 days ago but I've since been made aware of a few bugs in the script that had gone unnoticed during testing back then. I decided to cut another release to fix those bugs which, although minor, could potentially be annoying to end-users. This new release also crams in a few tweaks to improve performance.

Changelog:

+ Fixed handling of Delete key and other special keys
+ Added correct handling for Thaana brackets "()"
+ Improved performance

Usage:

Usage remains same as before, so please refer to my post on the 4.0 release.

Demo:

Check out the demonstration and testing page here.

Download:

- full source version (10.6 KB)
- packed version (2.46 KB) [recommended]

Javascript Thaana Keyboard version 4.0

Here is an update to my Javascript Thaana Keyboard (JTK). This 4.0 release packs in a bunch of new features, making JTK much more powerful and more flexible than any of the earlier releases.

Keyboard support:


Most notable on this new release is the introduction of support for the various different types of Thaana keyboard in use. JTK now supports the following keyboard layouts:

Phonetic (Segha version): This keyboard is perhaps the most popular Thaana keyboard layout. JTK identifies this keyboard as "phonetic".

Phonetic (Hassan Hameed version): This keyboard is similar to above but notably differs in its mapping of alifu, abafili, aabaafili, gaafu and the sukun. JTK identifies this keyboard as 'phonetic-hh'.

Typewriter: This is the standardized Thaana layout used on typewriters. JTK identifies this keyboard as 'typewriter'.

Browser support:


JTK 4.0 adds support for IE5.5, which has a very significant market share still. Hence JTK should now work perfectly well on Microsoft Internet Explorer 5.5+, Mozilla Firefox 1+, Opera 9+, Apple Safari 2+ and Google Chrome 0.1+.

Basic usage:


The basic usage allows for fast and easy integration of JTK on your Thaana web pages.

1. Link the file in the HEAD section of the page:
<script type="text/javascript" src="jtk-4.0.packed.js"></script>


2. For any element accepting input (i.e. INPUTs, TEXTAREAs, content-editable DIVs), assign them the special class name "thaanaKeyboardInput". JTK will automatically handle text entry to any element with that class name. You can assign further classes to the elements without ill-effect, if needed.

3. There are two ways to set the keyboard used for an element.
defaultKeyboard method: This method allows setting a default keyboard to be used on all elements handled by JTK. To do this, add the following to the HEAD section of your web page but make sure it is added after the code inserted from step 1 above.
<script type="text/javascript">
thaanaKeyboard.defaultKeyboard = 'phonetic'; // can be either 'off', 'phonetic', 'phonetic-hh' or 'typewriter'
</script>


thaanaKeyboardState method: This method allows per element control on the type of keyboard used by an element handled by JTK. To do this, add a form element (can be a radio, checkbox, select, hidden or text field) with its name set to the text entry element id suffixed with the string "_thaanaKeyboardState". The value of these fields should specify either 'off', 'phonetic', 'phonetic-hh' or 'typewriter', indicating the status and the keyboard in use.

So, if you had a text entry field with the id "fullname" then the keyboard could be specified using a hidden field as follows:
<input type="text" class="thaanaKeyboardInput" id="fullname" />
<input type="hidden" name="fullname_thaanaKeyboardState" value="phonetic" />


4. Make sure that the text direction for the Thaana fields is set to "rtl". This can be easily achieved using CSS, by adding a class definition for the "thaanaKeyboardInput" class or by any other method of your choice. Adding the following to your CSS definition should suffice for most uses:
.thaanaKeyboardInput {
font-family: faruma, 'mv iyyu nala', 'mv elaaf normal';
direction: 'rtl';
}


If the above instructions are followed correctly, the JTK Thaana functionality would be in effect soon as the page has loaded!

Advanced Usage: The JTK object, methods and properties


To facilitate advanced integration functionality for developers looking to have (finer) control over its behavior, JTK now makes itself available as a public object named "thaanaKeyboard".

The following properties and methods exposed by the "thaanaKeyboard" object:

defaultKeyboard: [property] The Thaana keyboard layout type to default to when JTK enabled elements do not have a keyboard specified.
Valid values are: 'off' to keep Thaana disabled, 'phonetic' to use the standard phonetic layout, 'phonetic-hh' to use the phonetic layout by Dr. Hassan Hameed and 'typewriter' to use the typewriter layout.

setHandlerById ( id, action ): [method] Sets the state of the JTK handler for a page element.
The id argument should be a string containing the id of any content-editable element. The action argument should specify either "enable" or "disable" depending on whether input handling for Thaana should be enabled or disabled, respectively.

setHandlerByClass ( class, action ): [method] Sets the state of the JTK handler for a set of page elements.
The class argument should be a string containing the class name of any content-editable element (i.e input, textarea etc). The action argument should specify either "enable" or "disable" depending on whether input handling for Thaana should be enabled or disabled, respectively.

License:


JTK 4.0 is released under the MIT License, allowing its use in both personal and commercial applications as long as the copyright and license permission notice remains intact.

Demo:


Check out the demonstration and testing page here.

Download:


- original full source version (10.0 KB)
- packed version (2.33 KB) [recommended]

As always, drop a line here if you use it and/or have problems or suggestions. Enjoy. :-)

Update (31-Oct-2008): This version is now superseded by release v4.1.

PHP script for live Hulhule flight info

The Maldives Airports Company has rolled out a website (http://www.fis.com.mv/) where real-time flight arrival/departure information is available. It's about time they did that and I am sure many people will find it very useful.

I wrote some code yesterday for Nattu, who is currently developing a new website for Haveeru News, to get the data from the Flight Information Services (FIS) website and display it on the Haveeru website. Haveeru has access to an XML feed of the data with more fields available than that shown at the FIS site. The script I wrote implements a class that parses the XML file and provides easy access to the flight information via the class properties.

Sadly, the XML feed is not (yet) available to the public and so today I modified the code so that it works by scraping the publicly available data on the FIS website. The code implements an object called "flightinfo" that can be used in any of your PHP applications and the data displayed as you please. I've included a demo sample file as well.

- Download the flightinfo script

WebSMS for blogs, websites and Google personalised home

Here is something I conjured up in the minutes of freedom after "work" last night. It is what I would call a widget - a WebSMS widget. The idea for the application came after a blog reader by the handle Vayfarer emailed me asking for advice on implementing a "Gadget" for Google personalised home. Anyway, two and a half hours later, I had this baby all wrapped up just as I wanted it.

This "widget" can be added to your blog or website. You will be able to host this widget on your own server when I release the source code, until then you are welcome to use the service based at the Technova server. The widget supports skinning the widget with your own CSS files and so can be made to fit the look of your blog and/or website. I will be releasing the source code for the project soon - right after I flush any major bugs that crops up the coming few days.

widget_websms


I've also made available a "gadget" package for adding the WebSMS widget to the Google "personalised home".

websms widget at google homepage


Here is live demo:


Interested in getting one for your blog/website or adding it to your Google homepage? Click here to go to the widget's homepage at Technova.

Have fun.

PS: Other SMS related stuff that I've released previously include, a SMS Sender program which you can run on your Windows/Mac/Linux computer and a WebSMS tool for phpBB forums.