tcmpr.algorithms.huffman package¶
Submodules¶
tcmpr.algorithms.huffman.compressor module¶
This module is responsible for implementing HUFFMAN CODING algorithm which can be used to compressing input file.
-
tcmpr.algorithms.huffman.compressor.build_binary_tree(frequencies)[source]¶ Function to create binary huffman tree based on counted frequencies in input data
-
tcmpr.algorithms.huffman.compressor.compress_huffman(input_file)[source]¶ Function compress input file and create new compressed file in the same folder (or in defined output path). Algorithm uses a priority queue where the node with lowest probability (frequency) is given highest priority. :param: input_file, :return: compressed output file path