use strict; use warnings; my $lexicon = <) { my ($POS, $Lemma) = split('\s',$sa); $emotive{$Lemma}=$POS } open my $inFile, '<', \$text; while (my $text = <$inFile>) { #this is some preprocessing for the text $text =~ s/\s+/ /g; $text =~ s/,/ ,/g; $text =~ s/æ/ æ/g; $text =~ s/\?/ !/g; #$text =~ tr/A-Z/a=z/; my @words = split(' ', $text); for my $word(@words) { if (exists $emotive{$word}) { print $word } } } #### thequickthe