This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def LZ77_len(lz77seq, alphabet, window_size=7): | |
""" | |
Utility to compute the length (in bits) of the LZ77 sequence. | |
Description: see A2 of Anthony Cioppa for details on computation. | |
Parameters: | |
lz77seq (string) The LZ77 encoded sequence. | |
alphabet (list) The alphabet of the message (ex: ['a', 'b', 'c', ..., 'z']) (Warning cannot contain digits!) | |
window_size (int, default=7) The window size. Must be positive. | |
Returns: |