Re: A New/Old code Just For Fun



Fiziwig wrote:
On Jul 23, 5:25 am, Paulo Marques <pmarq...@xxxxxxxxxxxx> wrote:
[...]
This means that for a 26-ary tree, the number of starting elements needs
to be "25 * N + 26" for some integer N. If they're not, you need to add
dummy zero frequency elements to the end of the tree before start
building it.

I looked it up. The number of starting elements needs to be congruent
to 1 mod n-1, so it has to be of the form 25X + 1.

My math didn't fail me too much, then :)

[...]
Although I don't see
what could be wrong. It's simply the total number of code letters used
divided by the total of all word frequencies, and my original corpus
was slightly more than a million words, so that number looks right.
I'll double check it.

It should be something like: sum_for_all_words(frequency * code_letters)
/ sum_for_all_words(frequency). I.e. the total number of letters used to
encode the corpus divided by to total number of words. This should give
the average letters per word used to encode the complete corpus.

If you need help debugging the code, you can send it to me privately.
I'm usually good at spotting other people's bugs. I just wish I could
use that superpower for my own programs :(

--
Paulo Marques - www.grupopie.com

"C++ : increment the value of C and use the old one"
.