SpaceGlider is a file compression and decompression tool designed for text files. It uses a custom dictionary-based approach to compress files efficiently
Tested on enwik9 with a compression rate of 42.56% (size includes dictionnary generated).
- Compresses text files using a word dictionary.
- Orders dictionary entries by frequency.
- Rewrites files with binary replacements for words.
-
Run the program:
java Main
-
Enter the file path to compress when prompted.
-
The program will generate the following files:
<input_file>_dict.dict
: The word dictionary.<input_file>_dict.dictsrt
: The sorted word dictionary.compressedfile
: The compressed file.decompressedfile
: The decompressed file.
- Made for files containing 270,549,120 words or less.
Creates a word dictionary from the input file, counting the frequency of each word.
Orders the dictionary entries by their frequency in descending order.
Rewrites the input file using binary replacements for words based on the dictionary.
Reverts the compressed file back to its original form using the dictionary.