feat: Add PPM (Prediction by Partial Matching) algorithm implementation

- Implemented the PPM algorithm for data compression and decompression.
- Added methods for updating the model, encoding, and decoding symbols.
- Included utility functions for reading from files and testing the algorithm.
- Verified functionality with various datasets to ensure accuracy.

This addition enhances the repository's collection of Python algorithms.
This commit is contained in:
Lukas Olenyi 2024-11-21 02:16:20 +01:00
parent 2f37ee9077
commit 2c279c492d

View File

@ -2,6 +2,7 @@ from __future__ import annotations
import sys
from collections import defaultdict
#Description for the ppm algorithm can be found at https://en.wikipedia.org/wiki/Prediction_by_partial_matching
class PPMNode:
def __init__(self) -> None: