def subst(table, text):
    """
    Make 1-to-1 string substitutions using a two-column table.

    Given a translation table and a text, perform 1-to-1 string
    substitution on the text, replacing terms in the first column of the
    table with the corresponding terms in the second column. Substitution
    is performed on three forms for each term: the original term, all
    lowercase, and all uppercase.

    """
    for term1, term2 in table:
        text = text.replace(term1, term2)
        text = text.replace(term1.lower(), term2.lower())
        text = text.replace(term1.upper(), term2.upper())
    return text
