RosettaCodeData/Task/Huffman-coding/Ursala/huffman-coding.ursala

15 lines
366 B
Plaintext

#import std
#import nat
#import flo
code_table = # takes a training dataset to a table <char: code...>
-+
*^ ~&v?\~&iNC @v ~&t?\~&h ~&plrDSLrnPlrmPCAS/'01',
~&itB->h fleq-<&d; ^C\~&tt @hthPX ^V\~&lrNCC plus@bd,
^V(div@rrPlX,~&rlNVNC)^*D(plus:-0.@rS,~&)+ *K2 ^/~&h float+ length+-
#cast %csAL
table = code_table 'this is an example for huffman encoding'