import re


def simplify_strings(to_simplify, lower_case=True, simplifier=True):
    """
    Simplify a `string`, `set(strings)`, `list(strings)`, `keys in dict`
    Options for simplifying include: lower capitals, separators, both (standard), own set of simplifier

    Parameters
    ----------
    to_simplify : list, set, string
        the string(s) to simplify presented by itself or as part of another data format
    lower_case : bool, optional
        if the input shall be converted to only lower_case (standard: `True`)
    simplifier : str, optional
        the chars to be removed from the string. if type bool and True, standard chars ``_ , | \\n ' & " % * - \\`` used

    Returns
    -------
    dict
        simplified values ``{simplified_value: input_value}``
    """

    # PreProcessing the input
    if isinstance(simplifier, bool) and simplifier:
        simplifier = "[_, | \n ' & \" % \\ * -]"
    elif simplifier:
        simplifier = f"[{simplifier}]"

    if isinstance(to_simplify, str):
        to_simplify = [to_simplify]
    elif isinstance(to_simplify, set):
        to_simplify = list(to_simplify)
    elif isinstance(to_simplify, dict):
        to_simplify = list(to_simplify.keys())

    if not isinstance(to_simplify, list):
        raise TypeError("to_simplify needs to be either of type str, list, set or dict")

    simplified = dict()
    not_unique = set()

    def add_to_simplified(key, value):
        if key in simplified:
            not_unique.add(simplified[key])
            not_unique.add(value)
        else:
            simplified[key] = value

    for key in to_simplify:
        if simplifier and lower_case:
            add_to_simplified("".join(re.split(simplifier, key)).lower(), key)
        elif simplifier:
            add_to_simplified("".join(re.split(simplifier, key)), key)
        elif lower_case:
            add_to_simplified(key.lower(), key)
        else:
            raise ValueError("either simplifier or lower_case must be set")

    if not_unique:
        raise ValueError(
            f"simplification made the following entries not unique anymore."
            f"please provide different simplification method.\n{not_unique}"
        )
    return simplified