问题
I am looking for a .NET dictionary based compression library, something that would allow me 'seed' it with a large list / string of common words which it would use to build its dictionary.
The reason that I want this over LZMA and the like is because I want to independently compress short strings, all of which are quite similar to each other. Visualize compressing a simple children's book, but compressing each page separately. If we were compressing the whole book then LZMA would be good, but it's not so great for shorter strings.
Does any such thing exist?
回答1:
zlib provides dictionary based compression. The functions deflateSetDictionary() and inflateSetDictionary() do exactly what you describe.
回答2:
Built-in GZip: GZipStream Class. You should deploy it as a SQLCLR UDF function for your needs, see How to: Create and Run a SQL Server User-Defined Function by using Common Language Run-time Integration
来源:https://stackoverflow.com/questions/9797518/looking-for-a-dictionary-based-net-text-compression-library