Arithmetic coding/As a generalized change of radix: Difference between revisions

Content added Content deleted
Line 921: Line 921:
base:=freqHash.values.sum(0);
base:=freqHash.values.sum(0);
cf :=cumulativeFreq(freqHash); // Create the cumulative frequency table
cf :=cumulativeFreq(freqHash); // Create the cumulative frequency table
dict:=cf.pump(D(), // Invert/transpose cumulative table, keys are strings
dict:=cf.pump(Dictionary(), // Invert/transpose cumulative table, keys are strings
fcn(kv){ kv.reverse().apply("toInt")});
fcn(kv){ kv.reverse().apply("toInt")});
// Fill the gaps in the dictionary
// Fill the gaps in the dictionary