Java port of Ngram module

This is Java port of Ngram module. Thank you