Next / Previous / Contents / Shipman's homepage

9.6. KwicIndex.__isWord(): Test for a keyword character

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

    def __isWord(self, c):
        '''Test c to see if it is a keyword character.

          [ c is a unicode string of length 1 ->
              if c is a keyword start character, digit, or u'-' ->
                return True
              else -> return False
        '''

See Section 9.5, “KwicIndex.__isStart(): Test for a keyword start character”.

kwic.py
        #-- 1 --
        return ( self.__isStart(c) or
                 c.isdigit() or
                 (c == '-') )