is among the words AND find words
bobs at twft.com
Wed Dec 21 11:24:59 EST 2011
I think this underscores the need for the words keyword to be upgraded to reflect real text. For instance, word delimiters could be a property containing all the characters which might be word delimiters, all the punctuations for example. I don't know how you would treat a hyphen.
Upon thinking about it, I am not sure what the application would be for finding specific words in an english (or any other languages) phrase. It is useful for finding keywords in a Livecode statement for sure.
On Dec 21, 2011, at 2:15 AM, Alex Tweedly wrote:
> 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
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode