Friday, March 12, 2021

...and Suddenly, Huffman is Basically Ready

Okay okay, I know it's stupid o'clock.

Remember how I said a few hours ago that I was pending the canonical Huffman codes?

Well, I finished writing the generalised canonical Huffman code generator. I actually went one step further and made it bi-directional---I could transform from the generalised canonical Huffman code into the code book that was generated by the normal Huffman encoding algorithm.

I went even further than that though---I added a rudimentary [lazy] encoder that emits output symbols based on an iterable input, and also a rudimentary [lazy] decoder that emits source symbols based on an iterable of coded symbols.

In short, I have a working [abstract] Huffman encoder/decoder. I just need some file I/O related support routines, and some means of generating the first order statistics that the Huffman encoder needs to generatee the relevant encoding.

And it's only nearly 0200hrs. Urgh.

I should go take a shower and turn in for the night.

Till the next update.

No comments: