def templatize(names, claim):
    """Transform a claim into a regex-capable template."""
    for name in names:
        while name in claim:
            claim = claim.replace(name, "name")

    while "knave" in claim:
        claim = claim.replace("knave", "k_id")

    while "knight" in claim:
        claim = claim.replace("knight", "k_id")

    while " am " in claim:
        claim = claim.replace(" am ", " is ")

    return claim.lower()