Matchtext script results

Jim Ault JimAultWins at yahoo.com
Thu Nov 30 19:47:35 EST 2006


On 11/30/06 3:54 PM, "Mark Smith" <mark at maseurope.net> wrote:

> Not that it necessarily matters for your application, but your
> version will miss a match if it's preceded or followed by punctuation
> -- "cat."  "(dinosaur)" etc.
> 
> By an unnecessary process of elimination, I arrived at just about
> exactly the same simple solution as you did in my last attempt, but
> dealing with punctuation detracts (inevitably, as far as I can see)
> from the speed.
> 
> And we didn't even consider plurals!

Yes, Mark, and my filter solution will find 'too many' matches [5 in the
test where 2 is the right answer] which is why I designed my original to
capture and track the text blocks that tested true.

As you have noted, further processing is needed for accuracy, and that can
be done on each line in textStr (see below)

------------
put blockNumber & blockName && theTextItself & cr after newBlock
where a each text file is concatenated as a single line
with a serial number&filename to mark which file was on each line

then
>>     filter textStr with ("*" & WRD & "*")
so that each hit remains a single line in the textStr and the other lines
disappear.
------------
As you have noted, further processing (for plurals and punc, etc) is needed
for accuracy, and that can be done on each line in textStr.

Jim Ault
Las Vegas





More information about the use-livecode mailing list