On Tue, 8 Oct 2002, Chris Staskewicz wrote:

> Is there an efficient method to find all "continuous" substrings of a
> string.  For example, in the word "green", I'd like to parse out:
> 
> g, r, e, e, n, gr, re, ee, en, gre, ree, and so on...
> 
> A for loop with a substr command works, but the program is taking forever
> to run.  I'm doing this for about 20,000 strings with max(string) = 50 and
> min(string) = 1 for all strings in the set.  I'm comparing these parsed
> substrings to another string and flagging any matches.

How are you comparing the substrings you have peeled out?

If you're doing a simple comparison to a fixed string then would index 
allow you to work on intact strings?

What other approaches have you tried?

Mike

-- 
[EMAIL PROTECTED]                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       | GPG PGP Key      1024D/059913DA 
[EMAIL PROTECTED]                  | Fingerprint      0570 71CD 6790 7C28 3D60
http://www.exegenix.com/           |                  75D2 9EC4 C1C0 0599 13DA

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to