#!/usr/local/bin/perl -w use strict; use warnings; my $miniparDir = "home/sat/minipar"; my @dataArray; my $parsedMiniparOutput; my $searchWord; my %dependentWord; my @stopwords; my %is_stopwords; $searchWord = $ARGV[0]; open(OPENSTOPW,'stopwords.lst'); my $var = 0; while(){ chomp; push @stopwords, ($_); } foreach(@stopwords){ $is_stopwords{$_} = 1; } close(OPENSTOPW); open(OPENMY,'minipar.txt'); while(){ ... my($firstWord,$relation, $secondWord)=split(/:/,$_); my($first,$firstPOS)=split(/\s/,$firstWord); my($secondPOS,$second)=split(/\t/,$secondWord); ... if($is_stopwords{$second}){ next; } my $entry = "$relation $firstPOS $second $secondPOS"; $dependentWord{$entry}++; } close(OPENMY); print %is_stopwords, "\n";