By Swapnil
Code in Python compresses a .txt file into a .bin file where the compressed file is approximately 50% of the size of the original file. or decompresses the .bin to .txt file.
Implemented Huffman coding algorithm for lossless text compression.
According to user choice,
Code compresses a .txt file into a .bin file where the compressed file is approximately 50% of the size of the original file.
or decompresses the .bin to .txt file that is into its original form.
Code is in Python
Library used - heapq, os
Data Structures used - Hashing, Trees, Priority Queue, Dictionary, Heaps
To run -
$python3 Lossless Text Compression.ipynb
Place the absolute path of the file to be compressed or decompressed in the variable path and call the respective function for the work to be processed on the file.
Submitted by Swapnil (Swapnil)
Download packets of source code on Coders Packet
Comments