KDict: A replacement for QDict

Eray Ozkural kde-optimize@mail.kde.org
Wed, 12 Feb 2003 01:13:02 +0200


Well,

As I have said this isn't a hash table, and I'm not too interested in 
implementing a hash table...

This is an implementation of "dictionary of strings" ADT.

If what you need is such a thing then you can use KDict, what did you exactly 
need? Is that the stuff I might have seen in kmail?

If what you want is a dictionary of a large number of strings then this is 
what you're looking for.

KDict is an adaptor over a generic trie implementation (actually very 
generic). There is also another interface that is a little different from 
KDict maybe that could be extended to serve your needs.

Name could of course be changed to KDictionary but wouldn't that be more 
suitable for the application itself I wonder? Anyway, that's not an issue :)

Regards,

On Wednesday 12 February 2003 00:02, Scott Wheeler wrote:
> A couple of points:
>
> First the name has to go.  KDict is a KDE application.  :-)
>
> Second, while I haven't actually looked at the code, would you consider
> abstracting the hash table from the dictionary structure?
>
> Just last week I implemented a (minimal) hash table just because it's a bit
> hackish to use QDict for this (and it was also missing one API method that
> I needed).
>
> Cheers,
>
> -Scott
>
> On Tuesday 11 February 2003 21:44, Eray Ozkural wrote:
> > Hey there,
> >
> > I implemented a replacement for QDict class, which in my opinion is not a
>
> very
>
> > realistic implementation of a dictionary ADT.
> >
> > I used a standard Trie structure (prefix tree) to implement a hopefully
> > scalable sort of implementation. That is still sub-optimal but it is the
>
> most
>
> > widely used data structure for this sort of ADT, actually it's an
> > ordinary kind of project for a file organization or NLP course, etc. For
> > very small number of words QDict might actually be more efficient but
> > beyond that KDict should have better performance. (And KDict may still
> > have room for optimization... Please don't try to turn any recursive
> > functions to loop/stack combinations, I don't like that at all and gcc
> > has tail-recursion optimization)
> >
> > You can find the stuff in CVS HEAD, module: kdevelop/lib/structure
> >
> > Of course the crucial question is whether there are any applications in
> > KDE that might benefit from this data structure. I saw some QDict's in
> > imap code and I'm sure it's used elsewhere but is there anything that
> > tries to index a large number of words in-core?
> >
> > Then it would be worthwhile to try this class out.
> >
> > Thanks,
> >
> > --
> > Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
> > Comp. Sci. Dept., Bilkent University, Ankara
> > www: http://www.cs.bilkent.edu.tr/~erayo  Malfunction:
> > http://mp3.com/ariza GPG public key fingerprint: 360C 852F 88B0 A745 F31B
> >  EA0F 7C07 AE16 874D
>
> 539C
>
> > _______________________________________________
> > Kde-optimize mailing list
> > Kde-optimize@mail.kde.org
> > http://mail.kde.org/mailman/listinfo/kde-optimize

-- 
Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
Comp. Sci. Dept., Bilkent University, Ankara
www: http://www.cs.bilkent.edu.tr/~erayo  Malfunction: http://mp3.com/ariza
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C