name: text-compressor description: Compress and decompress text files using smart abbreviation and whitespace normalization. Use when user asks to compress, shrink, reduce, or optimize text file size while preserving readability. Also use for batch text processing, file size reduction, or text cleanup.
Compress text files using configurable levels of text abbreviation while keeping content readable.
python scripts/compress.py <input_file> [output_file] [--level 1-3]
python scripts/compress.py <input_file> [output_file] --decompress [--level 1-3]
compress.py report.txt — compress report.txt → report.txt.compressedcompress.py input.txt output.txt --level 2 — medium compression to specific outputcompress.py compressed.txt --decompress — attempt to restore (approximate)Shows bytes saved and percentage reduction.
--decompress to attempt restoration (approximate only).这是一个实用的文本压缩工具,三级压缩策略设计合理,文档说明清晰。基础压缩功能实现得不错,但解压功能只能部分恢复原文,准确性有限;最高级别压缩会影响阅读体验,实用性打折扣。整体质量中上,基础功能扎实,细节打磨还需加强。适合对压缩率要求不高但需要保持基本可读性的场景使用。