Improved speed of word2ngrams and sentence2ngrams.

Allowed extracting 1-5 grams to be done with word boundaries.