hi
i am trying to remove the stopwords from a text .
e.g
text :
"Depending on the CD writing software you use, you will be looking for a .IMG file or a .ISO file. If you don't see the file and are browsing the correct folder, try one of".
The text is saved in a file whose path i give from command line.
i wrote this code.
#!/usr/bin/perl
use warnings;
use strict;
my (@data,$word,@lessWords,%stopwords,$stop);
open( LIST, "stopwords.txt" ) or die "$!";
my @stopwords = <LIST>;
close LIST;
chomp @stopwords;
$/="";
while(<>)
{
push @data, $_;
}
foreach $word (@data)
{
foreach $stop (@stopwords)
{
next if $word eq $stop;
}
push(@lessWords, $word);
}
print "@lessWords\n";
but it not removing the stopwords.
does an one know why? and how i can fix it ?