Active Topics

 


Reply
Thread Tools
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:
Traecer's Avatar
Posts: 165 | Thanked: 9 times | Joined on Jul 2007
#2
That sounds great Roger, and makes me want to take a look at Mozilla and XUL again (last time I looked at XUL, it was new, and the API kept changing). Unfortunately, unless something has changed, I doubt XUL will make it to the IT platform, as their <=400MHz processors just don't have the power to interpret XUL fast enough to make it an effective UI.
 
Texrat's Avatar
Posts: 11,700 | Thanked: 10,045 times | Joined on Jun 2006 @ North Texas, USA
#3
Very, VERY nice work! That's what the internet is for!
__________________
Nokia Developer Champion
Different <> Wrong | Listen - Judgment = Progress | People + Trust = Success
My personal site: http://texrat.net
 
RogerS's Avatar
Posts: 772 | Thanked: 183 times | Joined on Jul 2005 @ Montclair, NJ (NYC suburbs)
#4
Originally Posted by Traecer View Post
Unfortunately, unless something has changed, I doubt XUL will make it to the IT platform, as their <=400MHz processors just don't have the power to interpret XUL fast enough to make it an effective UI.
Well, in the current state of things, you must be right.

But processors get faster, and who knows? Maybe some way to compile XUL into something more compact will come along.

Makes me curious as to whether MicroB's UI was built entirely by hand or whether there was a XUL to Hildon tool to do some of the work . . .

Originally Posted by Texrat View Post
nice work!
Thank you for the compliment. I want to give credit to the developers whose work I built on, but I'm reminded too of what a friend told me: "Magicians don't invent every magic trick they do." So in that regard I appreciate your appreciation.
__________________
N900 Guide Brief intro to the Nokia N900 (http://n900guide.com/)
Maemoan since July 2005 )
 
Traecer's Avatar
Posts: 165 | Thanked: 9 times | Joined on Jul 2007
#5
Originally Posted by RogerS View Post
Well, in the current state of things, you must be right.

But processors get faster, and who knows? Maybe some way to compile XUL into something more compact will come along.
Well, at the risk of starting a flamewar with the Javaistas, that's what happened with Java. Java was an absolute dog on ~200MHz processors when it was released. Somewhere in the 500-800Mhz range Java apps became usable, and on today's Ghz+ machines the difference between native and Java apps is unnoticeable except for some occasional UI oddities. OTOH, the Java VM and associated tools matured a lot during that time as well, and cut down versions like ME appeared for low-power devices. So some sort of super-speedy XUL interpreter isn't out of the question, but I do agree that it won't make a difference when our tablets all have 800MHz+ processors.
 
aflegg's Avatar
Posts: 1,463 | Thanked: 81 times | Joined on Oct 2005 @ UK
#6
Originally Posted by RogerS View Post
Makes me curious as to whether MicroB's UI was built entirely by hand or whether there was a XUL to Hildon tool to do some of the work . . .
Nope: the browser application (i.e. the UI) is separate to the engine. This allows Opera, WebKit and Mozilla-based engines to display the page within the application container provided. This is what's Hildon-specific and why when using Opera, the UI is identical to that used in microb.
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Now known as
Jaffa
 

The Following User Says Thank You to aflegg For This Useful Post:
Posts: 19 | Thanked: 0 times | Joined on Jan 2010 @ USA
#7
I know this is old treat .. but i dont want to create new one just because i ask a single question .. Can i get this add on for Nokia N900 ? .. do i need to install khmeros font to support khmer language if so, how do i install font to Nokia N900, i am really noob to Linux ( win user ) ..
 
Reply


 
Forum Jump


All times are GMT. The time now is 13:34.