On optimally partitioning a text to improve its compression