This site is updated infrequently. For up-to-date information, please visit the new OCaml website at ocaml.org.

huffman compresion
• Isidro Jimenez Ovelar
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
 Date: 1997-09-08 (07:02) From: Isidro Jimenez Ovelar Subject: huffman compresion
```
I am new in this group, I am a student of informatic at
Politecnica of Madrid University. I have to use caml to make
a practice and I 'd be very pleased if someone of you
could help a little bit.

This the job:  Huffman compression

The functions I have to do are:

Frecuency1: (* File -> (int ,float) Tabla *)
(* this function read a file in binary mode and give one
table with the frecuencies of each simbol *)

Maketree: (* (`symbol , float) Table -> `symbol list -> symbol Huftree

(* This function take the table of relatives frecuencies and the
list of symbols of the file and gives a Huffman tree *)

Compress (* int Hufftree -> file -> file -> unit *)
¦
¦        (* This function takes the name of a file to compress and the
compressed
¦        filed and inteprets the data byte to byte *)
¦
¦        UnCompress (*int Hufftree -> File -> File -> unit *)
¦        (*This function makes the opposite of Compress*)
¦
¦        I use these types:
¦
¦
¦
¦type 'symbol Huftree =
¦
¦      Hoja of 'symbol
¦      |final
¦      |Nodo of 'symbol Huftree * 'symbol Huftree;;
¦
¦type file == string;;
¦
¦
¦         I have some problems to make the Huffman tree and the compress
and
¦         uncompress functions. If someone have done something similar or
have
¦         any ideas to help me I would be very grateful.
¦
¦           Thanks for all.
¦
¦
¦

```