Hello Gracjan,
Monday, May 16, 2005, 4:00:33 PM, you wrote:
GP Unless you have very repetitive data and/or tiny alphabet, it is
GP actually quite efficient, as the expected length of prefixes that need
GP to be checked before a mismatch can be determined is small.
GP
GP At least, I was
From: Bulat Ziganshin [mailto:[EMAIL PROTECTED]
if you really need KMP, you can find it at
http://haskell.org/hawiki/RunTimeCompilation
find (isSuffixOf needle) (inits haystack)
find (isPrefixOf needle) (tails haystack)
if you need an index - add it with zip:
find (isPrefixOf
On 2005 May 16 Monday 08:00, Gracjan Polak wrote:
Ketil Malde wrote:
While the result isn't exactly the same, I suspect
using isPrefixOf and tails would be more efficient.
I need the data before and including my needle.
When the haystack gets large, the beautiful
find (isSuffixOf
You can get efficiency, the desired data, and deal with infinite strings by
using a function that is like 'inits' but which returns the initial strings
in reversed order.
reversed_inits = scanl (flip (:))
find (isPrefixOf (reverse needle)) (reversed_inits haystack)
If I may ask
On 2005 May 17 Tuesday 11:44, Donn Cave wrote:
You can get efficiency, the desired data, and deal with infinite strings.
reversed_inits = scanl (flip (:))
find (isPrefixOf (reverse needle)) (reversed_inits haystack)
With get efficiency, I was comparing this program which is linear
Hi,
Simple question: I need a function that matches string in another
string. Something like:
find (isSuffixOf needle) (inits haystack)
This one is beautiful, but not very practical. Could anybody point me to
some haskell library that does some searching, using KMP for example?
--
Gracjan
Gracjan Polak [EMAIL PROTECTED] writes:
find (isSuffixOf needle) (inits haystack)
Hmm...
While the result isn't exactly the same, I suspect
using isPrefixOf and tails would be more efficient.
This one is beautiful, but not very practical.
Unless you have very repetitive data and/or tiny
At 10:27 16/05/05 +0200, Gracjan Polak wrote:
Hi,
Simple question: I need a function that matches string in another string.
Something like:
find (isSuffixOf needle) (inits haystack)
This one is beautiful, but not very practical. Could anybody point me to
some haskell library that does some
Ketil Malde wrote:
Gracjan Polak [EMAIL PROTECTED] writes:
find (isSuffixOf needle) (inits haystack)
Hmm...
While the result isn't exactly the same, I suspect
using isPrefixOf and tails would be more efficient.
I need the data before and including my needle. Like this:
( ... needle )
On 2005 May 16 Monday 08:00, Gracjan Polak wrote:
Ketil Malde wrote:
While the result isn't exactly the same, I suspect
using isPrefixOf and tails would be more efficient.
I need the data before and including my needle.
When the haystack gets large, the beautiful
find (isSuffixOf
G'day all.
Quoting Gracjan Polak [EMAIL PROTECTED]:
Simple question: I need a function that matches string in another
string. Something like:
find (isSuffixOf needle) (inits haystack)
This one is beautiful, but not very practical.
This one is fairly practical, but not very beautiful:
11 matches
Mail list logo