import csv


def load_phrase_database(f_abbreviations):
    """
    Load the dictionary of abbreviated steps created in the "import_data" step

    Args:
        f_abbreviations (str): Filename of the abbreviation dictionary

    Returns:
         A dictionary of abbreviations.
    """

    P = {}
    with open(f_abbreviations, "r") as FIN:
        CSV = csv.DictReader(FIN)
        for row in CSV:
            key = (tuple(row["phrase"].split()), row["abbr"])
            val = int(row["count"])
            P[key] = val
    return P