luikore / triez

fast, efficient, unicode aware HAT trie with prefix / suffix support for Ruby
MIT License
140 stars 9 forks source link

Is there a way to save a Triez to file and load it again? #2

Open canadaduane opened 10 years ago

canadaduane commented 10 years ago

Nice work with this gem. I've been looking through the source for possible ways to save and load a trie using Triez. I haven't seen anything in the source yet, but I'm curious if you have any thoughts or suggestions?

luikore commented 10 years ago

Thank you. I think this feature is very important too!

But the underlying implementation (HAT-trie) can not do this either...

HAT-trie is composed of data buckets, we may save and load these buckets in a shorter time than iterating all key-values. I think it's not hard to achieve the goal (just change the memory allocation functions and serialize chunk pointers), or, maybe some one has already done it (do you have any idea?). Currently I'm working on other stuffs but will come back try to make it next week.

lilith commented 10 years ago

I ran into this issue too. Marshal.dump/load compatibility would be fantastic, even if at a performance penalty.

oddg commented 9 years ago

I am also really interested in this feature. Did you find a way?

canadaduane commented 9 years ago

I started work on it, but did not finish due to a hope that the code bases would be merged first so that my effort would benefit both this project and upstream.

On Mon, Feb 23, 2015 at 4:01 PM, oddg notifications@github.com wrote:

I am also really interested in this feature. Did you find a way?

— Reply to this email directly or view it on GitHub https://github.com/luikore/triez/issues/2#issuecomment-75656997.