Succinct Data Structures: Cramming 80,000 words into a Javascript file
stevehanov.ca
stevehanov.ca
BTW, if anyone is interested in succinct data structures, there are very good libraries for Java (http://sux4j.dsi.unimi.it/) and C++ (http://www.uni-ulm.de/in/theo/research/sdsl).
PS. the job listing at the bottom of the page is awesome, compared to the usual BS:
> Some benefits: You'll probably get a next-generation Blackberry that you have to hide under the table when in restaurants. You get to know what's going on when a call drops or a web page isn't loading. Plus, it's a small team so you get to own a large chunk of the project.
Makes me almost want to apply :)
I recently implemented an FM-Index[1] which supports the following operations:
- count() the number of occurrences of a pattern P of length m in O(m) time.
- locate() determine the locations of all occurrences of a pattern P.
- extract() extract any substring from the Text
- recover the original text
The most interesting part is that the size constructed index depends on the compressibility of the text itself. For English text roughly half the size of the original text.
Construction time and memory requirements, however are not that great.
I used some of the test data on the website to test my implementation [1] but didn't really compare to their other indexes.
Also make sure to always use the chilean mirror as the italian one is outdated (2005).
Thanks for the code, I've seen you are using libcds's wavelet tree. I was wondering if you had implemented your own, since apart from libcds and sdsl (and some unreadable research code) I couldn't find any other implementation of the WT so I'm always curious to see if there are any developments in the engineering of wavelet trees, the current implementations are still too slow to be really useful, I think.
This paper [1] is the most recent practical wavelet tree paper I know of.
Instead of RRR it uses RLE and gamma codes. Oddly, I have found no comparisons between this approach and RRR. I would expect RLE to compress better, and it is also conceptually simpler, but I don't know how fast it is.