is among the words AND find words

Alex Tweedly alex at tweedly.net
Wed Dec 21 04:15:34 CST 2011


Hmmm ... what will happen to "there is time,enough for it" - NB no space 
before or after the comma.

I think you *want* to find "time" in that case - but I'm not sure if you 
will by stripping out all non-letter characters from the word "time,enough".

Would it not be simpler (and faster) to find the the word as a string, 
and then verify that the char before is not a letter, and that the char 
after it is not a letter ?

but then, what about "find the time-bomb here" ?  Is time a word, or 
time-bomb a single, hyphenated word ?
Oh well, you choose :-)

-- Alex.

On 21/12/2011 05:10, Jim Hurley wrote:
> Think I will try something like this.
>
> Test to see if the word, as a string, is in the text.
> If so, then strip out all characters not between "a" and "z" or "A" and "Z"  and then check to see if the stripped-down word is the same as the test word.
>
> That way I will find "time" even if it appears as "(time)" or "time." or "time," or with quotes on either side, etc.
>
> I wonder what algorithm LC uses in "Find word(s)" to find only words.
>
> Jim Hurley




More information about the use-livecode mailing list