Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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
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 perusing the Monastery: (7)
As of 2020-06-03 17:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (27 votes). Check out past polls.

    Notices?