def get_mode(mode):
    """Parse mode from TransXChange value"""
    if mode in ['tram', 'trolleyBus']:
        return 0
    elif mode in ['underground', 'metro']:
        return 1
    elif mode == 'rail':
        return 2
    elif mode in ['bus', 'coach']:
        return 3
    elif mode == 'ferry':
        return 4