Online dictionary plug-in
Introduction
While exchanging instant-messages, it is frequent to have to look up for a word definition or translation. However, this research is done routinely via a web page or another separated application.
For this reason, we propose to create a dictionary plugin for SIP Communicator. The solution is to create contacts able to give the definition or the translation of a given word.
Protocol's presentation
Fonctionnement général
We retain the DICT protocol, which use a TCP transaction based query/response protocol that allows a client to access dictionary definitions from a set of natural language dictionary databases.
Sample queries :
- DEFINE : find the definition of a word
- MATCH : find the similar words through a strategy
- SHOW DB : dictionaries list
- SHOW STRAT : list of the available strategies
What is a strategy : Strategie is use to search similar words,if a translation was not found, thanks to different approaches. For example the Prefix strategies will search words which begin like the word you would translate.
The system use a three digits return code. The first one is for the success (from 1 to 3) or the failure (4 or 5), the second is for the response category, for example : 0 for the syntax, 1 for informations, 2 for connexion, 5 for the dictionaries, ...
We have developed an exception class to handle errors messages and we added new codes to handle the java exception with the same class.
Implementation in SIP Communicator
We have created a new chat protocol in which a account is the DICT server and a contact check with a dictionary.
Contact wizard plugin
We have created two differents interfaces.
The first one is for novice user. We automatically create an account on dict.org and explain to user how to create more account.
The second one is if you want to create another account. In this one we suppose that the user is no more novice, so we ask him
to give us a host.
Afterthat, he was given to choice : choose a strategy if he wishes to or continue (in this case, we choose a strategy for him).
OperationSetDirectory
As we can see in the screenshot, adding a new dictionary isn't user friendly. First we don't know the dictionaries available on the server and the dictionay code isn't very explicit
Our idea was to use a list box in the add contact wizard filled with dictionaries names. This system may be used by other protocols like SIP (for example : search phone numbers through a LDAP database)
Diagram explaining how the new OperationSetDirectory is working
Conclusion and Evolution
Working on an open source project was a good experience for us. We manage to understand existing protocol and how to integrate wen protocol on
a software.
We would like to thank all people who help us during this project.
Evolution
- Finish implementation of OperationSetDirectory
- Handle Status of dictionnary (online,offline )
- Formatting the server response with html code
- Rename contact (ex : Collaborative Dictionnary of English for gcide)