-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialization of trie objects #9
Comments
While I cut/pasted that from SO, this would be super helpful for Having said that, it's super fast to re-create a trie so I'm not sure how high on the priority list this should be. Having said that, http://gallery.rcpp.org/articles/rcpp-serialization/ seems like it could help here. |
Mn; that's a lot of dependencies to add (including C++11) to urltools. I'm wondering if there could be a simpler way of doing it? What if we shadowed save and load to:
Alternately we could just bite the bullet and add C++11 and all the rest (not as horrendous an imposition as in days of yore) which would also allow me to write ye olde crappy inefficient URL extractor (which I think is a feature request of yours from waaay back) into urltools. Thoughts? |
I'm all for C++11. I've started making it the default for new Rcpp packages On Sun, Oct 2, 2016 at 5:29 PM, Oliver Keyes [email protected]
|
boB, any thoughts on how exactly one would hook a custom function here up into save() or load()? (I mean, aside from telling the user to do it ;p) |
Update: yeah working out an elegant way of doing that is my main blocker. There are 11192342 ways of serialising and deserialising objects, but making it nice to do is a different matter. |
+1 |
Oh! So just a two-column df analogue? |
Ref: http://stackoverflow.com/questions/39769316/save-on-disk-an-r-object-of-type-externalptr
I have used the neat library
triebeard
that implements tries in R.I created my trie using the following syntax:
myTrie <- trie(keys = unigram$words, values = unigram$frequency)
It works perfectly, so now I'd like to save the variable
myTrie
on disk for future usage. Unfortunately the variable is of typeexternal pointer
:So it looks like I cannot used the standard
save
function to store the trie to disk. Is there a way to access the object referenced by the pointer? Or is there a way to save on disk the objects referenced by the pointer?The text was updated successfully, but these errors were encountered: