3 ms·
So this lets you compress a collection of strings and cheaply decompress any of them individually?
by scotty79 2y ago
So this lets you compress a collection of strings and cheaply decompress any of them individually?
- jcgrillo 2y agoYes, you can train a compressor[1] on a corpus of text, then compress individual words in the text and store their compressed bytes in e.g. a Vec<Vec<u8>>[2] and finally for any of the Vec<u8>s you can access the decompressor[3] and decompress (a slice of) the Vec<u8>[4]. [1] https://docs.rs/fsst-rs/0.4.1/fsst/struct.Compressor.html#method.train https://docs.rs/fsst-rs/0.4.1/fsst/struct.Compressor.html#me... [2] https://docs.rs/fsst-rs/0.4.1/fsst/struct.Compressor.html#method.compress_bulk https://docs.rs/fsst-rs/0.4.1/fsst/struct.Compressor.html#me... [3] https://docs.rs/fsst-rs/0.4.1/fsst/struct.Compressor.html#method.decompressor https://docs.rs/fsst-rs/0.4.1/fsst/struct.Compressor.html#me... [4] https://docs.rs/fsst-rs/0.4.1/fsst/struct.Decompressor.html#method.decompress https://docs.rs/fsst-rs/0.4.1/fsst/struct.Decompressor.html#...