Re: general compression with awk



Le Wed, 30 Nov 2005 13:09:53 +0100, Rufus T. Firefly a écrit :

> Loki Harfagr wrote:
>>
>> If you still want to try awk, here's a very
>> timid starter.
>> The commented prints are for looking at the engine
>> being clumsy (It doesn't pair doubletons like "a b").
>>
> discovering (and compressing) recurrent patterns IS the whole point of
> this exercise

Oh yes! Indeed I missed your point, I thought you were lacking of
a starting architecture for a compressor type engine. While you
really did want an algo !-) Sorru for this !

....

> Your code does `uniq -c` in an obscure way.

Mmm, I wouldn't say it is that obscure :D)

> $ uniq -c example
> 4 a
> 1 b
> 1 a
> 1 b
> 1 a
> 1 b
> 1 c
> 2 d
>
> Maybe I did not quite see your point.

It seems we both had difficulties in reading each other, I think now it
is clear, and yes it *has* to look like a 'uniq -c' which is a good start
for a compression engine (collect and count element as to build a hash
dictionnary). It could be a basis for a huffman compressor, why don't you
use a huffman ? Is your research for research (intelectual curiosity) or
do you intend to actually use the thing in real process ?

> - Looking forward to your
> improvement...

Well, I don't know if I'll have time to try but if I can
get some relief off preparing Xmas presents, cards, apologies for parties,
I'll have a try :-)

> As Ed pointed out
>
> $ cat example example |awk -f RLEinawk.awk
>
> should print something like
> 2 example
>
> if you understand what I mean.

Yes, I do, of course, but you reckon that using this type of algo
on a "freely sized" dictionnary will be a very resource consuming
task for a computer, at best it'll need "factory of number of elements"
loop, if you have big files and very heterogenous you'll crash fairly
quick !-)
Of course if you can define a closed context of data you may find
out some tricks to do it in a refined optimized way :-)

See you.
.



Relevant Pages

  • Re: REmoving Oil Cooler
    ... engine is powering the car. ... The same idea could be applied to an a/c ... battery charge drops to a certain level. ... pump, and compressor are probably on the order of 3 to 5 horsepower, so the ...
    (alt.autos.toyota)
  • Re: 86 300E (W124)
    ... Slower moving makes shedding the heat in condenser a little bit difficult. ... If the difference is something like 20-30%, the AC relay assumes the compressor is seized. ... To protect others on the same belt (for example, alternator, water pump, etc, I am not familiar with this engine though), the relay will disengage the compressor clutch. ... Being a man of reason, I'm thinking I may have two problems; one being the fan switch, which is mounted on the "high side" is inoperative. ...
    (alt.auto.mercedes)
  • Re: Does the Lyulka AL-7 really have a supersonic compressor?
    ... of the problems with the engine are described in English on the Intian Air ... To work it back to basics - any continuous flow type air compressor ... (The speed of sound in air depends on temperature - that will get important ...
    (rec.aviation.military)
  • Re: How many DC amps is too much
    ... toothed belt pully and engine PTO limitations would permit on the ... Drawing down the cold plate would be like buying ice (and probably ... force has got to use up more fuel than just running the compressor ... problem was with the dual coils in the cold plate. ...
    (rec.boats.cruising)
  • Re: Book Review: _Luftwaffe Over America_, Manfried Griehl
    ... The reason the Jumo was so bad is that it ... owner who invented the hard stuff like flame holders) first jet engine ... had a centrifugal-radial compressor, ... compressor vs radial inflow turbine because of their self matching ...
    (rec.aviation.military)