def load_dict(path):
    """ Load a dictionary and a corresponding reverse dictionary from the given file
    where line number (0-indexed) is key and line string is value. """
    retdict = list()
    rev_retdict = dict()
    with open(path) as fin:
        for idx, line in enumerate(fin):
            text = line.strip()
            retdict.append(text)
            rev_retdict[text] = idx
    return retdict, rev_retdict