I'm looking for a way to split a text into n-grams.Normally I would do something like:
import nltkfrom nltk import bigramsstring = "I really like python, it's pretty awesome."string_bigrams = bigrams(string)print string_bigrams
I am aware that nltk only offers bigrams and trigrams, but is there a way to split my text in four-grams, five-grams or even hundred-grams?
Thanks!