https://github.com/DustWinter/SpaceGlider
Compression Tool
https://github.com/DustWinter/SpaceGlider
compress compression compression-algorithm data-compression data-compression-algorithms java loseless-compression
Last synced: 5 months ago
JSON representation
Compression Tool
- Host: GitHub
- URL: https://github.com/DustWinter/SpaceGlider
- Owner: CorruptedSpring
- Created: 2024-12-18T10:26:04.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-23T20:56:57.000Z (about 1 year ago)
- Last Synced: 2024-12-23T21:25:25.473Z (about 1 year ago)
- Topics: compress, compression, compression-algorithm, data-compression, data-compression-algorithms, java, loseless-compression
- Language: Java
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadME.md
Awesome Lists containing this project
README
# SpaceGlider
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](http://mattmahoney.net/dc/enwik9.zip) with a compression rate of 42.56% (size includes dictionnary generated).
#
## Features
- Compresses text files using a word dictionary.
- Orders dictionary entries by frequency.
- Rewrites files with binary replacements for words.
## Usage
1. **Run the program:**
```
java Main
```
2. **Enter the file path to compress when prompted.**
3. **The program will generate the following files:**
- `_dict.dict`: The word dictionary.
- `_dict.dictsrt`: The sorted word dictionary.
- `compressedfile`: The compressed file.
- `decompressedfile`: The decompressed file.
## Limitations
- Made for files containing 270,549,120 words or less.
## Main Functions
### `createWordDictionary`
Creates a word dictionary from the input file, counting the frequency of each word.
### `orderLinesByValue`
Orders the dictionary entries by their frequency in descending order.
### `rewriteFileWithBinaryReplacement`
Rewrites the input file using binary replacements for words based on the dictionary.
### `revertCompressedFile`
Reverts the compressed file back to its original form using the dictionary.