Trying to code the fastest algorithm...

Alex Tweedly alex at tweedly.net
Sun Jun 5 18:17:50 EDT 2005


jbv wrote:

> I don't want to waste too much of your time,

don't worry - this is a perfect excuse to avoid doing any *real* work - 
like documentation, testing, ...

> but may I ask what other approach you have in mind (in a few words) ?

Nothing else that has properly coalesced into "an idea" yet - just wild 
thoughts .....

build a regex, use that to filter the sentence list to only those which 
have at least one matching word, then apply the above algorithm

replace each (word in the ref list) by a matching symbol throughout the 
sentence list, then use filter to remove non matching sentences   (e.g.

>  put 0  into count
>  repeat for each item W in myReference
>     add 1 to count
>     replace W by ":"&count in mySentences
>  end repeat
>  filter mySentences by "*:*:*"

(this would perhaps be worth pursuing if the ref list is usually small - 
at 30 words, I doubt it has much chance)

I'm sure there are others .... but even these two are kind of long shots.

And after that, there's always a large glass of 25-year malt and a soak 
in the hot tub to come up with more ideas .... :-)

-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.6.2 - Release Date: 04/06/2005



More information about the use-livecode mailing list