Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
nltk.util.ngrams nltk.bigrams nltk.PorterStemmer
from nltk.util import ngrams
sentence = 'this is a foo bar sentences and i want to ngramize it'
n = 6
sixgrams = ngrams(sentence.split …