if '_concordance_index' not in self.__dict__:
    print('Building index...')
self._concordance_index = ConcordanceIndex(self.tokens, key=lambda s: s.lower()
    )
self._concordance_index.print_concordance(word, width, lines)
In NLTK, how do I get the concordance of a text?