DICT-NetMOT Gateway Updated
Categories: [ IT ]
The DICT-NetMOT Gateway I wrote some time ago suffered from an annoying bug: when the list of dictionaries at the source website is updated, the gateways uses the wrong dictionary (not-so-long story short: dictionaries are identified by index, and when the indexes change, it looks up in the wrong one). This has happened one time too many it seems, because I decided to fix this and get the gateway to download the list of dictionaries instead of using a hard-coded list. Currently the list is downloaded only on startup, so if it changes, the gateway needs to be restarted. If I am motivated, I may get it to reload automatically after a given timeout. EDIT: I was motivated, I just changed it; it now reloads after 1 day. (2010-06-29).
Short names for dictionaries, used as DICT identifiers, are generated automatically, so this may not work properly for dictionary names I haven't seen yet (there is a risk of short name collision, there is not checking against it).
Dictionaries which should be looked up by default can be specified with a (hard-coded) list of regexps against which the dictionary's long name is matched.
Also, some unidentified time ago, I updated the gateway to use the new NetMOT interface. I noticed that it started to use AJAX to provide the user with a list of suggestions while typing in the query box. I then used this feature to add support for ‘prefix’ and ‘glob’ matching strategies (‘prefix’ is mandatory in the DICT protocol, so before that the implementation was incomplete, but who cares?).