Re: [Haskell-cafe] Re: Need for speed: the Burrows-Wheeler Transform

2007-06-23 Thread Andrew Coppin
apfelmus wrote: Note that the one usually adds an end of string character $ in the Burrows-Wheeler transform for compression such that sorting rotated strings becomes sorting suffices. Yeah, I noticed that the output from by program can never actually be reverted to its original form. ;-)

[Haskell-cafe] Re: Need for speed: the Burrows-Wheeler Transform

2007-06-23 Thread apfelmus
Andrew Coppin wrote: apfelmus wrote: Note that the one usually adds an end of string character $ in the Burrows-Wheeler transform for compression such that sorting rotated strings becomes sorting suffices. Yeah, I noticed that the output from by program can never actually be reverted to

Re: [Haskell-cafe] Re: Need for speed: the Burrows-Wheeler Transform

2007-06-23 Thread Bertram Felgenhauer
Andrew Coppin wrote: apfelmus wrote: Note that the one usually adds an end of string character $ in the Burrows-Wheeler transform for compression such that sorting rotated strings becomes sorting suffices. Yeah, I noticed that the output from by program can never actually be reverted

Re: [Haskell-cafe] Re: Need for speed: the Burrows-Wheeler Transform

2007-06-23 Thread Chris Kuklewicz
I enjoy code like this that requires laziness. My modified version of your code is below... Bertram Felgenhauer wrote: Code: bwt implements a variation of the Burrows-Wheeler transform, using \0 as a sentinel character for simplicity. The sentinel has to be smaller than all other

Re: [Haskell-cafe] Re: Need for speed: the Burrows-Wheeler Transform

2007-06-23 Thread Felipe Almeida Lessa
On 6/23/07, Bertram Felgenhauer [EMAIL PROTECTED] wrote: rbwt implements the corresponding inverse BWT. It's a fun knot tying exercise. rbwt xs = let res = sortBy (\(a:as) (b:bs) - a `compare` b) (zipWith' (:) xs res) in tail . map snd . zip xs $ head res Indeed it's very fun

Re: [Haskell-cafe] Re: Need for speed: the Burrows-Wheeler Transform

2007-06-23 Thread Chris Kuklewicz
Felipe Almeida Lessa wrote: On 6/23/07, Bertram Felgenhauer [EMAIL PROTECTED] wrote: rbwt implements the corresponding inverse BWT. It's a fun knot tying exercise. rbwt xs = let res = sortBy (\(a:as) (b:bs) - a `compare` b) (zipWith' (:) xs res) in tail . map snd . zip xs $

Re: [Haskell-cafe] Re: Need for speed: the Burrows-Wheeler Transform

2007-06-23 Thread Bertram Felgenhauer
Felipe Almeida Lessa wrote: On 6/23/07, Bertram Felgenhauer [EMAIL PROTECTED] wrote: rbwt implements the corresponding inverse BWT. It's a fun knot tying exercise. rbwt xs = let res = sortBy (\(a:as) (b:bs) - a `compare` b) (zipWith' (:) xs res) in tail . map snd . zip xs $