use Lingua::EN::Tagger;

my $p = Lingua::EN::Tagger->new( 
    longest_noun_phrase => 5,
    weight_noun_phrases => 0
);

local $/ = "\n\n";

my %total;
while (<>) {
    my $tagged = $p->add_tags($_);
    my %proper = $p->get_proper_nouns( $tagged );

    print scalar keys %proper, "\n";
    while (my ($name, $count) = each %proper) {
	$total{$name} += $count;
    }
}

print "$total{$_} $_\n" for keys %total;
