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

Richmond Mathewson richmondmathewson at gmail.com
Sat Sep 1 06:50:10 EDT 2018


Yup: indeed: fairly coarse.

However, see my next posting re "Ruyton of the Eleven Towns"

that should make some folk feel that they need a set of sewing needles 
rather than "just" a silver teaspoon.

Richmond.

On 1/9/2018 1:45 pm, Mark Waddingham via use-livecode wrote:
> On 2018-09-01 12:35, Richmond Mathewson via use-livecode wrote:
>> That's because you lot tend to use a silver teaspoon while I tend to
>> use a great big shovel:
>>
>> https://www.dropbox.com/s/00t8oftb1ydm8ni/Text%20analyzer%20X.livecode.zip?dl=0 
>>
>
> Heh, great big shovels are great for coarse work - e.g. for the 
> problem of finding occurrences of SINGLE WORD towns in the source text 
> - as you are in your stack.
>
> However, in this case, that wasn't what was asked for - the problem 
> was to find multi-word town names with the constraints that first and 
> longest match always wins with no overlap (i.e. as a human would read 
> them):
>
> i.e. East Hartford West Palm Beach Colchester Newchester West Chester
>
> With a town list of
>
>    East Hartford
>    Hartford West
>    West Palm Beach
>    Palm Beach
>    Chester
>    West Chester
>
> Should return:
>
>    East Hartford
>    West Palm Beach
>    West Chester
>
> Warmest Regards,
>
> Mark.
>
> P.S. The problem is actually exactly the same - in the single-word 
> case your alphabet are the characters in the language. In the 
> multi-word case, your alphabet is the set of words in all phrases, 
> with a 'stop' word.
>




More information about the use-livecode mailing list