in reply to N-gram comparison
Have you searched CPAN? Ngram or Trigram
Alternatively, write it yourself. It's not hard.