Export to GitHub

dawgdic - issue #6

Perfect hashing


Posted on Sep 21, 2012 by Massive Ox

Hello,

What does it take to implement perfect hashing for DAWG? What I need is a bidirectional 1-to-1 mapping between integer numbers and string keys.

Comment #1

Posted on Sep 22, 2012 by Quick Bear

Hello,

I have a question about your suggestion. Does that mean an integer-to-string mapping or a string-to-integer mapping?

Comment #2

Posted on Sep 22, 2012 by Massive Ox

I mean each key is assigned an unique number and it is possible to get a key given the number and to get a number given a key (as in marisa-trie).

Comment #3

Posted on Sep 26, 2012 by Quick Bear

The idea is interesting but it's difficult in practice.

dawgdic cannot restore a key from its corresponding leaf node ID (because such a node may associate more than one keys), and thus an additional data structure is required for integer-to-string mapping. In addition, the mapping is nearly independent from dawgdic.

Therefore, I think this features should be provided as another library, not as a part of dawgdic.

Status: WontFix

Labels:
Type-Enhancement Priority-Medium