Created
March 19, 2014 03:07
-
-
Save simoncozens/9634781 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Lingua::StopWords q(getStopWords); | |
use Lingua::EN::Inflect::Number qw/to_S/; | |
my $stop = getStopWords("en"); | |
$stop->{$_}++ for qw/thee thou ye shall unto hath/; | |
my %hash; | |
while (<>) { | |
chomp; | |
my @words = split /\s+/, $_; | |
for (@words) { | |
$_= to_S(lc $_); | |
next if $stop->{$_}; | |
$hash{$_}++; | |
} | |
} | |
print "$_; $hash{$_}\n" for sort keys %hash; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment