Next / Previous / Contents / Shipman's homepage

9.5. KwicIndex.__isStart(): Test for a keyword start character

kwic.py
# - - -   K w i c I n d e x . _ _ i s S t a r t

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

          [ c is a unicode string of length 1 ->
              if c is a letter or u'_' ->
                return True
              else -> return False
        '''
        return ( c.isalpha() or
                 (c == u'_') )