Skip to content

Adaptive Huffman compression algorithm in O'Caml. Classwork from 2003

Notifications You must be signed in to change notification settings

codeflows/adaptive-huffman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

README
------

This is an implementation of the Adaptive Huffman compression algorithm
in the Objective Caml language (www.ocaml.org).

Installation
------------

Compile the program with

  ocamlc -o huff huffman.ml
  
where 'huff' can be replaced with an arbitrary name.
On windows, you should specify something like "huff.exe".
This compiles a byte-code version of the program. An
optimized (native code) version can be compiled with

  ocamlopt -o huff huffman.ml
  
Running the program
-------------------

Run the program with

  huff cmd in out [some_file.xml]
  
  where
  - cmd is either enc (encode/compress) or dec (decode/uncompress)
  - in is the input file
  - out is the target file
  - and optionally, some_file.xml is where the Huffman tree will be dumped,
    if the file is specified. this works well for simple text files but
    may break if complex text is compressed/uncompressed
    
Examples
--------

- huff enc mytext.txt mytext.compressed
- huff enc mytext.compressed mytext.uncompressed

etc...

Sample XML output 
-----------------

http://www.cs.helsinki.fi/u/jaarnial/huffman/dump.xml

Misc
----

This program was developed on Windows using Objective Caml v3.06
and tested on both Windows and Linux.

(C) Jari Aarniala, 2003 (jari.aarniala@cs.helsinki.fi)

About

Adaptive Huffman compression algorithm in O'Caml. Classwork from 2003

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published