Re: Compression idea
- Posted by Grape_ Vine_ <g__vine at HOTMAIL.COM> Jan 24, 2001
- 540 views
It does help, Give's me a idea of what work, Even if not as well as planed. I am working on fixing the length of the dictionary word to 6 or 8 bytes, it take's 3-5 bytes to index into the dictionary, So even if its not great its a start for better search's Grape >From: Lewis Townsend <keroltarr at HOTMAIL.COM> >Reply-To: Euphoria Programming for MS-DOS <EUPHORIA at LISTSERV.MUOHIO.EDU> >To: EUPHORIA at LISTSERV.MUOHIO.EDU >Subject: Re: Compression idea >Date: Tue, 23 Jan 2001 16:36:19 -0600 > >Hello Grape_, > >>The problem is just how to decide what is a sting of data that belongs in >>the dictionary. > >I started writing a compression library based on a "similar" >idea at one time. However, when I got it finished, it didn't >provide very good compression. Don't be discouraged by my lack >of success since your idea is significantly different that my >word "similar" above is a debatable. The similarity however >was that it DID search for repeated strings so that they >could be replaced by something shorter. I don't have the >file available at this computer but I think the search code >was something like this: > >sequence source -- is the source string >constant slen = length( source ) >integer len -- length of current segment >sequence s -- current segment > >for len = 2 to floor( slen/2 ) do -- slen/2 is maximum seg length > for pos = 1 to slen-len do -- try every segment in the source > s = source[pos..pos+len] -- extract segment > if match( s, source[pos+len..slen] ) -- is there any more of it? > --this is a repeated string > end if > end for >end for > >I hope this is somehow helpful as it is completely un-tested. > >later, >Lewis Townsend >_________________________________________________________________ >Get your FREE download of MSN Explorer at http://explorer.msn.com _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com