Huffman coding: Difference between revisions
Content added Content deleted
(→{{header|Perl 6}}: Add some explanation.) |
m (→Testing: add whitespace) |
||
Line 3,797: | Line 3,797: | ||
To demonstrate that the table can do a round trip: |
To demonstrate that the table can do a round trip: |
||
<lang perl6>my $original |
<lang perl6>my $original = 'this is an example for huffman encoding'; |
||
my %encode-key = huffman $original.comb.Bag; |
my %encode-key = huffman $original.comb.Bag; |
||
my %decode-key = %encode-key.invert; |
my %decode-key = %encode-key.invert; |