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

Richmond Mathewson richmondmathewson at gmail.com
Sat Sep 1 07:51:38 EDT 2018


It didn't like this:

on mouseDown
    put empty into fld "zText"
    if fld "xText" contains "Ruyton of the Eleven Towns." then
       put fld "xText" into fld "zText"
       put "Ruyton of the Eleven Towns." into CHUNNK
put empty into CHUNNK of fld "zText"
       end if
*end mouseDown**
**
**Richmond.*

On 1/9/2018 2:25 pm, Mark Waddingham via use-livecode wrote:
> 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.
>




More information about the use-livecode mailing list