Explore modules

LZ78 Dictionary Prefix Parsing

A growing dictionary compresses repeated phrases into references, and the final partial phrase needs its own precise rule.

Free theory article

A growing dictionary compresses repeated phrases into references, and the final partial phrase needs its own precise rule.

Concept & interpretation

LZ78 is a dictionary-based lossless data compression algorithm published by Abraham Lempel and Jacob Ziv in 1978. Unlike LZ77, which uses a sliding window over previously seen text, LZ78 explicitly constructs a dictionary of phrases. As the algorithm parses the input stream, it continually adds new, longer phrases to this dictionary.

experiment

In this interactive LZ78 Dictionary Prefix Parsing module, you can trace the dictionary building process step by step.

  1. Select 0010011 from the "Input word" dropdown.
  2. Set "Inspected tokens" to 2. Observe the token stream updates to 0:0 | 1:1 and the decoded prefix matches 001.
  3. Increase the "Inspected tokens" to 4 and watch the remaining tokens generated and dictionary expanding accordingly.
Read the full free theory article