Searching for a word when it's more than one word

Mark Waddingham mark at livecode.com
Sat Sep 1 07:25:39 EDT 2018


On 2018-09-01 13:15, Richmond Mathewson via use-livecode wrote:
> I've already shovelled Ruyton of the Eleven Towns quite effectively:
> 
> https://www.dropbox.com/s/n7r7u0c2m9ny3eb/Text%20analyzer%20X.livecode.zip?dl=0
> 
> No tokenising, in fact very basic stuff indeed.
> 
> Not wishing to bang on about over-complcating things . . . . .

Your revised approach is fine - as long as the names of all the towns 
are distinct in terms of no one town's name is contained within another.

Add 'Palm Beach West' and 'Palm Beach' to your placeNames list; then 
modify your source text to end 'or Palm Beach West' - and you algorithm 
does not perform the requested operation.

It reports Palm Beach West *and* Palm Beach as being present - whereas, 
only 'Palm Beach West' is present :D

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list