Next / Previous / Contents / Shipman's homepage

9.9. KwicIndex.genWords(): Generate the index entries

Although the words used to create the KwicWord instances may have been lowercase, the order of generation is using the keys in the skip list, which are ordered by the upshifted words.

kwic.py
# - - -   K w i c I n d e x . g e n W o r d s

    def genWords(self, prefix=''):
        '''Generate the KwicWord instances in self.
        '''
        #-- 1 --
        for kwicWord in self.__skip.find(prefix.upper()):
            yield kwicWord

        #-- 2 --
        raise StopIteration