import pickle


def _load_dictionary(saved_location):
    """
    Loads a saved dictionary from a given location
    """

    with open(saved_location, "rb") as f:
        word_dict = pickle.load(f)
    with open(saved_location[:-4] + ".txt", "r") as f:
        max_len = int(f.read())
    return word_dict, max_len