':type s: str
:rtype: bool'

def isNumber(self, s):

    transition_table = [[(-1), 0, 3, 1, 2, (-1)], [(-1), 8, (-1), 1, 4, 5], [(-1), (-1), (-1), 4, (-1), (-1)], [(-1), (-1), (-1), 1, 2, (-1)], [(-1), 8, (-1), 4, (-1), 5], [(-1), (-1), 6, 7, (-1), (-1)], [(-1), (-1), (-1), 7, (-1), (-1)], [(-1), 8, (-1), 7, (-1), (-1)], [(-1), 8, (-1), (-1), (-1), (-1)]]
    state = 0
    for char in s:
        inputType = InputType.INVALID
        if char.isspace():
            inputType = InputType.SPACE
        elif ((char == '+') or (char == '-')):
            inputType = InputType.SIGN
        elif char.isdigit():
            inputType = InputType.DIGIT
        elif (char == '.'):
            inputType = InputType.DOT
        elif ((char == 'e') or (char == 'E')):
            inputType = InputType.EXPONENT
        state = transition_table[state][inputType]
        if (state == (-1)):
            return False
    return ((state == 1) or (state == 4) or (state == 7) or (state == 8))
