Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your change:
This pull request introduces a new implementation of the Prediction by Partial Matching (PPM) algorithm to the repository. The PPM algorithm is a statistical data compression technique that utilizes context modeling to achieve efficient compression rates.
Key Features:
Context-Based Compression: The algorithm maintains a context of previous symbols to predict the next symbol, enhancing compression efficiency. The Wikipedia page describes the algorithm way better than I ever could. https://en.wikipedia.org/wiki/Prediction_by_partial_matching
Compression and Decompression Functions:
The implementation includes both compression and decompression methods in one file, allowing for reversible data transformation.
File Handling:
A utility function is provided to read data from a file, making it easy to test the algorithm with real data.
Usage:
To use the PPM algorithm, simply call the ppm function with the path to the file you wish to compress. The algorithm will output the compressed data as probabilities and also provide the decompressed data for verification.
Testing:
I have tested the implementation with various datasets to ensure its functionality and performance. The results demonstrate that the algorithm effectively compresses and decompresses data while maintaining accuracy.
Checklist: