Implement the NGram model in julia