import configparser


def load_config(config_file_path):
    """ Parse a WORC configuration file.

    Arguments:
        config_file_path: path to the configuration file to be parsed.

    Returns:
        settings_dict: dictionary containing all parsed settings.
    """

    settings = configparser.ConfigParser()
    settings.read(config_file_path)

    settings_dict = {'ImageFeatures': dict(), 'General': dict(),
                     'SVMFeatures': dict()}

    settings_dict['ImageFeatures']['image_type'] =\
        str(settings['ImageFeatures']['image_type'])

    settings_dict['General']['FeatureCalculator'] =\
        str(settings['General']['FeatureCalculator'])

    settings_dict['General']['Preprocessing'] =\
        str(settings['General']['Preprocessing'])

    settings_dict['General']['PCE'] =\
        settings['General'].getboolean('PCE')

    settings_dict['General']['Segmentix'] =\
        settings['General'].getboolean('Segmentix')

    return settings_dict