Text Compression in Erlang
===

Is there a text compression library for Erlang ?  When working with very long strings, it may be advantageous to compress the character data. Has anyone compressed text or thought of a way to do it in erlang ?<br><br> I was thinking of using the `zip` module, but instead of working with files, i work IN-MEMORY like this:
<pre>
compress(LargeText)-&gt;
	Binary = list_to_binary(LargeText),
	{ok,{_,Zipped}} = zip:zip("ZipName",[{"Name",Binary}],[memory]),
	Zipped.
</pre>
Then i would `unzip` the text back into memory when i need it. Like this:<pre>
{ok,[{"Name",Binary}]} = zip:unzip(Zipped,[memory]).
</pre>
My Erlang application is supposed to be part of a middle tier in which large text may have to pass through to, and out of a storage system. The storage system is intended on storing large text. To optimize the storage, there is need to compress it before sending it. Assume that the text value is like a `CLOB` data type in Oracle Database. I am thinking that if i combine the zipping and the `erlang:garbage_collect/0`, i can pull it off.<br><br>OR if its not possible in Erlang, perhaps it is possible using a<br> `system call` via `os:cmd({Some UNIX script})`and then i would grab the output in Erlang ? i don't know <br><br>There seems to be a better way, pliz show me, thanks.