Arithmetic coding/As a generalized change of radix: Difference between revisions
Content added Content deleted
(→{{header|Sidef}}: added zkl) |
m (→{{header|zkl}}: update) |
||
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( |
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 |