Relative-Lempel Ziv (RLZ)
A Relative-Lempel Ziv (RLZ) based LZ compressor that compresses against a large static dictionary.
This code implements the RLZ compressor, as described in:
What is RLZ (taken from the paper)
The Relative Lempel-Ziv (RLZ) scheme is a hybrid of several phrase-based compression mechanisms. Encoding is based on a fixed-text dictionary, with all substrings within the dictionary available for use as factors, in the style of LZ77. But the dictionary is constructed in a semi-static manner, and hence needs to be representative of the entire text being coded if compression effectiveness is not to be compromised. Furthermore, because RLZ is intended for large web-based archives when constructing the dictionary, it is infeasible to have the whole input text in memory.
Usage
use RlzCompressor;
use Dictionary;
let dict = from;
let rlz_compressor = builder.build_from_dict;
let mut output = Vec new;
let text = b"banana$aba";
let encoded_len = rlz_compressor.encode.unwrap;
assert_eq!;
let mut stored_decoder = Vec new;
rlz_compressor.store.unwrap;
let loaded_decoder = load.unwrap;
let mut recovered = Vec new;
loaded_decoder.decode.unwrap;
assert_eq!;
License
MIT