Encoding numbers in RLE Compression

311 views Asked by At

I am working on implementing dynamic version of RLE compression.

On this version I only insert characters count in the RLE Code if it's more than 1, other than that I keep it as its original state.

The problem I encounter here when trying to encode numbers in the original input text.

Is there any way to encode them like alphabet characters without losing efficiency of the RLE compression ratio.

Example

text = "aabccc 123 ghe dd12 Goooooal"

I want to encode it like:

2ab3c 123 ghe 2d12 G5oal

But I need some kind of encoding for 123 and 12 in RLE code.

0

There are 0 answers