Every sequence of words in a book represents a potential candidate for an entry in the back-of-the-book index.
we extract from the training and the test data sets all the n-grams (up to the length of four), not crossing sentence boundaries.