def load_schema(path):
    """Load a schema from path."""
    signatures = {}
    with open(path, 'r') as f:
        for line in f:
            parts = line.strip().split(' ')
            assert 3 <= len(parts)
            dist = parts[0]
            assert dist == 'bernoulli'
            feature = parts[1]
            domains = tuple(parts[2:])
            signatures[feature] = domains
    return signatures