def read_all_templates(path):
    """
    Reads template file produced by collect_all_templates.py.
    """
    with open(path, encoding="utf8") as f:
        relation_translations = {}
        for line in f.readlines():
            ls = line.strip().split("\t")
            rel = ls[0]
            trans = ls[1]
            freq = ls[2] 
            if " </span> " in trans:
                continue
            trans = trans.replace("'s ", "is ")
            if rel not in relation_translations:
                relation_translations[rel] = []
            relation_translations[rel].append((rel, trans.lower(), freq))
        return relation_translations