if p == 0 then it is usual ngrams (specified in another issue) this issue deals with the case p > 0 only