stil/dawgdic

Perfect hashing

GoogleCodeExporter opened this issue · 3 comments

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.

Original issue reported on code.google.com by kmik...@gmail.com on 21 Sep 2012 at 3:30

Hello,

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

Original comment by susumu.y...@gmail.com on 22 Sep 2012 at 6:28

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect
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).

Original comment by kmik...@gmail.com on 22 Sep 2012 at 9:19

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.

Original comment by susumu.y...@gmail.com on 26 Sep 2012 at 11:54

  • Changed state: WontFix