RE: [Haskell-cafe] String search algorithms

From: Henning Thielemann [mailto:lemming@henning-thielemann.de]
But I'm curious if you really need the index. Working with indexes on lists is quite inefficient. E.g. if you want to replace substrings you may want to use this implementation:
I'm not mutating the list, but I am extracting sublists. I'm toying with porting FIT and I'm starting with the Parse class, as recommended ( http://fit.c2.com/wiki.cgi?TipsForCoreImplementors ). They warn against using a generic parser: "Parse is the internal representation of the test data. Don't be seduced by generalized html/xml parsers. This one has unique features. Make it work. Consider replacing it only after you've used this one a while." Their parser is in Java, and makes heavy use of String.indexOf(), and I'm just trying to port it more-or-less as-is. I appreciate that'll be somewhat inefficient, but until I understand all of the wrinkles in their implementation, I'll take the simplest approach. Alistair. ----------------------------------------- ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. *****************************************************************
participants (1)
-
Bayley, Alistair