lifi-projekt · concept demos all demos

the text squeezer

paste any text. it gets packed as you type: repeats become pointers, frequent letters get short codes — and you see what is left.

try:
keys 1 to 6 pick an example. the bars compare against the smallest fixed code for this text's own alphabet: with 32 different characters, 5 bit each. every repeat of three characters or more becomes a pointer, even where the pointer costs more than it saves; a real packer would leave those characters alone.
trick one: point back (what the packer writes)
a pointer copies one character at a time, each from the given distance back, and never reaches for a character that is not written yet. so it may reach into its own output: (5 back, 9 long) after "afde " writes "afde afde", and (1 back, 258 long) after one "a" writes 258 more. that is how one letter, 400 times, gets packed.
trick two: count first (the codes for the letters that remain)
what repeats or comes often can be said shorter. what is new every time cannot, and the bookkeeping makes it grow.