Filter Command

Alex Tweedly alex at tweedly.net
Mon Nov 21 15:31:53 EST 2005


Gregory Lypny wrote:

> Hello Everyone,
>
>     I'm having a bit of trouble with the Filter command giving me 
> false  positives.  I'm picking off company names in a file containing 
> news  headlines.  The headlines file has one headline per line, and 
> each  line is tab delimited, where the first item is a unique story 
> number  and the second is the actual headline.  It looks something 
> like this:
>
> 1    tab    First headline text
> 2    tab    Second headline text
> 3    tab    Third headline text
> ...
>
> My search command is of the form
>
>         filter it with "*" & tab & "*" & companyName & "*"
>
>     This seems to works fine for all my companies except for "TSE 100  
> Index Participation Fund Units".  I'm getting a lot of hits that  
> contain "TSE" (Toronto Stock Exchange) in the headline but not the  
> rest of the name.  This does not happen with other long names or  
> names that have a common proper noun (e.g., Canada Bread gives me  
> four hits all mentioning Canada Bread and none mentioning Canada or  
> Bread alone).
>
>     Any thoughts?
>
No very good ones ....

Can you give us some idea of the bigger context - e.g. is companyName 
passed as a parameter to the handler doing this ?

Any chance that " "TSE 100  Index Participation Fund Units" is actually 
"TSE<tab>100  Index Participation Fund Units" ?   (Still not clear why 
that would cause a problem - but it might, depending on the bigger context.)

I'd suggest a debug statement to check *exactly* what is in 
"companyName" at the time .... not just something like "put companyName 
& cr after msg", but
  put companyName & cr after msg
  repeat for each char c in companyName
     put c && chartonum(c) & cr after msg
  end repeat
  put "finished" && companyName & cr after msg


If feasible, send me a snippet of code and data and I'll play with it .....

-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.4/176 - Release Date: 20/11/2005




More information about the use-livecode mailing list