Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Filtering out stop words

by Eily (Monsignor)
on Feb 25, 2020 at 10:09 UTC ( [id://11113394]=note: print w/replies, xml ) Need Help??


in reply to Filtering out stop words

If you're searching for an exact match you might as well use a hash:

my $commonWords = {}; # Make commonWords a ref to an empty hash ... while (my $line = <>) { chomp($line); $commonWords->{$line} = 1; } ... if ($CkDiscardCommonwords eq 1) { return(0) if exists $commonWords->{$term}; }
I suppose you extracted the code from your script and that's why you have a return outside of a function?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11113394]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2024-04-19 16:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found