HuffmanCodes
Building the project
Provided you have dotnet core installed, the project can be built in any of the following ways:
- Running the
release
task in vscode. - Running either
build.sh
orbuild.ps1
from the appropriate shell. - Executing the following command in any shell
sh
dotnet publish ./src/HuffmanCodes/HuffmanCodes.csproj -c release -o ./release
Running the program
Project can be be ran from the command line using:
Usage:
./release/<arch>/HuffmanCodes[.exe] ENCODEDFILE [SOURCEFILE]
ENCODEDFILE Path to file to be encoded
SOURCEFILE Path to file used to generate the huffman
codes (Defaults to ENCODEDFILE)
Example
Encode Alice.txt using LittleWomen.txt to generate Huffman codes
Linux
./release/linux-x64/HuffmanCodes ./Alice.txt ./LittleWomen.txt
Windows
./release/win-x64/HuffmanCodes.exe ./Alice.txt ./LittleWomen.txt
Output
Outputs will be in the format of ENCODEDFILE_Encoded_by_SOURCEFILE.txt
So in the above example, the resulting file would be
LittleWomen_Encoded_by_Alice.txt
Scripts
Running either test.sh
, or test.ps1
will build and run the program with all variations of text files we used. (Note: The scripts are not very robust, and must be ran in the root directory of the project.)