However, this approach is not necessarily the best, and can have serious performance problems. Try to fix them, or show that they cannot be fixed.
The Lempel-Ziv algorithm is a compression algorithm, used to compress text. It is based loosely on the heuristic that strings that have been common in the past will be common in the future. A full description of the algorithm can be found in Lewis and Denenberg, and a simple implementation is available from the course staff, if appropriate for your paper.