Encode the text with huffman code and compute metrics on it.