Use with Text::Ngramme
my $c = ngram_counts($text, 3);
my %ct = %($c);
which does not work ( Scalar found where operator expected). I think this is a combination of not knowing what I am doing (still not very good with Perl) and embarrassing about what exactly I get from Text :: Ngram output. Help? I just want to look at the generated n-grams:
my @keys = sort {$ct{$a} cmp $ct{$b} } keys %ct;
foreach my $k (@keys) {
print "$k: $ct{$k}\n"
}
Edit: Stupid mistake on my part, thanks everyone.
source
share