You can't get all the different sizes of n-grams at the same time, but you can get them all using multiple calls to get_ngrams
. There is an undocumented parameter n
to get_ngrams
that says the size of the n-grams you want listed.
In your code, if you say
my @ngramsarray = $ng3->get_ngrams(
n => 1,
orderby = >'frequency',
onlyfirst => 10,
normalize => 0);
you get this list
('T', 8, 'E', 4, 'X', 2, '_', 2, 'S', 2)