Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^5: Dynamically Updating Frequency Analysis

by Voronich (Hermit)
on May 08, 2013 at 16:26 UTC ( #1032632=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Dynamically Updating Frequency Analysis
in thread Dynamically Updating Frequency Analysis

AH! Yes. I see what you mean now. That's actually a fun problem.

My first "real world" answer would be to accept the inefficiency of the degrading accuracy of the table. But that's no fun.

If you did a true multi pass you'd run in to the problem of your universe of 8-bit symbols jumping by virtue of the previous encoding pass. So that's no fun either.

It looks to me like "given lock in to the initial approach" you'd have to take the optimum compression candidate, decrement the individual cases of its components from the frequency distribution table, including bounding characters (the spaces in the 2-grams of ' here ', for instance) for each substitution instance of 'here'. That would leave you with an accurate frequency distribution, having pulled the 40 instances of 'he', 'er', 're', ' h' and 'e ' (with the foolish assumption that 'here' always occurs in the middle of a sentence.) So the table is accurate again.


Comment on Re^5: Dynamically Updating Frequency Analysis

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1032632]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (15)
As of 2014-10-30 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls