Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Filtering out stop words

by Eily (Monsignor)
on Feb 25, 2020 at 14:04 UTC ( #11113404=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @words = get_words_to_check();
    
    my %hash = map { $_ => 1 } @words;
    ...
    
    my @good_words = grep { exists $hash{$_} } @words; # Keep the original
    + order
    my @good_words_2 = keys %hash; # Don't care about the original order
    
  2. or download this
    my $index = 0;
    LINE: while (my $line = <>)
    {
    ...
        last LINE if ++$index == @words;
      }
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2023-06-04 01:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (17 votes). Check out past polls.

    Notices?