import yaml


def get_params(config):
    """
    Fetches the parameters necessary for text index creation.

    Parameters
    ----------
    config : str
        A path to the parameters configuration file
    
    Returns
    -------
    dict
        A dictionary containing the parameters for text index
        creation
    """
    params = ""
    with open(config, 'r') as conf:
            try:
                params = yaml.safe_load(conf)
            except Exception as e:
                print("Error creating index")
                print(e)
                raise Exception("Couldn't load config file: " + config)
    
    return params