What are N-grams?
I want to find N-grams for n=4 (fourgram), n=5 (fivegram), n=6 (sixgram), n=7(sevengram) for the Sentence - "dog that barks does not bite"
I know-
Unigrams(n=1): dog, that, barks, does, not, bite
Bigrams(n=2): dog that, that barks, bark does, does not, not bite
Trigrams(n=3): dog that barks, that bark does, barks does not, does not bite
How many N-grams can we find for the given sentence?
N-Grams is present for the sentence with at least 'N' no.of words. So, in your case "dog that barks does not bite" has 6 words, so you can frame 6-grams at most(1,2,3,4,5,6 - Grams) and not more than that. So, the result would be
4- gram : dog that barks does, that barks does not, barks does not bite,
5 - gram : dog that barks does not, that barks does not bite,
6 - gram : dog that barks does not bite