package huffman

  1. Overview
  2. Docs
An OCaml library to manipulate Huffman trees

Install

Dune Dependency

Authors

Maintainers

Sources

huffman-v0.1.2.tbz
sha256=a536b694486748bfa9ec05af060c29f799f7ecbb535003343fe812fce8ffa72d
sha512=7dd6208873bd42aefe84ef59ae741017d364bd7fc302616f7131015c8b13968ac56e8a57639060ac115a729d46a834b87988872ea1bc2111e906e89efe8d2cb8

doc/huffman/Huffman/index.html

Module HuffmanSource

Sourcetype 'a htree =
  1. | Node of float * 'a htree * 'a htree
  2. | Leaf of float * 'a

Type for Huffman trees

Sourcetype 'a t = 'a htree
Sourceval compare : 'a htree -> 'a htree -> int

Compare two huffman trees

  • parameter ht1

    a tree

  • parameter ht2

    a tree

Sourceval combine : 'a htree -> 'a htree -> 'a htree

Combine twho huffman trees

  • parameter ht1

    a tree

  • parameter ht2

    a tree

Sourceval sort : 'a htree list -> 'a htree list

Sort a list of huffman trees

  • parameter htl

    the list

Sourceval huffman : ('a * float) list -> 'a htree

Create a Huffman tree based on the description of an emitter

  • parameter l

    Symbol -> Frequency association

Sourceval dump_as_dot : string -> char htree -> unit

Outputs a tree to a dot file

  • parameter f

    The output file

  • parameter ht

    The Huffman tree

OCaml

Innovation. Community. Security.