Burrows-Wheeler Transformation
This example script implements the Burrows-Wheeler
Transformation followed by the simplest MTF (move-to-front)
encoding and adaptive arithmetic encoding. Please enter the string to be
compressed. Thereafter several steps of this packing method will be
examplified. In special (if the string is not too long), matrices
corresponding to the cyclic rotations of the string, and the same matrix in
a sorted form will be depicted. Output of the BWT transformation, MTF
encoding and arithmetic coding will be shown. NB! This program has just been written for fun, don't expect it to be optimized or bugless (one of the known bugs is that computing invariants is too slow, and since PHP is not a very good optimizer of such programs, we only find invariants for very short strings)!