View Single Post
RogerS's Avatar
Posts: 772 | Thanked: 183 times | Joined on Jul 2005 @ Montclair, NJ (NYC suburbs)
#1
As I wrote recently, I've been working on a Firefox extension. And despite my meager skills as a programmer, the Mozilla development environment stoops just low enough for me to climb aboard and do my thing successfully. This past Friday, the Click SEAlang extension entered beta. Even if I do say so myself, it is (or will be) one of the most useable dictionary extensions available for Firefox*.

I say that for a simple reason -- other dictionary extensions make you work too hard. Either you open up a panel, enter your word and look it up, or you highlight a word in your browser and the definition shows up in a separate tab or window.

I wanted to simply highlight a word and then see the results without leaving the page. And I managed that, again not because I'm a whiz but because the tools let me leverage my experience without requiring heavy-duty training.



In simple terms, that means I could use Javascript to do what I wanted instead of having to master C++ (or C or python or perl or ruby).

The release of the Gecko-based browser MicroB for the Nokia Internet Tablets excites me for precisely the same reason. The extension fits into the browser environment, leaving the heavy lifting for the full-time programmers, and weekend programmers like myself need only tangle with the smaller tasks of extending the browser into useful areas.

(MicroB won't take Firefox add-ons directly; in fact there'll be full-scale porting of any UI aspects, but the entry barrier looks comparable.)

So how did I get started on this path?

In my case, an article by Uche Ogbuche at developerWorks, "Browser extensions using XUL," got me looking at XUL a second time (XUL, pronounced "zool" as in "tool," is an XML-based language for building user interfaces).

As it happens, one reason XUL looked more attactive to me this time around is I had an idea for an extension. Or perhaps I should say I now had a problem I really needed solved, and Ogbuche's article convinced me I could solve it myself. What I wanted was a simple way to look up words in Khmer (eg, the Cambodian language), which I've been studying now for more than a year.

One difficulty I had when I started my Khmer studies stemmed from there being no online dictionaries in Khmer Unicode; no desktop dictionaries either, for that matter. But Doug Cooper at the SouthEast Asian Languages library (sealang.net) persuaded the publishers of Robert Headley's 1977 and 1997 Khmer-English dictionaries to let those two volumes be put online (with Headley's blessing, of course).

So about six months ago, I got early access to those dictionaries and began using them seriously.

Eventually I found the process of looking up words tiresome. And Ogbuche's article got me thinking: Why not just adapt one of the existing Firefox dictionary extensions?



I wish I could simply have taken one of the multitude of foreign-language-dictionary lookup tools and simply replaced the URI of the original language dictionary with one for SEAlang. That was my original plan. I wrote to Doug Cooper and asked if SEAlang had an API. He wrote back to say it didn't yet, but he would finish it, and soon enough we had concocted a much more elaborate plan. Our extension would enable a user to:

- look up any highlighted word in Khmer, Thai, Burmese or Lao and have results returned from the appropriate SEAlang dictionary

- search a monolingual corpus for any of those languages that would return sample sentences from texts published on the internet (which allows one to see how the word is used in context) and to specify the word collocated with some other word(s)

- search a bitext corpus of example sentences, again to see the word in context, but with word-by-word translations

- reverse-search the dictionary for definitions that include a specific English word

- reverse-search the bitext corpus for English words

And of course in our discussions, we persuaded each other that the key thing was to do this in a way that made the dictionary extension useful and easy to use.

We both agreed that that meant three things -- being able to access all the tools at SEAlang easily, being able to look up a word by double-clicking on it and using the right-click context menu to initiate the search, and seeing the results without having to leave the page with the highlighted word.

So we discarded every existing dictionary extension as too clunky to work from. We decided that third criterion meant using a sidebar to display the results, and not a separate tab or window.

Instead, we adapted the Split Pannel extension by max1million. It was the only extension we encountered that opened a side panel from a context-menu command that looked at what text was highlighted on the browser page.



Click SEAlang adds two commands to your context-menu -- one to initiate a dictionary search and one that pops up a submenu with options to search the corpus or bitext corpus, or to reverse-search the dictionary or bitext corpus for an English word. Right-clicking on a highlighted word and choosing any of these options opens a side panel, where the results are displayed. Further searches are also displayed there, with the user being able to navigate back and forth among them. The highlighted word shows up in the context-menu as does the user's preferred language when an English word is highlighted for reverse-search.

Because corpus results are often very wide, the user can indicate the results should be shown in a panel at the page bottom by using a right-click to choose the SEAlang command. (This is a feature provided by Split Pannel.)



Not necessary to Click SEAlang's functionality but provided by Split Pannel is the ability to drag any URI into the panel and have that page displayed there.

Most of the cleverness in this extension came from earlier work by other programmers. But I think that the value-add in Click SEAlang is significant. Which brings me back to my original point that, with a good framework, useful contributions can be made by even part-time programmers. I'm glad I didn't have to start from a blank page; I wouldn't have finished, I think. So I'm sitting here with a satisfied glow, knowing my contribution was simply the outside layer and very pleased to be able to make any contribution at all.

Simply from the great framework Mozilla has been building, I'm glad Nokia has moved to incorporate it (somewhat). I hope XUL will come eventually to Maemo because of the enlarged scope of possibilities it means for all of us.

The Maemo framework that Nokia provides for Internet Tablet application development parallels the Mozilla approach in many ways, especially in lowering the barrier to getting to an app.

__________

* Currently the Click SEAlang extension is hardwired to work only with the Khmer, Thai, Lao or Burmese dictionaries and other tools at SEAlang.net, with Vietnamese coming soon. But a generalized version will follow, allowing users to specify their own choice of dictionaries. And if you donít have a font installed for one of those SouthEast Asian languages, the current version wonít be of any use to you.
Read the full article.
 

The Following User Says Thank You to RogerS For This Useful Post: