implementation of LZW file compression for text files in Ruby