[KDE-Sonnet] dictionary service
Raul Fernandes
rgfbr at yahoo.com.br
Sat Mar 10 13:22:58 CET 2007
> I haven't taken a look to ktranslator, what are its
> extended functionalities
> (when compared with kdict)?
Actually, KTranslator and KDict are quite different
dictionary programs.
KDict aims to access DICT servers to get the
definition of a word. KTranslator is a program that
uses dictionaries in local files to translate a word.
One program that likes KTranslator is the Wordtrans
(http://www.escomposlinux.org/rvm/wordtrans/).
The other difference between KTranslator and KDict is
that KTranslator uses several types of dicionaries, eg
DICT files (not servers), StarDict, Babylon, Sdict,
plain text files...
> What is expected from a Dictionary service?
Search a word in all dictionaries or only in some of
them, add dictionaries, delete dictionaries, list
dictionaries and get some info about dictionaries
used. Anyone has other ideas?
> Would it be a background thread? A library?
I'm in doubt if we should create a service or a
library to handle dictionaries. Creating a service
will add some unnecessary overhead to the system as
the user only uses dictionaries a small part of time.
Creating a library we can loose the ability to manage
the dictionaries in a central way.
> Would it include a thesaurus?
Of course.
I have made a draft in UML of such library to help
clarify things. You can access such draft in
http://ktranslator.sourceforge.net/dictionaryservicedraft.png.
If anyone has suggestions, tell me.
The library will be composed by a manager class that
holds the pointers to all dictionaries currently in
use. This class will add, delete and list the
dictionaries. The addDictionary will be a factory
method, ie it will get the filename, find out what
type of dictionary it is and load the dictionary.
All dictionary type classes will inherit from a
superclass, called DictionaryBase, that has the common
attributes of all dictionaries and abstract the access
to different types of dictionaries.
Here, I put only one method to search for the word. It
will do a exact match search in all dictionaries. Of
course, there will be others.
I think this is a good start to the dictionary service
(or library). I'm waiting for others ideas or
suggestions if anyone has some.
Regards
Raul Fernandes
rgfbr at yahoo.com.br
__________________________________________________
Fale com seus amigos de graça com o novo Yahoo! Messenger
http://br.messenger.yahoo.com/
More information about the kde-sonnet
mailing list